2023-10-11 01:02 AM
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:
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~
2023-10-11 01:38 AM
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
2023-10-11 01:51 AM
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!!
2023-10-12 02:17 AM
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 ?:
Best regards,
Simon
2023-10-12 03:09 AM
hello Simon:
I have try (hot plug/ normal/ under reset/ power down) mode, it still not work,...the target can not be detected and show message as below:
the only different is when I click [Connect] on power down mode, the error message appears 1 sec slower than other modes.
thanks so much ~
2024-01-24 09:53 PM
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.
2024-01-24 11:02 PM
hello:
i am sorry, this issue still exists, i can't do anything without connecting the mcu.
2024-01-24 11:19 PM
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 )
2024-01-25 12:14 AM
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:
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
2024-01-25 12:17 AM - edited 2024-01-25 12:19 AM
Hello @FArdi.1 ,
BOOT_LOCK=0x1 and RDP=0xBB, as stated in the reference manual
https://www.st.com/resource/en/reference_manual/rm0490-stm32c0x1-advanced-armbased-32bit-mcus-stmicroelectronics.pdf
3.7.13 FLASH security register (FLASH_SECR)
Caution: If the bit is set in association with RDP level 1, the debug capabilities are disabled,
except in the case of a bad OBL (mismatch).
So you will not able to connect, except if you re-enable the debug link in your code.
For example on button press :
void HAL_GPIO_EXTI_Rising_Callback(uint16_t GPIO_Pin) {
//This will reopen the debug
SET_BIT(FLASH->ACR, FLASH_ACR_DBG_SWEN);
}
Then you can connect in hotplug mode and do a regression
stm32_programmer_cli -c port=SWD freq=8000 mode=hotplug -ob RDP=0xAA BOOT_LOCK=0
Take care any trial to connect a part in RDP1 will lock the flash and will request a power cycle to have the embedded software running again.
Br,
Frantz