cancel
Showing results for 
Search instead for 
Did you mean: 

OH boy... I bricked my nucleo Error: Expected value for Option Byte "RDP": 0xAA, found: 0xFF

Javier1
Principal

I was happily debugging some code in my NUCLEO-F207ZG, the whole morning the debug sessions (stm32cubeIDE) have been quite glitchy.

Until the mcu somehow got briked and i cannot revive it.

I suspect noise in the SW lines comming from some external LEDs nearby had something to do with this issue, or power fluctuations when programming.

I am unable to Read the FLash content so i connected the board to the stCUBEProgrammer.

12:42:36:814 : STLinkUSBDriver.dll loaded
  12:42:36:819 : STLinkUSBDriver.dll loaded
  12:42:36:819 : ST-LINK SN  : 066FFF323239524257191044
  12:42:36:820 : ST-LINK FW  : V2J39M27
  12:42:36:821 : Board       : NUCLEO-F207ZG
  12:42:36:821 : Voltage     : 3.24V
  12:42:36:836 : SWD freq    : 4000 KHz
  12:42:36:837 : Connect mode: Under Reset
  12:42:36:837 : Reset mode  : Hardware reset
  12:42:36:838 : Device ID   : 0x411
  12:42:36:850 : Revision ID : Rev 2.0
  12:42:36:871 : flash loader C:\Program Files\STMicroelectronics\STM32Cube\STM32CubeProgrammer\bin/FlashLoader/0x411.stldr is loaded
  12:42:36:871 : STLinkUSBDriver.dll loaded
  12:42:36:871 : ST-LINK SN  : 066FFF323239524257191044
  12:42:36:872 : ST-LINK FW  : V2J39M27
  12:42:36:872 : Board       : NUCLEO-F207ZG
  12:42:36:882 : Voltage     : 3.24V
  12:42:36:892 : SWD freq    : 4000 KHz
  12:42:36:892 : Connect mode: Under Reset
  12:42:36:892 : Reset mode  : Hardware reset
  12:42:36:906 : Device ID   : 0x411
  12:42:36:910 : Revision ID : Rev 2.0
  12:42:36:910 : Debug in Low Power mode is not supported for this device.
  12:42:36:910 : Reading data...
  12:42:36:910 : r ap 0 @0x1FFF7A22 0x00000004 bytes Data 0x0000201F
  12:42:36:910 : failed to read the requested memory content
  12:42:37:108 : UPLOADING OPTION BYTES DATA ...
  12:42:37:109 :   Bank          : 0x00
  12:42:37:109 :   Address       : 0x40023c14
  12:42:37:109 :   Size          : 12 Bytes
  12:42:37:109 : Reading data...
  12:42:37:109 : r ap 0 @0x40023C14 0x0000000C bytes Data 0x0FFFFFED
  12:42:37:110 : UPLOADING OPTION BYTES DATA ...
  12:42:37:110 :   Bank          : 0x00
  12:42:37:110 :   Address       : 0x40023c14
  12:42:37:110 :   Size          : 12 Bytes
  12:42:37:110 : Reading data...
  12:42:37:110 : r ap 0 @0x40023C14 0x0000000C bytes Data 0x0FFFFFED
  12:42:37:111 : UPLOADING ...
  12:42:37:111 :   Size          : 1024 Bytes
  12:42:37:111 :   Address       : 0x8000000
  12:42:37:111 : Read progress:
  12:42:37:111 : Reading data...
  12:42:37:111 : r ap 0 @0x08000000 0x00000400 bytes Data 0x201F6411
  12:42:37:111 : Error: Data read failed

What ****** me off is the OB->RDP suddenly shows as FF (read protection), im unable to change it back to AA (no read protection).

