2020-08-17 11:32 AM
ST provides a ROM bootloader in the STM32F303RDTx. I am able to jump into the bootloader from my application, and update the flash when read out protection (RDP) is disabled (level 0). When RDP is set to level 1, all attempts to disable RDP (which mass erases the flash) fail. Everything I have tried so far seems to trigger a device reset putting me back into my application.
ST's documentation (AN2606 and AN3155) states that this should be possible, but nothing I've tried works. I have tried ST's GUI demo flasher. I have also tried mass erasing the device and disabling the read out protection via the ST's command line client.
The only thing I can think of is that I am jumping into the bootloader rather than using the boot pins to power up into the bootloader. However, even that seems to be something ST has accounted for, as they state that they periodically refresh the watchdog (IWD) in case it has been enabled by calling code.
Attempt to disable readout protection:
C:\Program Files (x86)\STMicroelectronics\Software\Flash Loader Demo>STMFlashLoader.exe -c --pn 6 --br 115200 --db 8 --pr EVEN -i STM32F3_03_02_512K -p --drp
Opening Port [OK]
Activating device [KO]
Unrecognized device... Please, reset your device then try again
Please, reset your device then press any key to continue
Press any key to continue ...
Attempt to mass erase:
C:\Program Files (x86)\STMicroelectronics\Software\Flash Loader Demo>STMFlashLoader.exe -c --pn 6 --br 115200 --db 8 --pr EVEN -i STM32F3_03_02_512K -e --all
Opening Port [OK]
Activating device [KO]
Unrecognized device... Please, reset your device then try again
Please, reset your device then press any key to continue
Press any key to continue ...
The above commands do execute without error when the readout protection is not enabled.
Attempt to disable readout protection (when it is already disabled):
C:\Program Files (x86)\STMicroelectronics\Software\Flash Loader Demo>STMFlashLoader.exe -c --pn 6 --br 115200 --db 8 --pr EVEN -i STM32F3_03_02_512K -p --drp
Opening Port [OK]
Activating device [OK]
disabling read protection [OK]
reseting device [KO]
I have also posted this on SO here.