cancel
Showing results for 
Search instead for 
Did you mean: 

Option bytes read fail and the core is locked up after reset MCU to factory settings

wesleywong
Associate II

Hi ST team,

I am using STM32U5G9J-DK2 board and the verson of STM32CubeProgrammer is v2.21.0.

I tried to reset MCU to factory settings (in option byte tab) using STM32CubeProgrammer but failed.

After that, STM32CubeProgrammer could no longer connect to the board with below log.

14:23:14 : STM32CubeProgrammer API v2.21.0 | Windows-64Bits 
14:23:25:813 : Selected loader: C:\Program Files\STMicroelectronics\STM32Cube\STM32CubeProgrammer\bin/ExternalLoader/MX66UW1G45G_STM32H7S78-DK.stldr
14:23:25:814 : External loader C:\Program Files\STMicroelectronics\STM32Cube\STM32CubeProgrammer\bin/ExternalLoader/MX66UW1G45G_STM32H7S78-DK.stldr is unloaded
14:23:25:814 : Selected loader: C:\Program Files\STMicroelectronics\STM32Cube\STM32CubeProgrammer\bin/ExternalLoader/MX66UW1G45G_STM32H7S78-DK.stldr
14:23:25:814 : External loader C:\Program Files\STMicroelectronics\STM32Cube\STM32CubeProgrammer\bin/ExternalLoader/MX66UW1G45G_STM32H7S78-DK.stldr is loaded
14:23:28:572 : UR connection mode is defined with the HWrst reset mode
14:23:28:590 : ST-LINK SN  : 003200363233511439363634
14:23:28:590 : ST-LINK FW  : V3J16M8
14:23:28:590 : Board       : STM32U5G9J-DK2
14:23:28:591 : Voltage     : 3.28V
14:23:28:595 : SWD freq    : 8000 KHz
14:23:28:595 : Connect mode: Hot Plug
14:23:28:595 : Reset mode  : Hardware reset
14:23:28:598 : Device ID   : 0x476
14:23:28:617 : Revision ID : Rev Z
14:23:28:637 : Reading data...
14:23:28:638 : r ap 0 @0x0BFA07A0 0x00000004 bytes Data 0x00000080
14:23:28:738 : r ap 0 @0x0BFA07A0 0x00000004 bytes Data 0x00000018
14:23:28:738 : Reading data...
14:23:28:739 : r ap 0 @0x0BFA07A0 0x00000004 bytes Data 0x00000018
14:23:28:840 : r ap 0 @0x0BFA07A0 0x00000004 bytes Data 0x00000018
14:23:28:840 : Reading data...
14:23:28:841 : r ap 0 @0x0BFA07A0 0x00000004 bytes Data 0x00000018
14:23:28:941 : r ap 0 @0x0BFA07A0 0x00000004 bytes Data 0x00000018
14:23:28:942 : Reading data...
14:23:28:942 : r ap 0 @0x0BFA07A0 0x00000004 bytes Data 0x00000018
14:23:29:043 : r ap 0 @0x0BFA07A0 0x00000004 bytes Data 0x00000018
14:23:29:043 : Reading data...
14:23:29:044 : r ap 0 @0x0BFA07A0 0x00000004 bytes Data 0x00000018
14:23:29:144 : r ap 0 @0x0BFA07A0 0x00000004 bytes Data 0x00000018
14:23:29:145 : Reading data...
14:23:29:145 : r ap 0 @0x0BFA07A0 0x00000004 bytes Data 0x00000018
14:23:29:246 : r ap 0 @0x0BFA07A0 0x00000004 bytes Data 0x00000018
14:23:29:247 : Reading data...
14:23:29:247 : r ap 0 @0x0BFA07A0 0x00000004 bytes Data 0x00000018
14:23:29:348 : r ap 0 @0x0BFA07A0 0x00000004 bytes Data 0x00000018
14:23:29:349 : Reading data...
14:23:29:349 : r ap 0 @0x0BFA07A0 0x00000004 bytes Data 0x00000018
14:23:29:450 : r ap 0 @0x0BFA07A0 0x00000004 bytes Data 0x00000018
14:23:29:450 : Reading data...
14:23:29:450 : r ap 0 @0x40022040 0x00000004 bytes Data 0x00000018
14:23:29:551 : r ap 0 @0x40022040 0x00000004 bytes Data 0x00000018
14:23:29:552 : Database: Config 1 is active.
14:23:29:552 : flash loader C:\Program Files\STMicroelectronics\STM32Cube\STM32CubeProgrammer\bin/FlashLoader/0x476.stldr is loaded
14:23:29:552 : r ap 0 @0x40022040 0x00000004 bytes Data 0x00000018
14:23:29:552 : fail @0xFEEEFEEE
14:23:29:553 : Debug in Low Power mode enabled.
14:23:29:553 : r ap 0 @0xE0044004 0x00000004 bytes Data 0x00000000
14:23:29:553 : w ap 0 @0xE0044004 0x00000004 bytes Data 0x00000006
14:23:29:553 : r ap 0 @0xE0044008 0x00000004 bytes Data 0x00000000
14:23:29:553 : w ap 0 @0xE0044008 0x00000004 bytes Data 0x00001800
14:23:29:554 : Reading data...
14:23:29:554 : r ap 0 @0x0BFA07A0 0x00000004 bytes Data 0x00000080
14:23:29:656 : r ap 0 @0x0BFA07A0 0x00000004 bytes Data 0x00000018
14:23:29:656 : failed to read the requested memory content
14:23:29:657 : r ap 0 @0x40022040 0x00000004 bytes Data 0x00000018
14:23:29:657 : fail @0xFEEEFEEE
14:23:29:657 : r ap 0 @0x0BF99EFE 0x00000001 bytes Data 0x00000000
14:23:29:657 : fail @0xFEEEFEEE
14:23:29:912 : r ap 0 @0x40022040 0x00000004 bytes Data 0x00000018
14:23:29:912 : fail @0xFEEEFEEE
14:23:29:912 : r ap 0 @0x0BF99EFE 0x00000001 bytes Data 0x00000000
14:23:29:912 : fail @0xFEEEFEEE
14:23:29:912 : Selected loader: C:\Program Files\STMicroelectronics\STM32Cube\STM32CubeProgrammer\bin/ExternalLoader/MX66UW1G45G_STM32H7S78-DK.stldr
14:23:29:912 : External loader C:\Program Files\STMicroelectronics\STM32Cube\STM32CubeProgrammer\bin/ExternalLoader/MX66UW1G45G_STM32H7S78-DK.stldr is unloaded
14:23:29:912 : Selected loader: C:\Program Files\STMicroelectronics\STM32Cube\STM32CubeProgrammer\bin/ExternalLoader/MX66UW1G45G_STM32H7S78-DK.stldr
14:23:29:912 : External loader C:\Program Files\STMicroelectronics\STM32Cube\STM32CubeProgrammer\bin/ExternalLoader/MX66UW1G45G_STM32H7S78-DK.stldr is loaded
14:23:29:919 : UPLOADING OPTION BYTES DATA ...
14:23:29:919 :   Bank          : 0x00
14:23:29:919 :   Address       : 0x40022040 
14:23:29:919 :   Size          : 48 Bytes
14:23:29:920 : Reading data...
14:23:29:920 : r ap 0 @0x40022040 0x00000030 bytes Data 0x00000018
14:23:29:920 : r ap 0 @0x40022040 0x00000030 bytes Data 0x00000011
14:23:29:921 : Error: Uploading Option Bytes bank: 0 failed
14:23:29:960 : Error: Initializing the Option Bytes failed
14:23:29:988 : r ap 0 @0x40022040 0x00000004 bytes Data 0x00000011
14:23:29:989 : fail @0xFEEEFEEE
14:23:29:989 : r ap 0 @0x0BF99EFE 0x00000001 bytes Data 0x00000000
14:23:29:990 : fail @0xFEEEFEEE
14:23:29:991 : Disconnected
14:23:29:992 : Disconnected from device.
14:23:29:992 : Selected loader: C:\Program Files\STMicroelectronics\STM32Cube\STM32CubeProgrammer\bin/ExternalLoader/MX66UW1G45G_STM32H7S78-DK.stldr
14:23:29:993 : External loader C:\Program Files\STMicroelectronics\STM32Cube\STM32CubeProgrammer\bin/ExternalLoader/MX66UW1G45G_STM32H7S78-DK.stldr is loaded

 

