Skip to main content
KNaga.10
Associate
September 16, 2018
Question

"some flash pages are read protected" error STM32

  • September 16, 2018
  • 4 replies
  • 2031 views

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

This topic has been closed for replies.

4 replies

Pavel A.
September 16, 2018

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

KNaga.10
KNaga.10Author
Associate
September 16, 2018

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
KNaga.10Author
Associate
September 16, 2018

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.

Tesla DeLorean
Guru
September 16, 2018

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 (See Profile) Up vote any posts that you find helpful, it shows what's working..