Skip to main content
YShko.1
Associate III
November 15, 2022
Solved

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

  • November 15, 2022
  • 3 replies
  • 804 views

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

This topic has been closed for replies.
Best answer by Peter BENSCH

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

3 replies

Peter BENSCH
ST Technical Moderator
November 18, 2022

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
YShko.1Author
Associate III
November 22, 2022

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?

Peter BENSCH
Peter BENSCHBest answer
ST Technical Moderator
November 22, 2022

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.