12:42:58:775 : UPLOADING OPTION BYTES DATA ...
  12:42:58:775 :   Bank          : 0x00
  12:42:58:775 :   Address       : 0x40023c14
  12:42:58:775 :   Size          : 12 Bytes
  12:42:58:776 : Reading data...
  12:42:58:776 : r ap 0 @0x40023C14 0x0000000C bytes Data 0x0FFFFFED
  12:43:02:844 : Option byte command : -ob  RDP=170 
  12:43:02:847 : PROGRAMMING OPTION BYTES AREA ...
  12:43:02:848 :   Bank          : 0x00
  12:43:02:849 :   Address       : 0x40023c14
  12:43:02:849 :   Size          : 12 Bytes
  12:43:02:849 : OB buffer: edaaff0fc000001300000000
  12:43:02:849 : Buffer program...
  12:43:02:854 : halt ap 0 
  12:43:02:854 : w ap 0 reg 15 PC   (0x20000000)  
  12:43:02:855 : w ap 0 reg 17 MSP  (0x20000500)  
  12:43:02:856 : w ap 0 reg 16 xPSR (0x01000000)  
  12:43:02:858 : w ap 0 @0x20000D80 0x00000200 bytes Data 0x00000000
  12:43:02:858 : w ap 0 @0x20000000 0x00000004 bytes Data 0x0000BE00
  12:43:02:877 : w ap 0 @0x20000004 0x00000940 bytes Data 0xF000B580
  12:43:02:877 : w ap 0 @0x20000D80 0x0000000C bytes Data 0x0FFFAAED
  12:43:02:877 : Loader write option bytes...
  12:43:02:877 : Init flashloader...
  12:43:02:877 : halt ap 0 
  12:43:02:878 : w ap 0 reg 0 R0   0x00000001
  12:43:02:878 : w ap 0 reg 1 R1   0x00000000
  12:43:02:878 : w ap 0 reg 2 R2   0x00000000
  12:43:02:878 : w ap 0 reg 3 R3   0x00000000
  12:43:02:878 : w ap 0 reg 4 R4   0x00000000
  12:43:02:878 : w ap 0 reg 5 R5   0x00000000
  12:43:02:880 : w ap 0 reg 6 R6   0x00000000
  12:43:02:881 : w ap 0 reg 7 R7   0x00000000
  12:43:02:883 : w ap 0 reg 8 R8   0x00000000
  12:43:02:884 : w ap 0 reg 9 R9   0x00000000
  12:43:02:884 : w ap 0 reg 10 R10  0x00000000
  12:43:02:885 : w ap 0 reg 11 R11  0x00000000
  12:43:02:885 : w ap 0 reg 12 R12  0x00000000
  12:43:02:888 : w ap 0 reg 13 SP   0x00000000
  12:43:02:888 : w ap 0 reg 14 LR   0x20000001
  12:43:02:889 : w ap 0 reg 15 PC   0x20000005
  12:43:02:889 : w ap 0 reg 16 xPSR 0x01000000
  12:43:02:890 : w ap 0 reg 17 MSP  0x20000D40
  12:43:02:890 : w ap 0 reg 18 PSP  0x00000000
  12:43:02:891 : run ap 0 
  12:43:02:894 : halt ap 0 
  12:43:02:895 : r ap 0 reg 0 R0   0x00000001
  12:43:02:896 : w ap 0 reg 0 R0   0x40023C14
  12:43:02:897 : w ap 0 reg 1 R1   0x0000000C
  12:43:02:900 : w ap 0 reg 2 R2   0x20000D80
  12:43:02:900 : w ap 0 reg 3 R3   0x00000002
  12:43:02:901 : w ap 0 reg 4 R4   0x00000000
  12:43:02:902 : w ap 0 reg 5 R5   0x00000000
  12:43:02:904 : w ap 0 reg 6 R6   0x00000000
  12:43:02:906 : w ap 0 reg 7 R7   0x00000000
  12:43:02:907 : w ap 0 reg 8 R8   0x00000000
  12:43:02:912 : w ap 0 reg 9 R9   0x00000000
  12:43:02:913 : w ap 0 reg 10 R10  0x00000000
  12:43:02:914 : w ap 0 reg 11 R11  0x00000000
  12:43:02:914 : w ap 0 reg 12 R12  0x00000000
  12:43:02:914 : w ap 0 reg 13 SP   0x00000000
  12:43:02:915 : w ap 0 reg 14 LR   0x20000001
  12:43:02:916 : w ap 0 reg 15 PC   0x200000DF
  12:43:02:917 : w ap 0 reg 16 xPSR 0x01000000
  12:43:02:917 : w ap 0 reg 17 MSP  0x20000D40
  12:43:02:918 : w ap 0 reg 18 PSP  0x00000000
  12:43:02:918 : run ap 0 
  12:43:06:294 : UPLOADING OPTION BYTES DATA ...
  12:43:06:295 :   Bank          : 0x00
  12:43:06:295 :   Address       : 0x40023c14
  12:43:06:295 :   Size          : 12 Bytes
  12:43:06:295 : Reading data...
  12:43:06:297 : r ap 0 @0x40023C14 0x0000000C bytes Data 0x0FFFFFED
  12:43:06:297 : OPTION BYTE PROGRAMMING VERIFICATION:
  12:43:06:297 : Error: Expected value for Option Byte "RDP": 0xAA, found: 0xFF
  12:43:06:317 : Error: Option Byte Programming failed
  12:43:06:348 : Time elapsed during option Bytes configuration: 00:00:03.449
  12:43:06:412 : UPLOADING OPTION BYTES DATA ...
  12:43:06:412 :   Bank          : 0x00
  12:43:06:412 :   Address       : 0x40023c14
  12:43:06:412 :   Size          : 12 Bytes
  12:43:06:413 : Reading data...
  12:43:06:413 : r ap 0 @0x40023C14 0x0000000C bytes Data 0x0FFFFFED

