Store Flash Data (Eeprom?) STM32F051
Moderator: Benj
-
- Posts: 1
- Joined: Fri Feb 23, 2018 7:53 pm
- Contact:
Store Flash Data (Eeprom?) STM32F051
Hello everyone,
I'm working quite a few years with flowcode for PIC but now I want to go for the STM32 controllers.
I've made some hardware for a project and used the STM32F051c8, because this one is in Flowcode.
The datasheet says :
The non-volatile memory is divided into two arrays:
–16 to 64 Kbytes of embedded Flash memory for programs and data
–Option bytes
But how can you read and write data to this flash data range?
It's not possible with the Eeprom symbol.
Kind regards,
Rene de Jong
I'm working quite a few years with flowcode for PIC but now I want to go for the STM32 controllers.
I've made some hardware for a project and used the STM32F051c8, because this one is in Flowcode.
The datasheet says :
The non-volatile memory is divided into two arrays:
–16 to 64 Kbytes of embedded Flash memory for programs and data
–Option bytes
But how can you read and write data to this flash data range?
It's not possible with the Eeprom symbol.
Kind regards,
Rene de Jong
- LeighM
- Matrix Staff
- Posts: 2178
- Joined: Tue Jan 17, 2012 10:07 am
- Has thanked: 481 times
- Been thanked: 699 times
- Contact:
Re: Store Flash Data (Eeprom?) STM32F051
Hi,
We don't currently have any support for in program writing of Flash memory on STM32 devices.
We'll add it to our list for possible future additions.
We don't currently have any support for in program writing of Flash memory on STM32 devices.
We'll add it to our list for possible future additions.
- LeighM
- Matrix Staff
- Posts: 2178
- Joined: Tue Jan 17, 2012 10:07 am
- Has thanked: 481 times
- Been thanked: 699 times
- Contact:
Re: Store Flash Data (Eeprom?) STM32F051
Hi,
I've created some macros that might work, sorry I've not had chance to test them.
Just ensure that the Address is not within your program space!
Hope it helps, let me know how it goes.
ps. the FlashByte won't work on F0, but should on F4
I've created some macros that might work, sorry I've not had chance to test them.
Just ensure that the Address is not within your program space!
Hope it helps, let me know how it goes.
ps. the FlashByte won't work on F0, but should on F4
- Attachments
-
- ReadHalfWord.fcm
- (491 Bytes) Downloaded 346 times
-
- ReadWord.fcm
- (487 Bytes) Downloaded 334 times
-
- FlashWord.fcm
- (607 Bytes) Downloaded 335 times
-
- FlashHalfWord.fcm
- (615 Bytes) Downloaded 329 times
-
- FlashByte.fcm
- (606 Bytes) Downloaded 335 times
-
- Posts: 198
- Joined: Sun Nov 04, 2018 7:13 pm
- Has thanked: 27 times
- Been thanked: 33 times
- Contact:
Re: Store Flash Data (Eeprom?) STM32F051
Hi,
I did try this a long time ago. I recently took another look and couldn't get it to work. Might (probably) be my fault.
Could you take a look at this again when you have the time? A little flash byte read byte program would be really helpful.
Thanks!
cahd
I did try this a long time ago. I recently took another look and couldn't get it to work. Might (probably) be my fault.
Could you take a look at this again when you have the time? A little flash byte read byte program would be really helpful.
Thanks!
cahd
- LeighM
- Matrix Staff
- Posts: 2178
- Joined: Tue Jan 17, 2012 10:07 am
- Has thanked: 481 times
- Been thanked: 699 times
- Contact:
Re: Store Flash Data (Eeprom?) STM32F051
Hi Chad,
Depends on how you want to use it.
Would a lookup table suffice?
The Flash has it's limitations as it needs to be block erased.
So byte write/read isn't going to be efficient.
Leigh
Depends on how you want to use it.
Would a lookup table suffice?
The Flash has it's limitations as it needs to be block erased.
So byte write/read isn't going to be efficient.
Leigh
-
- Posts: 198
- Joined: Sun Nov 04, 2018 7:13 pm
- Has thanked: 27 times
- Been thanked: 33 times
- Contact:
Re: Store Flash Data (Eeprom?) STM32F051
I haven't used a lookup table before, but sure. I think I am going to have to ultimately store like 20 variables.
Chad
Chad
- STibor
- Posts: 263
- Joined: Fri Dec 16, 2011 3:20 pm
- Has thanked: 116 times
- Been thanked: 113 times
- Contact:
Re: Store Flash Data (Eeprom?) STM32F051
Hello!
Excellent work!
If the page block is not empty, you cannot write data.
How do I delete the data stored on the page?
Excellent work!
If the page block is not empty, you cannot write data.
How do I delete the data stored on the page?
Re: Store Flash Data (Eeprom?) STM32F051
Hello,
I tested these macros
Reading is not a problem and it works
I wrote and tested but it was written only once, it is not written a second time
Re: Store Flash Data (Eeprom?) STM32F051
stm32-flash eeprom
- Attachments
-
- FLASH-ERASE.fcm
- (553 Bytes) Downloaded 141 times
Re: Store Flash Data (Eeprom?) STM32F051
- Attachments
-
- FlashHalfWord.fcm
- (615 Bytes) Downloaded 125 times