Skip to main content
EOzde.1
Associate III
January 24, 2022
Solved

STM32H745 FLASH does not store the data?

  • January 24, 2022
  • 6 replies
  • 1487 views

Hi,

I write some data to the 0x080A0000 (sector 5 )address which is not protected. I write the data and ı can read that data too. There is no problem with that. But if I comment out the line which writes to data to the flash and run the program. That time I could not read the data that is written before. Shouldn't the flash keep that data even the power goes off? Any suggestions.

Thank you.

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

Sure you can, see RM0399, section 4.5 for details or the examples FLASH_WriteProtection in the repository (locally or on Github).

Regards

/Peter

6 replies

Peter BENSCH
ST Technical Moderator
January 24, 2022

Of course you can store data in flash. However, since you have not protected that block and new firmware is loaded into the flash when a line is changed and the program recompiled, it is quite possible that the data will then be overwritten.

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.
EOzde.1
EOzde.1Author
Associate III
January 24, 2022

Thanks for the answer, sir. I know that I can configure the protection settings via stm32programmer. But how can I do that in code itself? Could I change this property during the runtime?

Peter BENSCH
Peter BENSCHBest answer
ST Technical Moderator
January 24, 2022

Sure you can, see RM0399, section 4.5 for details or the examples FLASH_WriteProtection in the repository (locally or on Github).

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.
TDK
January 24, 2022

Option bytes can also be set using STM32CUBEPROGRAMMER and persist across resets/power downs.

"If you feel a post has answered your question, please click ""Accept as Solution""."
EOzde.1
EOzde.1Author
Associate III
January 25, 2022

After all, there were some settings about boot addressing in KEIL. Like, do not touch the area between address A and address B. In cubeIDE, I couldn't find it in debug configuration. It is maybe about the Linker file. I don't know about it.

Thank you.

Peter BENSCH
ST Technical Moderator
January 25, 2022

OK.

When your question is answered, please mark this topic as answered by choosing Select as Best for the preferred answer. This will help other users find that answer faster.

/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.