Skip to main content
Associate
October 11, 2023
Question

after change the RDP of FLASH from lv0 to lv1, the target could not be detected on NUCLEO-C031C6

  • October 11, 2023
  • 5 replies
  • 4761 views

hello:

as mentions on title,

my target board is NUCLEO-C031C6. and I change the read protection level of flash from 0 to 1(0xAA to 0xBB) by STM32CubeProgrammer.

after that, the target board can not be connect any more.(keil c/ cubeMX/ cubeProgrammer/ ST-Link Utility...)

the error message is as below:

bvd_0-1697010612153.png

 

I have read related issues on forums and tried some methods from forum, ...like change [reset mode], [mode], or hold reset button and release followed by click [connect]...!

however that doesn't seem to be helpful for my situation.

any other advice will be very appreciate,

thanks~

 

This topic has been closed for replies.

5 replies

Simon.T
ST Employee
October 11, 2023

Hello @bvd ,

 

Normally on RDP level 1 the debug port should be available. However do you know if you configure other option byte like boot_lock ? 

 

BR,

 

Simon

bvdAuthor
Associate
October 11, 2023

hello Simon:

thanks so much for replying.

about "However do you know if you configure other option byte like boot_lock ?"...maybe!

I just selected [0xBB](level_1) and then click [APPLY]...on STM32CubeProgrammer.

after reconnect power, the board can not be connect any more as previous mention...

I can not check the values of register without connecting...

is there any way to recover ?

thanks very much!!

 

Simon.T
ST Employee
October 12, 2023

Hello @bvd ,

 

I'm asking this detail, because if you put RDP level 1 and boot_lock in the same time, the debug capability will be disabled and the device locked. 

Can you try to connect the product through the Cube Programmer power down option ?:

SimonT_0-1697102202339.png

Best regards,

 

Simon

 

FArdi.1
Associate II
January 25, 2024

I found this thread by searching. Is there any way to recover the board?

I wrote BOOT_LOCK and RDP level1 at same time. Now I'm unable to connect to nucleo board.

RM doc mentioned that it's possible to reset it back. But now I can't even connect to it using STM32CubeProgrammer.

 

FArdi1_0-1706161946452.png

 

 

bvdAuthor
Associate
January 25, 2024

hello:

i am sorry, this issue still exists, i can't do anything without connecting the mcu.

FArdi.1
Associate II
January 25, 2024

Hi @bvd , so sorry the hear that, after so many months without solution

 

I think ST should be able to duplicate the problem since we're using same NUCLEO-C031C6 board.

Just now I tried on my own PCBA with STM32C031K6. Same thing happen. All possible connection modes tried, but all failed to connect (hot plug/normal/under reset/power down).

 

Below is the steps. Attached is the logs (using CLI commands):

1. Read option byte ( stm32_programmer_cli -c port=SWD freq=8000 mode=UR -ob displ )
2. Set boot lock ( stm32_programmer_cli -c port=SWD freq=8000 mode=UR -ob BOOT_LOCK=0x1 )
3. Read option byte ( stm32_programmer_cli -c port=SWD freq=8000 mode=UR -ob displ )
4. Set RPD to level 1 ( stm32_programmer_cli -c port=SWD freq=8000 mode=UR -ob RDP=0xBB ) --------------->>>>>>>>>>> FAILED
5. Read option byte ( stm32_programmer_cli -c port=SWD freq=8000 mode=UR -ob displ )

 

Simon.T
ST Employee
January 25, 2024

Hello, 

 

To lose debug capability when the RDP level 1 is set in association of BOOT_LOCK is the normal behavior.

This behavior is described in the FLASH security register (FLASH_SECR) page 78 via a caution note: 

SimonT_0-1706169437689.png

After setting RDP level 1 and boot lock, re-enabling of debug capabilities is possible only by setting the DBG_SWEN bit by the application code.

 

Best regards,

 

Simon

 

FArdi.1
Associate II
January 25, 2024

This means my boards are unrecoverable because I never prepare to access DBG_SWEN register in my application.

I'm expecting this information to be mentioned near the BOOT_LOCK .

 

My understanding of "debug capability disable" was unable to debug during runtime, but should always be able to connect under reset. But that's not the case.

 

 

 

Jocelyn RICARD
ST Employee
January 25, 2024

Hello @FArdi.1 ,

I'm sorry that you bricked your board. I agree the RM should add a warning about this. I will ask for it.

This BOOT_LOCK mechanism is an improvement of the security achieved while staying in RDP Level1.

Best regards

Jocelyn