cancel
Showing results for 
Search instead for 
Did you mean: 

I am using stm32 F030R8 board in my project. What is the best way to write/read to the not volotile memory (flash).

YShko.1
Associate II

For example i want to write to the flash tow string variables.

1. name of board

2. verssion

and every time I turn on the board I want to read them in to my code.

thanks in advance

1 ACCEPTED SOLUTION

Accepted Solutions

I mean the same directory level.

The firmware library contains, among other things, sample programs for various development platforms (NUCLEO, DISCOVERY, EVAL), which, however, each refer with relative paths to the libraries also included, e.g. Driver/STM32F0xx_HAL_Driver.

To try out and/or modify a project present there, it is best to copy the not yet compiled project in the original, e.g. 

  • Projects/STM32F030R8-Nucleo/Examples/FLASH/FLASH_EraseProgram

to e.g.

  • Projects/STM32F030R8-Nucleo/Examples/FLASH/FLASH_EraseProgram_TEST

After you have tried it out and changed it to your needs, you can compare the original directory with the copied and changed one to have a summary of all important changes.

Regards

/Peter

In order to give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.

View solution in original post

3 REPLIES 3
Peter BENSCH
ST Employee

There are also many example programs in the firmware of the individual STM32 families, e.g. for NUCLEO-F030R8 the FLASH_EraseProgram (also on Github), which can be used very well as a starting point for your development.

Please note that the firmware uses relative paths and references to libraries within the firmware. So it is best to copy the respective example directory to another name on the same level and then import and change it from there. Later, it may be easier to find changes made by comparing files.

Maybe that will help you?

Regards

/Peter

In order to give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.
YShko.1
Associate II

Hello Peter,

Thank you very much!

your answer help alot.

However, what do you mean when ypu say "best to copy the respective example directory to another name on the same level"

what is same level means?

I mean the same directory level.

The firmware library contains, among other things, sample programs for various development platforms (NUCLEO, DISCOVERY, EVAL), which, however, each refer with relative paths to the libraries also included, e.g. Driver/STM32F0xx_HAL_Driver.

To try out and/or modify a project present there, it is best to copy the not yet compiled project in the original, e.g. 

  • Projects/STM32F030R8-Nucleo/Examples/FLASH/FLASH_EraseProgram

to e.g.

  • Projects/STM32F030R8-Nucleo/Examples/FLASH/FLASH_EraseProgram_TEST

After you have tried it out and changed it to your needs, you can compare the original directory with the copied and changed one to have a summary of all important changes.

Regards

/Peter

In order to give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.