STM32L1 system bootloader erase
Hi everyone,
I am using an STM32h7 to program an STM32L151 using the system bootloader through usart.
When I ask for the supported commands, I get that the erase command is between them but, surprisingly, when I try to use it I get a nack.
Then I read that some MCUs do not support the erase command and so my first question is: does the STM32L151 support the erase (or extended erase) command?
Then I tried to erase the flash enabling and then disabling the RDP level 1, that is working but, after this operation, I find also the option bytes changed respect to the default (I read {0xffff0000, 0xffff0000, 0xffff0000, 0xffff0000, 0xffff0000} instead of {0xFF5500AA, 0xff0700F8, 0xffff0000, 0xffff0000, 0xffff0000} at address 0x1FF80000).
So at the moment my firmware update process is working but, instead of sending a single erase command I have to:
- set RDP level 1
- restart the uP
- set RDP level 0
- restart the uP
- re-write default option bytes
- restart the uP
My second question is: am I doing something wrong or is expected to follow these steps the perform a flash erase?
Thank you,
regards
Arianna

