Skip to main content
lorenzo meneghello_2
Associate III
May 21, 2018 9:14 AM UTC
Question

Memory Protection

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.

    This topic has been closed for replies.

    6 replies

    Nesrine M_O
    Associate
    May 21, 2018 9:44 AM UTC
    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-

    lorenzo meneghello_2
    Associate III
    May 21, 2018 12:13 PM UTC
    Posted on May 21, 2018 at 12:13

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

    Nesrine M_O
    Associate
    May 21, 2018 12:23 PM UTC
    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-

    Tilen MAJERLE
    ST Employee
    May 22, 2018 7:55 AM UTC
    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
    Senior III
    May 22, 2018 1:17 PM UTC
    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.