cancel
Showing results for 
Search instead for 
Did you mean: 

"locked out" from Nucleo-L4P5, cannot erase or program

b.a.
Associate III

I have a Nucleo-L4P5ZG board and I cannot use it.

Flash download in CubeIDE always fails because of an error erasing memory.

I then hooked it up to STM32CubeProgrammer, but the problem persists.

Independent whether I try to erase an individual sector or full memory area.

Same results with BOOT0 pin pulled high

verbose log output of full chip erase:

 15:52:32:963 : MASS ERASE ...

 15:52:32:964 : Flash erase...

 15:52:32:981 : halt ap 0

 15:52:32:981 : w ap 0 reg 15 PC  (0x20000000) 

 15:52:32:982 : w ap 0 reg 17 MSP (0x20000500) 

 15:52:32:983 : w ap 0 reg 16 xPSR (0x01000000) 

 15:52:32:983 : w ap 0 @0x20000A20 0x00000200 bytes Data 0x00000000

 15:52:32:983 : w ap 0 @0x20000000 0x00000004 bytes Data 0x0000BE00

 15:52:32:998 : w ap 0 @0x20000004 0x000005E4 bytes Data 0xB672B510

 15:52:32:998 : Init flashloader...

 15:52:32:999 : halt ap 0

 15:52:33:000 : w ap 0 reg 0 R0  0x00000001

 15:52:33:001 : w ap 0 reg 1 R1  0x00000000

 15:52:33:001 : w ap 0 reg 2 R2  0x00000000

 15:52:33:002 : w ap 0 reg 3 R3  0x00000000

 15:52:33:002 : w ap 0 reg 4 R4  0x00000000

 15:52:33:003 : w ap 0 reg 5 R5  0x00000000

 15:52:33:003 : w ap 0 reg 6 R6  0x00000000

 15:52:33:003 : w ap 0 reg 7 R7  0x00000000

 15:52:33:004 : w ap 0 reg 8 R8  0x00000000

 15:52:33:004 : w ap 0 reg 9 R9  0x00000000

 15:52:33:004 : w ap 0 reg 10 R10 0x00000000

 15:52:33:004 : w ap 0 reg 11 R11 0x00000000

 15:52:33:004 : w ap 0 reg 12 R12 0x00000000

 15:52:33:006 : w ap 0 reg 13 SP  0x00000000

 15:52:33:006 : w ap 0 reg 14 LR  0x20000001

 15:52:33:007 : w ap 0 reg 15 PC  0x20000005

 15:52:33:007 : w ap 0 reg 16 xPSR 0x01000000

 15:52:33:007 : w ap 0 reg 17 MSP 0x200009E4

 15:52:33:008 : w ap 0 reg 18 PSP 0x00000000

 15:52:33:008 : run ap 0

 15:52:33:010 : halt ap 0

 15:52:33:010 : r ap 0 reg 0 R0  0x00000001

 15:52:33:011 : Loader mass erase...

 15:52:33:015 : w ap 0 reg 0 R0  0x00000002

 15:52:33:016 : w ap 0 reg 1 R1  0x00000000

 15:52:33:017 : w ap 0 reg 2 R2  0x00000000

 15:52:33:018 : w ap 0 reg 3 R3  0x00000000

 15:52:33:020 : w ap 0 reg 4 R4  0x00000000

 15:52:33:021 : w ap 0 reg 5 R5  0x00000000

 15:52:33:021 : w ap 0 reg 6 R6  0x00000000

 15:52:33:022 : w ap 0 reg 7 R7  0x00000000

 15:52:33:027 : w ap 0 reg 8 R8  0x00000000

 15:52:33:029 : w ap 0 reg 9 R9  0x00000000

 15:52:33:030 : w ap 0 reg 10 R10 0x00000000

 15:52:33:030 : w ap 0 reg 11 R11 0x00000000

 15:52:33:031 : w ap 0 reg 12 R12 0x00000000

 15:52:33:032 : w ap 0 reg 13 SP  0x00000000

 15:52:33:033 : w ap 0 reg 14 LR  0x20000001

 15:52:33:034 : w ap 0 reg 15 PC  0x2000020D

 15:52:33:036 : w ap 0 reg 16 xPSR 0x01000000

 15:52:33:036 : w ap 0 reg 17 MSP 0x200009E4

 15:52:33:038 : w ap 0 reg 18 PSP 0x00000000

 15:52:33:038 : run ap 0

 15:52:33:043 : halt ap 0

 15:52:33:043 : r ap 0 reg 0 R0  0x00000000

 15:52:33:044 : Error: Mass erase operation failed.Please verify flash protection

2 REPLIES 2
Bubbles
ST Employee

Have you checked WRP settings in the option bytes? These can be set/reset in the STM32CubeProgrammer.

BR

J

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.

b.a.
Associate III

for whatever reason the user config option bytes where completely messed up.

Support gave me a screenshot on how they should look.

Board is accessible again :)