cancel
Showing results for 
Search instead for 
Did you mean: 

STM32C031 Flash Memory Protection Fail to Reconnect

Bugfarmer
Associate II

Hi All,

 

Using STM32CubeProgrammer with the ST-LINK in SWD mode.

If the RDP flag is set to 0xBB (level 1) and programmed the programmer can no longer connect to the device.

How can I reconnect to the device to set it back to 0xAA?

 

_Carl_

1 ACCEPTED SOLUTION

Accepted Solutions
Bugfarmer
Associate II

Solved! (I think)

Make sure nBOOT0, nBOOT1 and nBOOT_SEL are all set. Make sure BOOT_LOCK is clear.

Setting the Read Protection to 0xBB works as before. However, it is possible to connect to the device again and restore it to 0xAA.

This would appear to be contrary to the description given in RM0490 Rev 3. From what I can work out: ultimately, it was the BOOT_LOCK bit that was the problem.

 

The next problem is how to mark this thread as solved.

View solution in original post

5 REPLIES 5
Andrew Neil
Super User

Do a full chip erase?

A complex system that works is invariably found to have evolved from a simple system that worked.
A complex system designed from scratch never works and cannot be patched up to make it work.
TDK
Super User

Holding BOOT0 high during reset may let you connect with SWD, do a full chip erase, and recover the chip.

You should be able to connect under RDP1 unless it's actively modifying option bytes, erasing flash, going into low power modes, or reassigning SWD pins.

If you feel a post has answered your question, please click "Accept as Solution".

Hi TDK,

BOOT0 is SWCL. Therefore I cannot control it. It is under the control of the STM32CubeProgrammer. Unless, there is a setting in that to help?

Bugfarmer
Associate II

Solved! (I think)

Make sure nBOOT0, nBOOT1 and nBOOT_SEL are all set. Make sure BOOT_LOCK is clear.

Setting the Read Protection to 0xBB works as before. However, it is possible to connect to the device again and restore it to 0xAA.

This would appear to be contrary to the description given in RM0490 Rev 3. From what I can work out: ultimately, it was the BOOT_LOCK bit that was the problem.

 

The next problem is how to mark this thread as solved.


@Bugfarmer wrote:

The next problem is how to mark this thread as solved.


https://community.st.com/t5/community-guidelines/help-others-to-solve-their-issues/ta-p/575256 

A complex system that works is invariably found to have evolved from a simple system that worked.
A complex system designed from scratch never works and cannot be patched up to make it work.