2022-12-01 03:44 AM
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
Solved! Go to Solution.
2022-12-02 09:35 AM
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.
2022-12-01 03:45 AM
This topic has been around the forum in the past so i assume there is many different ways to end up in this situation.
Which for me ends up showing
Error: Mass erase operation failed.Please verify flash protection
Error: Option Byte Programming failed
2022-12-01 07:45 AM
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
2022-12-01 08:07 AM
Lets try out this ST video
https://www.youtube.com/watch?v=f7vs0NwZPFo
Edit: that was not very helpful
2022-12-01 08:29 AM
Reading the PM0075 Reading/programming the embedded Flash memory APP note now
it says the unprotect value should be A5 but the cubePRogrammer is trying to write AA..... maybe thats the key to unlock the mcu?
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
2022-12-01 09:12 AM
Connecting via SWD
STM32_Programmer_CLI.exe -c port=SWD
2022-12-01 09:19 AM
Writting into the OB bytes
STM32_Programmer_CLI.exe -c port=SWD freq=4000 -e 0 -w32 0x40023C14 0x0FFFA5ED
NAh it didnt work....
2022-12-01 09:21 AM
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
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
2022-12-01 09:26 AM
Displaying OB , not what i want but it shows RDP still being 0xFF
STM32_Programmer_CLI.exe -c port=SWD freq=4000 -ob displ
2022-12-01 09:46 AM
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