cancel
Showing results for 
Search instead for 
Did you mean: 

Help on storing live/changed data into STM32F4 board and retrieving it in it in its own code

WNguy.1
Associate II

Hi fellow programmers! I need assistance on where I would start in trying to flash/store live new data into an STM32 micro controller and then retrieving it to use again in the case that it resets or turns Off/On.

Any key words or directions would be greatly appreciated!

1 ACCEPTED SOLUTION

Accepted Solutions
Andrew Neil
Evangelist III

"I need assistance on where I would start"

For a start, you will need to be a competent 'C' programmer, with at least a working understanding of microcontroller architecture.

Assuming you have that, the first place to start with any new device is always to go to the manufacturer's Product Page - there you will find specifications, application notes, examples, tools, etc, etc, ...

https://www.avrfreaks.net/comment/2839426#comment-2839426

You haven't said which particular STM32F4 you're considering, so here's one at random:

https://www.st.com/en/microcontrollers-microprocessors/stm32f401.html

On the 'Resources' Tab, choose 'Technical Literature' and then 'Application Notes'

Spend some time browsing those - there's loads of useful stuff!

Juts to be awkward, it seems that the App Note you require is not listed!

:persevering_face:

AN3969: EEPROM emulation in STM32F40x/STM32F41x microcontrollers

https://www.st.com/content/ccc/resource/technical/document/application_note/ec/dd/8e/a8/39/49/4f/e5/DM00036065.pdf/files/DM00036065.pdf/jcr:content/translations/en.DM00036065.pdf

See also:

https://www.st.com/en/embedded-software/stsw-stm32066.html

https://community.st.com/s/question/0D50X00009XkhQn/stm32f4-eeprom-emulation-hal-library

View solution in original post

4 REPLIES 4

Start with the Reference Manual, and the description of the FLASH subsystem and registers

Example, try this

STM32Cube_FW_F4_V1.24.1\Projects\STM32F413ZH-Nucleo\Examples\FLASH\FLASH_EraseProgram

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
TDK
Guru

To expand a little further, it is common to use the last page of flash to store program settings that you can read out and re-write during program execution. Note that flash isn't like RAM--you need to erase the entire page before you can write to any of it.

If you feel a post has answered your question, please click "Accept as Solution".
Andrew Neil
Evangelist III

"I need assistance on where I would start"

For a start, you will need to be a competent 'C' programmer, with at least a working understanding of microcontroller architecture.

Assuming you have that, the first place to start with any new device is always to go to the manufacturer's Product Page - there you will find specifications, application notes, examples, tools, etc, etc, ...

https://www.avrfreaks.net/comment/2839426#comment-2839426

You haven't said which particular STM32F4 you're considering, so here's one at random:

https://www.st.com/en/microcontrollers-microprocessors/stm32f401.html

On the 'Resources' Tab, choose 'Technical Literature' and then 'Application Notes'

Spend some time browsing those - there's loads of useful stuff!

Juts to be awkward, it seems that the App Note you require is not listed!

:persevering_face:

AN3969: EEPROM emulation in STM32F40x/STM32F41x microcontrollers

https://www.st.com/content/ccc/resource/technical/document/application_note/ec/dd/8e/a8/39/49/4f/e5/DM00036065.pdf/files/DM00036065.pdf/jcr:content/translations/en.DM00036065.pdf

See also:

https://www.st.com/en/embedded-software/stsw-stm32066.html

https://community.st.com/s/question/0D50X00009XkhQn/stm32f4-eeprom-emulation-hal-library

WNguy.1
Associate II

Wow, amazing, thanks so much for the great advice and help! I'm using the Nucleo-F413ZH and programmed a CAN bus interface with a motor, in case of a power failure or general functionality, I'd want it to store its most recent position. I should be able to find the most optimal scenario if it'd be flashing the memory or using EEPROM for example.