Debugging Particle on Windows

Install the software

Install the drivers

Install the driver for the Debugger Shield
Install the driver for the Photon in reflash mode (DFU)

Compile the firmware

set PATH=C:\Windows\system32;C:\Windows;C:\Particle\Toolchain\MinGW\bin\;C:\Particle\Toolchain\MinGW\msys\1.0\bin;C:\Particle\Toolchain\GCC-ARM\bin;C:\Particle\Tools\DFU-util;C:\Particle\Toolchain\Make\bin;C:\Particle\Tools\Git\bin
cd /d C:\Particle\firmware\modules
bash
make clean all program-dfu PARTICLE_DEVELOP=1 PLATFORM=photon USE_SWD_JTAG=y
Compiling and reflashing through DFU completed (even though it shows error during download get_status at the end)

Start the debugger

openocd.exe -f particle-ftdi.cfg -f stm32f2x.cfg -c "gdb_port 3333"
The interface between GDB and the Programmer Shield
arm-none-eabi-gdb -ex "target remote localhost:3333" ../build/target/user-part/platform-6-m/user-part.elf
GDB ready to debug

Debug away!

--

--

CTO at MuniRent. Sharing my love of code

Love podcasts or audiobooks? Learn on the go with our new app.

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store