I tried to read the core status using STM32_Programmer_CLI.exe and the result is "Core is locked up".

I also tried below commands but none of that could help recovering the board.

STM32_Programmer_CLI.exe --connect port=swd mode=HOTPLUG -rdu
Error: Disabling memory Read Protection failed

STM32_Programmer_CLI.exe --connect port=swd mode=HOTPLUG -ob displ
圹圹圹圹圹圹圹圹圹圹圹圹圹圹圹圹圹圹圹圹圹圹圹圹圹 100%
Error: Uploading Option Bytes bank: 0 failed
Error: Initializing the Option Bytes failed

STM32_Programmer_CLI.exe --connect port=swd mode=HOTPLUG -ob unlockchip
圹圹圹圹圹圹圹圹圹圹圹圹圹圹圹圹圹圹圹圹圹圹圹圹圹 100%
Error: Uploading Option Bytes bank: 0 failed
Error: Initializing the Option Bytes failed

STM32_Programmer_CLI.exe --connect port=swd mode=HOTPLUG -e all
Error: Fail to read Flash Size
Error: Mass Erase : Config SAU Failed !
Error: failed to erase memory
Error: Mass erase operation failed.Please verify flash protection

 

Does ST team have any idea how to recover the board or the board is bricked forever?

2 REPLIES 2
Kouthair
ST Employee

Hello Wesleywong,

Could you please set the BOOT0 switch to Position 1 and try reconnecting using STM32CubeProgrammer?

Screenshot.png

Kouthair.

In order to give better visibility on the answered topics, please click on 'Accept as Solution' on the reply which solved your issue or answered your question.

Hi @Kouthair ,

I tried your suggestion and got the same result.

I tried both position 1 and 0.

If the mode is HOTPLUG, I got "Error: Uploading Option Bytes bank: 0 failed" and "Error: Initializing the Option Bytes failed".

If the mode is UR, power down or normal, I got error "DEV_TARGET_NOT_HALTED".

I tried keep pressing reset button and then click "connect" in cube programmer. also got error "DEV_TARGET_NOT_HALTED" after releasing the reset button.