The problem is old but still relevant, so I thought I would write the way I solved the “blue death” on an Electron using “Particle debugger” in Windows10:
- Connect the “Particle debugger” to the dead Particle Electron.
SWDIO (Debugger) → D7 (Electron)
SWCLK → DG
GND → GND
see: setup - Connect the debugger with the USB port.
- Connect the Electron with the USB port. The debugger should show a blue LED and so should the Electron do.
- Download Particle Workbench. The workbench also downloads OPENOCD (version 0.11 in my case), to communicate with the Electron.
- Download bootloader and firmware from here
- Open a terminal and go to
C:\Users\<myname>\.particle\toolchains\openocd\0.11.2-adhoc6ea4372.0\bin
- unset the “Device security bit and program bootloader”
openocd -f interface/cmsis-dap.cfg -f target/stm32f2x.cfg -c "adapter_khz 1000" -c "transport select swd" -c "init" -c "reset halt" -c "stm32f2x unlock 0" -c "reset halt" -c "exit"
openocd -f interface/cmsis-dap.cfg -f target/stm32f2x.cfg -c "adapter_khz 1000" -c "transport select swd" -c "init" -c "reset halt" -c "flash protect 0 0 0 off" -c "program /Users/<myname>/Downloads/electron-bootloader_2.2.0_lto.bin verify 0x08000000" -c "flash protect 0 0 0 on" -c "exit"
- program system and user firmware:
openocd -f interface/cmsis-dap.cfg -f target/stm32f2x.cfg -c "adapter_khz 1000" -c "transport select swd" -c "init" -c "reset halt" -c "flash protect 0 5 8 off" -c "program /Users/<myname>/Downloads/electron-system-part1_2.2.0.bin verify 0x08060000" -c "program /Users/<myname>/Downloads/electron-system-part2_2.2.0.bin verify 0x08020000" -c "program /Users/<myname>/Downloads/electron-system-part3_2.2.0.bin verify 0x08040000" -c "flash protect 0 5 8 on" -c "exit"
particle flash --usb firmware.bin
- Erase (reset) configuration:
openocd -f interface/cmsis-dap.cfg -f target/stm32f2x.cfg -c "adapter_khz 1000" -c "transport select swd" -c "init" -c "reset halt" -c "flash erase_sector 0 1 2"
- Recover keys:
particle keys doctor <device ID>