Skip to main content
KSing.4
Associate
October 21, 2021
Question

Flash programming erase step marking few sectors write protection

I am having an issue with the firmware update on STM32F427 MCU by using the ST-Link utility tool and Keil debugging functionality. When I reload the new program on MCU, sporadically flash erase step marking few sectors are write-protected. I used the Option Bytes option to unselect all->Apply command, but the command threw an internal command error.

I tried with ST_Link command utility also, it does not help

ST-LINK_CLI.exe -ME

STM32 ST-LINK CLI v3.6.0.0

STM32 ST-LINK Command Line Interface

ST-LINK SN: 39FF6E064D42343842212543

ST-LINK Firmware version: V2J29S7

Connected via SWD.

SWD Frequency = 4000K.

Target voltage = 1.9 V

Connection mode: Normal

Reset mode: Hardware reset

Device ID: 0x419

Device flash Size: 2048 Kbytes

Device family: STM32F42xxx/F43xxx

Full chip erase...

Internal command error

Read out protection is activated

ST-LINK_CLI.exe -c HOTPLUG -OB RDP=1

0693W00000FDFJyQAP.png

This topic has been closed for replies.

2 replies

TDK
October 21, 2021

You can try using STM32CubeProgrammer instead.

If option bytes are getting set to random values, perhaps delve into when/why that's happening in the first place and correct. It is not normal behavior.

"If you feel a post has answered your question, please click ""Accept as Solution""."
KSing.4
KSing.4Author
Associate
October 22, 2021

Thanks for the response, indeed the cube programmer application is able to reset the write-protected flag. I observed this flag resetting issue when I use the Keil debugger, whereas if I use the command line flash erase and reprogramming the MMU does not create any issue. Have you come across any issues with the Keil debugger before?