cancel
Showing results for 
Search instead for 
Did you mean: 

Error: failed to erase memory

Hugo_VOLA
Associate II

I'm using LoRa E5 mini board that has STM32WLE5 MCU on it.

I use STM32CubeProgrammer and the STlink of a Nucleo64 board to send the firmware to it.

For some boards, I cannot succeed to flash them and get this error :

0693W00000Y8XmyQAF.pngWhen I try to use STM32CubeIDE I've got this error :

0693W00000Y8XncQAF.png 

I already checked that OB RDP is AA.

By following the article of ST (https://community.st.com/s/article/Custom-external-loader-failed-to-download-segment-0) I try to use the 2.6 version of STM32CubeProgrammer but without any success...

When I increase verbose level on STM32CubeProgrammer I've got those logs :

 14:25:34:818 : Memory Programming ...

 14:25:34:818 : Opening and parsing file: Seeed-LoRa-E5_VT7-71.bin

 14:25:34:818 :  File     : Seeed-LoRa-E5_VT7-71.bin

 14:25:34:818 :  Size     : 89324 Bytes

 14:25:34:818 :  Address    : 0x08000000 

 14:25:34:818 : Erasing Segment <0> Address <0x08000000> Size <89324>Bytes

 14:25:34:819 : Erasing memory corresponding to segment 0:

 14:25:34:825 : Memory erase...

 14:25:34:826 : halt ap 0 

 14:25:34:826 : w ap 0 reg 15 PC  (0x20000000)  

 14:25:34:826 : w ap 0 reg 17 MSP (0x20000500)  

 14:25:34:826 : w ap 0 reg 16 xPSR (0x01000000)  

 14:25:34:829 : w ap 0 @0x20001380 0x00000200 bytes Data 0x00000000

 14:25:34:829 : w ap 0 @0x20000000 0x00000004 bytes Data 0x0000BE00

 14:25:34:843 : w ap 0 @0x20000004 0x00000F54 bytes Data 0x0001B510

 14:25:34:843 : Erasing internal memory sectors [0 43]

 14:25:34:843 : Init flashloader...

 14:25:34:844 : halt ap 0 

 14:25:34:844 : w ap 0 reg 0 R0  0x00000001

 14:25:34:844 : w ap 0 reg 1 R1  0x00000000

 14:25:34:845 : w ap 0 reg 2 R2  0x00000000

 14:25:34:845 : w ap 0 reg 3 R3  0x00000000

 14:25:34:846 : w ap 0 reg 4 R4  0x00000000

 14:25:34:846 : w ap 0 reg 5 R5  0x00000000

 14:25:34:846 : w ap 0 reg 6 R6  0x00000000

 14:25:34:847 : w ap 0 reg 7 R7  0x00000000

 14:25:34:847 : w ap 0 reg 8 R8  0x00000000

 14:25:34:856 : w ap 0 reg 9 R9  0x00000000

 14:25:34:857 : w ap 0 reg 10 R10 0x00000000

 14:25:34:857 : w ap 0 reg 11 R11 0x00000000

 14:25:34:857 : w ap 0 reg 12 R12 0x00000000

 14:25:34:857 : w ap 0 reg 13 SP  0x00000000

 14:25:34:857 : w ap 0 reg 14 LR  0x20000001

 14:25:34:857 : w ap 0 reg 15 PC  0x2000002F

 14:25:34:857 : w ap 0 reg 16 xPSR 0x01000000

 14:25:34:857 : w ap 0 reg 17 MSP 0x20001354

 14:25:34:857 : w ap 0 reg 18 PSP 0x00000000

 14:25:34:857 : run ap 0 

 14:25:34:907 : halt ap 0 

 14:25:34:907 : r ap 0 reg 0 R0  0x00000001

 14:25:34:907 : Loader sector erase...

 14:25:34:907 : Error: failed to erase memory

 14:25:34:928 : Error: failed to erase memory

 14:25:34:929 : RUNNING Program ... 

 14:25:34:929 :  Address:   : 0x08000000

 14:25:34:929 : w ap 0 reg 15 PC  0x00000000

 14:25:34:930 : w ap 0 reg 17 MSP 0x00000000

 14:25:34:930 : w ap 0 reg 16 xPSR 0x01000000

 14:25:34:930 : Application is running

 14:25:34:930 : Start operation achieved successfully

 14:26:15:995 : Disconnected from device.

Do you have any idea about what's happening ?

Thanks

Hugo

3 REPLIES 3
Imen.D
ST Employee

Hello @Community member​ ,

Check you cables, maybe you are using a bad quality.

Make sure to use the correct external loader for the board.

Maybe trying access memory without appropriate External Loader selected.

Imen

When your question is answered, please close this topic by clicking "Accept as Solution".
Thanks
Imen
Hugo_VOLA
Associate II

Hello @Imen DAHMEN​ ,

Thanks for your answer.

I 've check cables external loader, and programmer configuration all seems good.

I've also contact Seeedstudio that build the board with the STM32WL in it.

It appear that there is some problems with those boards... They can be stucked...

Some of the boards can't be reach by the stlink (le power voltage drop to 1.2V)

Some of the boards can't be flashed correctly :

0693W00000YAASVQA5.png 

We've brought 100pc I really hope we will find a solution...

videojames
Associate III

You can try flashing the boards with Under Reset mode, I have had some luck with this with a similiar error message.

However it does sound like Seeed may be the more appropriate location for support.

Good luck.0693W00000YADsRQAX.png