Hello,
I have a custom board with a STM32L052C8, up until yesterday I was able to flash/erase it without any problem. Since this morning I get an error when flashing a new firmware:
Display All
I have tried to manually erase the flash using J-Link but I get another error:
Display All
Why does the erase fail? I have searched the forum for a definition of the error codes but could not find one.
I have a custom board with a STM32L052C8, up until yesterday I was able to flash/erase it without any problem. Since this morning I get an error when flashing a new firmware:
Source Code
- Found SWD-DP with ID 0x0BC11477
- Found SWD-DP with ID 0x0BC11477
- AP-IDR: 0x04770031, Type: AHB-AP
- Found Cortex-M0 r0p1, Little endian.
- FPUnit: 4 code (BP) slots and 0 literal slots
- CoreSight components:
- ROMTbl 0 @ F0000000
- ROMTbl 0 [0]: F00FF000, CID: B105100D, PID: 000BB4C0 ROM Table
- ROMTbl 1 @ E00FF000
- ROMTbl 1 [0]: FFF0F000, CID: B105E00D, PID: 000BB008 SCS
- ROMTbl 1 [1]: FFF02000, CID: B105E00D, PID: 000BB00A DWT
- ROMTbl 1 [2]: FFF03000, CID: B105E00D, PID: 000BB00B FPB
- Cortex-M0 identified.
- PC = 080009E4, CycleCnt = 00000000
- R0 = FFFFFFFF, R1 = FFFFFFFF, R2 = FFFFFFFF, R3 = FFFFFFFF
- R4 = FFFFFFFF, R5 = FFFFFFFF, R6 = FFFFFFFF, R7 = FFFFFFFF
- R8 = FFFFFFFF, R9 = FFFFFFFF, R10= FFFFFFFF, R11= FFFFFFFF
- R12= FFFFFFFF
- SP(R13)= 20002000, MSP= 20002000, PSP= FFFFFFFC, R14(LR) = FFFFFFFF
- XPSR = F1000000: APSR = NZCVq, EPSR = 01000000, IPSR = 000 (NoException)
- CFBP = 00000000, CONTROL = 00, FAULTMASK = 00, BASEPRI = 00, PRIMASK = 00
- Downloading file [stage/lpc_app.bin]...
- Comparing flash [100%] Done.
- Erasing flash [100%] Done.
- Verifying flash [100%] Done.
- J-Link: Flash download: Restarting flash programming due to program error (possibly skipped erasure of half-way erased sector).
- J-Link: Flash download: Skip optimizations disabled for second try.
- Error while programming flash: Programming failed.
- Reset delay: 0 ms
- Reset type NORMAL: Resets core & peripherals via SYSRESETREQ & VECTRESET bit.
I have tried to manually erase the flash using J-Link but I get another error:
Source Code
- Device "STM32L052C8" selected.
- Found SWD-DP with ID 0x0BC11477
- Found SWD-DP with ID 0x0BC11477
- AP-IDR: 0x04770031, Type: AHB-AP
- Found Cortex-M0 r0p1, Little endian.
- FPUnit: 4 code (BP) slots and 0 literal slots
- CoreSight components:
- ROMTbl 0 @ F0000000
- ROMTbl 0 [0]: F00FF000, CID: B105100D, PID: 000BB4C0 ROM Table
- ROMTbl 1 @ E00FF000
- ROMTbl 1 [0]: FFF0F000, CID: B105E00D, PID: 000BB008 SCS
- ROMTbl 1 [1]: FFF02000, CID: B105E00D, PID: 000BB00A DWT
- ROMTbl 1 [2]: FFF03000, CID: B105E00D, PID: 000BB00B FPB
- Cortex-M0 identified.
- J-Link>erase
- Erasing device (STM32L052C8)...
- Comparing flash [100%] Done.
- Erasing flash [045%]
- ****** Error: Failed to erase sectors 0 @ address 0x08000000 (erase error)
- 100%] Done.
- Verifying flash [100%] Done.
- J-Link: Flash download: Total time needed: 0.050s (Prepare: 0.043s, Compare: 0.000s, Erase: 0.001s, Program: 0.000s, Verify: 0.000s, Restore: 0.004s)
- ERROR: Erase returned with error code -5.
Why does the erase fail? I have searched the forum for a definition of the error codes but could not find one.