cancel
Showing results for 
Search instead for 
Did you mean: 

STM32H745 FLASH does not store the data?

EOzde.1
Associate III

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.

1 ACCEPTED SOLUTION

Accepted Solutions

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.

View solution in original post

6 REPLIES 6
Peter BENSCH
ST Employee

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.

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?

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
Guru

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
Associate III

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 Employee

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.