cancel
Showing results for 
Search instead for 
Did you mean: 

"some flash pages are read protected" error STM32

KNaga.10
Associate II

I have an STM32 microcontroller on a device, which I program using ST-link. Due to a power issue, or something, suddenly few flash pages have become read protected. I don't know how to reverse this. I use the ST-link Utility tool in windows, and I tried to perform full chip erase, but it throws the error as "some flash pages are read protected". I am able to program the microcontroller, but some things are not working, like it is supposed to store accelerometer data in a buffer, but I only get zeros on reading the buffer. So, I suspect this read protection is the problem. Can anyone please let me know how to disable this read protection, so that I can perform a full chip erase and load the program again.

Thanks in advance

4 REPLIES 4
Pavel A.
Evangelist III

Have you tried other tools, like the debugger of your IDE? They may automatically remove protection for you.

KNaga.10
Associate II

I tried using keil, but it says no ST-Link found. Atleast the STlink utility connects to the device. keil is unable to connect even.

KNaga.10
Associate II

In the ST link utility, when I do sector erase, I can erase upto 163 sectors out of 255. From 164 to 255 it says read protected.

Keil can't connect with an open session in the ST-LINK Utilities.

The Utilities have been deprecated in preference for the new STM32 Cube Programmer tools.

https://www.st.com/en/development-tools/stm32cubeprog.html

Also would recommend updating the firmware on the ST-LINK to current. Try different cables, ports, or PC.

If there continues to be on going issues connecting with the chip or its functionality, you might have to replace it.

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..