2018-09-16 12:24 AM
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
2018-09-16 03:09 AM
Have you tried other tools, like the debugger of your IDE? They may automatically remove protection for you.
2018-09-16 05:25 AM
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.
2018-09-16 05:28 AM
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.
2018-09-16 06:44 AM
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.