2018-05-21 02:14 AM
Hi all,
I've read the entire reference manual about Memory protection, my question is:
If I set the protection level 1, and I wanted to change it 0 my Main Flash will be erased...
There's a way to avoid this? Because if I have the last page with personal data, I will lose them...
Thanks.
Lorenzo.
2018-05-21 02:44 AM
Hi
lorenzo.meneghello
,The main Flash memory and backup SRAM are erased when the RDP changes from level 1 to 0.
You may protect your personal data usingThe PCROP : is a read and write protection of an IP code in Flash memory. It prevents proprietary code from possible modification or readout by the end-user code, debugger tools or RAM Trojan code.
For more details about PCROB, I recommend you to have a look to
http://www.st.com/en/embedded-software/x-cube-pcrop.html
-Nesrine-
2018-05-21 05:13 AM
I'm using the STM32F0 family, it's also possible ?
2018-05-21 05:23 AM
Hi
lorenzo.meneghello
,For the STM32F0 family , you may use the write protection: is used to protect the content of specified sectors against code update or erase. This protectionis implemented with a granularity of one sector.
-Nesrine-
2018-05-21 05:55 AM
Maybe I explained myself wrong, e.g. I use the Page 0-30 for code and the Page 31 for my data that can be change in-application. I would like to protect read
(page 0-30) from outside (boot from System boot loader so USART,ecc..), but if I wanted to update the program, I would not want to lose my data.
2018-05-22 12:55 AM
Dear
lorenzo.meneghello
,if you use custom bootloader, then you do not need to change RDP from level 1 to level 0 to be able to update firmware. But you have to write your own bootloader which is capable of SW update.
In case of changing from level 1 to level 0, you will loose your data.
Best regards,
Tilen
2018-05-22 06:17 AM
for a very small amount of data, I used the DS3232, for my RTC and 256bytes of User data.
https://www.digikey.com/product-detail/en/maxim-integrated/DS3232SN-T-R/DS3232SN-T-RTR-ND/1197581
or a SPI flash chip of course.
the other solution is to never update. like your microwave oven.