cancel
Showing results for 
Search instead for 
Did you mean: 

STM32WLE5 write locked not in read after passing RDP from Level 1 to Level 0

Lbour.1
Associate

Hello,

I use STM32WLE5 on a seed studio module LORA-E5 mini where boot0 is not accessible (completely crazy ...). The module comes with a read protection and they ask us to remove RDP (level 1 to level 0) to be able to flash it with a custom program.

I was able to pass RDP from 0xBB to 0xAA in hotplug mode, all was ok exept that I cannot now erase or flash anything. I can connect in normal mode at any speed, read option bytes but no flashing. Sometimes I can erase one page but it is random ?

V target is 3.16V

stlink v2 firmware : V3j37S7

Masse erase output :

 10:15:43:555 : MASS ERASE ...

 10:15:43:555 : Flash erase...

 10:15:43:558 : halt ap 0

 10:15:43:558 : w ap 0 reg 15 PC  (0x20000000) 

 10:15:43:559 : w ap 0 reg 17 MSP (0x20000500) 

 10:15:43:561 : w ap 0 reg 16 xPSR (0x01000000) 

 10:15:43:568 : w ap 0 @0x20001380 0x00000200 bytes Data 0x00000000

 10:15:43:568 : w ap 0 @0x20000000 0x00000004 bytes Data 0x0000BE00

 10:15:43:607 : w ap 0 @0x20000004 0x00000F54 bytes Data 0x0001B510

 10:15:43:607 : Init flashloader...

 10:15:43:609 : halt ap 0

 10:15:43:610 : w ap 0 reg 0 R0  0x00000001

 10:15:43:610 : w ap 0 reg 1 R1  0x00000000

 10:15:43:610 : Loader mass erase...

 10:15:43:610 : Error: Mass erase operation failed.Please verify flash protection

Page erase output :

10:16:50:708 : Flash sector erase ...

 10:16:50:710 : Flash erase...

 10:16:50:712 : halt ap 0

 10:16:50:712 : w ap 0 reg 15 PC  (0x20000000) 

 10:16:50:713 : w ap 0 reg 17 MSP (0x20000500) 

 10:16:50:714 : w ap 0 reg 16 xPSR (0x01000000) 

 10:16:50:724 : w ap 0 @0x20001380 0x00000200 bytes Data 0x00000000

 10:16:50:724 : w ap 0 @0x20000000 0x00000004 bytes Data 0x0000BE00

 10:16:50:763 : w ap 0 @0x20000004 0x00000F54 bytes Data 0x0001B510

 10:16:50:764 : Init flashloader...

 10:16:50:766 : halt ap 0

 10:16:50:767 : w ap 0 reg 0 R0  0x00000001

 10:16:50:768 : w ap 0 reg 1 R1  0x00000000

 10:16:50:769 : w ap 0 reg 2 R2  0x00000000

 10:16:50:769 : w ap 0 reg 3 R3  0x00000000

 10:16:50:770 : w ap 0 reg 4 R4  0x00000000

 10:16:50:772 : w ap 0 reg 5 R5  0x00000000

 10:16:50:773 : w ap 0 reg 6 R6  0x00000000

 10:16:50:774 : w ap 0 reg 7 R7  0x00000000

 10:16:50:774 : w ap 0 reg 8 R8  0x00000000

 10:16:50:774 : w ap 0 reg 9 R9  0x00000000

 10:16:50:774 : w ap 0 reg 10 R10 0x00000000

 10:16:50:775 : w ap 0 reg 11 R11 0x00000000

 10:16:50:776 : w ap 0 reg 12 R12 0x00000000

 10:16:50:776 : w ap 0 reg 13 SP  0x00000000

 10:16:50:777 : w ap 0 reg 14 LR  0x20000001

 10:16:50:778 : w ap 0 reg 15 PC  0x2000002F

 10:16:50:779 : w ap 0 reg 16 xPSR 0x01000000

 10:16:50:780 : w ap 0 reg 17 MSP 0x20001354

 10:16:50:780 : w ap 0 reg 18 PSP 0x00000000

 10:16:50:780 : run ap 0

 10:16:50:780 : halt ap 0

 10:16:50:781 : r ap 0 reg 0 R0  0x00000001

 10:16:50:781 : Loader sector erase...

 10:16:50:784 : w ap 0 reg 0 R0  0x08000000

 10:16:50:785 : w ap 0 reg 1 R1  0x08000000

 10:16:50:785 : w ap 0 reg 2 R2  0x00000002

 10:16:50:786 : w ap 0 reg 3 R3  0x00000000

 10:16:50:786 : w ap 0 reg 4 R4  0x00000000

 10:16:50:786 : Error: Sector erase operation has failed at least for one of the existing specified sectors.Please verify flash memory protection.

Thanks for your help.

Laurent

1 ACCEPTED SOLUTION

Accepted Solutions
Lbour.1
Associate

I solved the problem :

RDB was locked at 0xAA and still no erase or flash capability, you need to set again RDP to 0xBB , unplug the board (very important, if not it will not work and stay locked at 0xAA), reconnect to the stm32, you will see RDP with a strange value 0xFF, that is ok, and set back RDP to 0xAA, this time you will be able to change the value.

Today all is ok, I can erase and flash anything 🙂 very very very strange .....

View solution in original post

2 REPLIES 2
Lbour.1
Associate

I solved the problem :

RDB was locked at 0xAA and still no erase or flash capability, you need to set again RDP to 0xBB , unplug the board (very important, if not it will not work and stay locked at 0xAA), reconnect to the stm32, you will see RDP with a strange value 0xFF, that is ok, and set back RDP to 0xAA, this time you will be able to change the value.

Today all is ok, I can erase and flash anything 🙂 very very very strange .....

EP.2
Associate III

Thanks very much, I had the same issue, couldn't read or write the device even though RDP 0xAA. I couldn't even change any of the user bytes or Option bytes. So I set RDP to 0xBB, power cycled, it showed as 0xFF, then I set it back to 0xAA and then everything went back to normal. I had to reset all the user bytes back to default, but other than that it seems OK.