cancel
Showing results for 
Search instead for 
Did you mean: 

Memory Protection

lorenzo meneghello_2
Associate II
Posted on May 21, 2018 at 11:14

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.

6 REPLIES 6
Nesrine M_O
Lead II
Posted on May 21, 2018 at 11:44

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-

Posted on May 21, 2018 at 12:13

I'm using the STM32F0 family, it's also possible ?

Posted on May 21, 2018 at 12:23

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-

Posted on May 21, 2018 at 12:55

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.

Tilen MAJERLE
ST Employee
Posted on May 22, 2018 at 09:55

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

T J
Lead
Posted on May 22, 2018 at 15:17

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.