2021-09-06 03:20 AM
I have a problem with a couple of BLUENRG-M2SP modules. I tried flashing the firmware under linux (We have to flash 100+ devices and each device needs a different firmware so plug and play flashing is not sufficient enough, so I copied ST's config from the flasher utility) and the operation failed with the following error message: 'Error: Erase command failed (timeout)'. So I tried flashing with ST's BlueNRG-X Flasher Utility 4.1.0 But I got the same error.
Here are some logs:
******FLASH OPERATION******
Flash of n.1 device connected by SWD (ST-Link/V2, CMSIS-DAP, J-Link)
18:32:11.640: Device connection by ST-Link/V2 -> Device connected
18:32:12.335: Device Identification -> BlueNRG-2
18:32:13.023: Device Flash Programming -> FAILED
18:32:14.298: Device Disconnection -> SUCCESS
18:32:15.016: Flash operation finished!
******END FLASH OPERATION******
debug_level: 2
4000
4445
C:/flasherUtilityTemp/BLE_Beacon_truestudi.bin
0
0028002E3156501320323443
0x10040000
Info : The selected transport took over low-level target control. The results might differ compared to plain JTAG/SWD
Info : clock speed 4000 kHz
Info : STLINK V3J7M2B4S1 (API v3) VID:PID 0483:374F
Info : Target voltage: 3.288592
Info : bluenrg-1.cpu: hardware has 4 breakpoints, 2 watchpoints
Info : Listening on port 4445 for gdb connections
target halted due to debug-request, current mode: Thread
xPSR: 0xc1000000 pc: 0x100006f8 msp: 0x20006000
target halted due to debug-request, current mode: Thread
xPSR: 0xc1000000 pc: 0x100006f8 msp: 0x20006000
Info : Padding image section 0 at 0x100513a4 with 12 bytes (bank write end alignment)
Warn : Adding extra erase range, 0x100513b0 .. 0x100517ff
Error: Erase command failed (timeout)
Error: Erase command failed (timeout)
Error: Erase command failed (timeout)
Error: Erase command failed (timeout)
Error: Erase command failed (timeout)
Error: Erase command failed (timeout)
Error: Erase command failed (timeout)
Error: Erase command failed (timeout)
Error: Erase command failed (timeout)
Error: Erase command failed (timeout)
Error: Erase command failed (timeout)
Error: Erase command failed (timeout)
Error: Erase command failed (timeout)
Error: Erase command failed (timeout)
Error: Erase command failed (timeout)
Error: Erase command failed (timeout)
Error: Erase command failed (timeout)
Error: failed erasing sectors 0 to 34
auto erase enabled
Warn : Flash driver of bluenrg-1.flash does not support free_driver_priv()
When I try to read the content of the flash than it's all 0xff (I guess the erase did this).
Is it possible to unbrick these devices?
Solved! Go to Solution.
2021-09-07 10:31 AM
I still don't know what caused the decrease in erase speed, but I managed to solve it by recompiling openocd with increased timeout value and it worked like a charm!
2021-09-07 10:31 AM
I still don't know what caused the decrease in erase speed, but I managed to solve it by recompiling openocd with increased timeout value and it worked like a charm!