Tips for using particle debugger SWD with photon

I’m trying to use the latest particle debugger dongle to debug a photon app over SWD. I have the monolithic build based on 1.4.4 flashed and have followed this step-by-step tutorial but as soon as I continue after setting my first breakpoint, the connection to openocd falls over. I’m assuming this is because the photon’s system f/w is taking over pins D6 and D7; my app definitely doesn’t use these pins.

Is this supposed to work? I realize that the tutorial was written for the programming shield which uses JTAG to talk to the photon but I was hoping to make it work with SWD. @rickkas7, can you elaborate on your comment “you will likely have problems using SWD in normal operating mode (breathing cyan)” in your JTAG and SWD post??

Any tips greatly appreciated, and if this is a dead-end/unsupported path it would be helpful to know that too.

Thank you,

You cannot use pins D6 and D7 in user firmware when SWD debugging on Gen 2 devices (Photon, P1, Electron, and E Series) as those pins are used for the debugger.

You can’t use SWD for user firmware binaries that are not compiled for JTAG/SWD. For example, any cloud build. However if you use a " for debug" option in Particle Workbench the SWD build flag is set and you can debug your firmware in normal operating mode (but still can’t use D6 and D7).

@rickkas7 Thank you for the quick reply and nudge.

I am building the device-os tree from source, in the device-os/main dir:

make clean all PLATFORM=photon USE_SWD_JTAG=y MODULAR=n APPDIR=…

and for sure I’m not using D6, D7 in my app. After re-building with a clean device-os tree and re-flashing the monolithic build I am able to get gdb connected, stopping at breakpoints, etc. In my prior attempt I must have had library dependencies that were built without USE_SWD_JTAG=y MODULAR=n.

Thanks again.

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.