Photon debugging with programmer shield on Workbench

I’m having difficulty with getting debugging working on the Photon with programmer shield. I am running on windows 10 and have followed the steps in this guide:

but I am having issues with launching openOCD.

Starting openOCD from terminal gives me these errors:

If I try debugging from Workbench, I get this error:


The device gets flashed properly but as soon as it tries debugging I get the failed to launch error.

These are my launch.json settings:

Any idea whats going on?

Have you seen this topic

If this doesn’t quite fit for the Particle Programmer Shield, I’m sure Brandon will be happy to extend his post for that particular need - just post your desire there.

I also had some difficulties getting OpenOCD to run but that was down to some poorly built OpenOCD binary for Windows.
Try this one

1 Like

I am trying to debug the Photon with a Programmer shield through Particle Workbench on Windows 10 but keep getting the following error:


Any idea why this is happening?

specifically to your case i don’t know. but generaly, ENOENT means not able to find and usually indicates a path problem

I have moved your other thread into this here since double posting for basically the same issue is not appreciated - it just scatters the conversation over multiple threads and ties up resources without extra benefit.

I added the path of the openocd executable to my settings.json file by adding a “cortex-debug.openocdPath” and the ENOENT error does not occur anymore. Now however, openocd seems to timeout and shows this error instead:

I have looked at that topic but it does not really help in this case. Also I have downloaded openOCD from that link but there was no difference. I tried earlier versions of it too but nothing changed. Is it possible that my programmer shield is simply broken?

i suggest checking to see if openocd.exe is in the windows system path. i think it should have been added at install time but check. maybe add it to your user variables path also.

I seem to have fixed the problem with the openOCD server timing out by plugging the programmer shield into a different usb port. Now the debugger will run in workbench but I am getting a hard fault before the program even gets to setup().

I tried debugging in an empty project too but got the same problem.

That’s probably during the instantiation of static objects where one object would expect another to be instantiated already but isn’t.

Without knowing your code it’s hard to say more than that.

The code works without any problems if I just flash and run it, its when I try debugging that I get this hard fault.

When I run gdb from cmd I get this error:

and gdb shows:

I found another thread where a user had the same issue but there was no solution to the problem: Firmware debugging breaks with SIGINT - Photon Programmer Shield