Maybe i killed the flash somehow?

I tested with different nucleo boards and everything seems alright with CUBEProgrammer and CUBEide

we dont need to firmware by ourselves, lets talk
1 ACCEPTED SOLUTION

Accepted Solutions

If you use debug functionality, I think Cube Programmer has this, you should be able to see it with the PC in the 0x1FFF0000 type address range.

>>I am going to explore this, it could be caused by a broken mcu?

I suppose, but several aspects seem to be otherwise functional. You might want to submit this as an Online Support Request thing, see if the FAE have any insight or info off the large issue FAQ they consult.

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..

View solution in original post

16 REPLIES 16
Javier1
Principal

This topic has been around the forum in the past so i assume there is many different ways to end up in this situation.

  •  here, @Piranha​ suggests to update the stlink firmware and perform a mass erase operation.

Which for me ends up showing

Error: Mass erase operation failed.Please verify flash protection
  • here, @VVakh.1​ tries to set the OB->RCP bytes to AA, with the same luck i have.
Error: Option Byte Programming failed

  •  
we dont need to firmware by ourselves, lets talk
Javier1
Principal

I bricked another nucleo-f207zg board.

this time i can read but i cannot write flash

16:43:03:005 : Error: Uploading Option Bytes bank: 0 failed
  16:43:03:034 : Error: Reloading Option Bytes Data failed

OB->RDP=0xFF as before and i cannot change it

edit: when i unplugged and plugged it again now it fails the exact same way as the previous nucleo.

Now i have two identicaly bricked nucleo boards.

16:49:38:271 : Error: Expected value for Option Byte "RDP": 0xAA, found: 0xFF
  16:49:38:300 : Error: Option Byte Programming failed

we dont need to firmware by ourselves, lets talk
Javier1
Principal

Lets try out this ST video

https://www.youtube.com/watch?v=f7vs0NwZPFo

Edit: that was not very helpful

we dont need to firmware by ourselves, lets talk
Javier1
Principal

Reading the PM0075 Reading/programming the embedded Flash memory APP note now

https://www.st.com/resource/en/programming_manual/pm0075-stm32f10xxx-flash-memory-microcontrollers-stmicroelectronics.pdf

0693W00000WK0YzQAL.png 

it says the unprotect value should be A5 but the cubePRogrammer is trying to write AA..... maybe thats the key to unlock the mcu?

0693W00000WK0aCQAT.png 

im going o try to set the OB-RDP bytes with STM32_Programmer_CLI.exe

https://wiki.st.com/stm32mpu/wiki/STM32CubeProgrammer#

for me is located (default windows instalation) under

cd \Program Files\STMicroelectronics\STM32Cube\STM32CubeProgrammer\bin

comprehensive tutorial https://blog.katastros.com/a?ID=01800-259412d1-e075-427a-b4d9-912db0f0f5c6

we dont need to firmware by ourselves, lets talk

Connecting via SWD

STM32_Programmer_CLI.exe -c port=SWD

 0693W00000WK0oiQAD.png

we dont need to firmware by ourselves, lets talk

Writting into the OB bytes

STM32_Programmer_CLI.exe -c port=SWD freq=4000 -e 0 -w32 0x40023C14 0x0FFFA5ED

0693W00000WK0szQAD.png 

NAh it didnt work....

we dont need to firmware by ourselves, lets talk

Disabling memory read protection didnt work either.

STM32_Programmer_CLI.exe -c port=SWD freq=4000 -rdu
 
or
 
STM32_Programmer_CLI.exe -c port=SWD freq=4000 --readunprotect

0693W00000WK0lHQAT.png 

same thing happened to @GYacc​ https://community.st.com/s/question/0D53W00000JMwCbSAL/disabling-memory-read-protection-failed

Lets try to writting manually each register as he did

STM32_Programmer_CLI.exe -c port=SWD freq=4000 -e 0 -w32 0x40023C14 0x0FFFA5ED
 
 
OR
 
    STM32_Programmer_CLI.exe -c port=SWD freq=4000 -e 0 -w32 0x40023C14 0x0FFFAAED

 none of them worrked

we dont need to firmware by ourselves, lets talk

Displaying OB , not what i want but it shows RDP still being 0xFF

STM32_Programmer_CLI.exe -c port=SWD freq=4000 -ob displ

0693W00000WK0uWQAT.png

we dont need to firmware by ourselves, lets talk
Javier1
Principal

This guy had the same problem as i am having right now

https://www.eevblog.com/forum/microcontrollers/stm32-dead-flash/

Describes perfectly what happened to me 4 hours ago, no solution was shared

we dont need to firmware by ourselves, lets talk