I opened up a new photon yesterday, claimed it, and flashed some code to it. This was known-good code with some added serial debugging. The code didn’t execute and the main LED stayed off. I flashed back to Tinker in DFU mode but the LED still didn’t turn on. The D7 LED was very dimly illuminated. I couldn’t see the device in Particle Console.
I saw in the docs that no status LED means a corrupted bootloader.
I got out my Particle Debugger and re-flashed the bootloader. This seemed to work:
C:\Users\JIKde\.particle\toolchains\openocd\0.11.2-adhoc6ea4372.0>bin\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 C:/Users/JIKde/Downloads/bootloader-1.0.1-photon.bin verify 0x08000000" -c "flash protect 0 0 0 on" -c "exit" Open On-Chip Debugger 0.10.0+dev-00920-g6ea43726 (2019-07-02-23:12) Licensed under GNU GPL v2 For bug reports, read http://openocd.org/doc/doxygen/bugs.html Info : auto-selecting first available session transport "swd". To override use 'transport select <transport>'. adapter speed: 1000 kHz Warn : Transport "swd" was already selected swd Info : CMSIS-DAP: SWD Supported Info : CMSIS-DAP: FW Version = 1.10 Info : CMSIS-DAP: Interface Initialised (SWD) Info : SWCLK/TCK = 1 SWDIO/TMS = 1 TDI = 0 TDO = 0 nTRST = 0 nRESET = 1 Info : CMSIS-DAP: Interface ready Info : clock speed 1000 kHz Info : SWD DPIDR 0x2ba01477 Info : stm32f2x.cpu: hardware has 6 breakpoints, 4 watchpoints Info : Listening on port 3333 for gdb connections target halted due to debug-request, current mode: Thread xPSR: 0x01000000 pc: 0x08003750 msp: 0x20020000 Info : device id = 0x200f6411 Info : flash size = 1024 kbytes cleared protection for sectors 0 through 0 on flash bank 0 target halted due to debug-request, current mode: Thread xPSR: 0x01000000 pc: 0x08003750 msp: 0x20020000 ** Programming Started ** ** Programming Finished ** ** Verify Started ** ** Verified OK ** set protection for sectors 0 through 0 on flash bank 0
Then I unplugged everything, plugged the Photon back into USB, put it in DFU mode, and re-flashed Tinker. This worked too:
particle flash --usb tinker Flash success!
However, the main LED still isn’t turning on. The D7 LED is no longer dark, but now the D7 LED and main LED flash once every five seconds before going dark again. The main LED seems to be trying to flash magenta, but it’s hard to tell. I put a scope on the 3V3 pin as suggested in some past forum posts, it’s a solid 3.3V.
Is there something else I need to flash? If so, where can I find instructions?