Compile and install OpenOCD with ./configure --enable-ftdi and make install
Copy 99-openocd.rules from the OpenOCD contrib folder to /etc/udev/rules.d/ so I don’t have to do sudo openocd
I don’t know what to do next. OpenOCD needs a script to connect to the target. Is it the particle-ftdi.cfg above? When I run openocd -f particle-ftdi.cfgit complains about clock speed. If I add a clock speed line, it complains about missing transport.
This thread has a lot of discussions about OpenOCD, but a lot of steps are implied.
I’ll update the programmer shield README.md for Linux if I can figure out the steps.
yeah - hadn’t even got to the particle firmware yet - it is useful to know the DFU mode has JTAG enabled, so if you can get a photon into DFU mode, you can openocd/jtag it from there.
Interesting - so with the particle-ftdi.cfg from the repo, you do not need to trigger the magic ftdi-sio behaviour to skip attaching the serial driver to the first port ?
Alright, with the steps above and taking your tip of telnet localhost 4444 from the other thead, I was able to see that the programmer shield is connected to the Photon. Inside the telnet session I did help to see which commands were available. Typing reset did reset the Photon, so I think the next step to read up on OpenOCD, gdb, etc.
One feature of openocd to exploit is the -c command line option to execute commands, that way you can have a makefile target/script to reset, program flash, etc
And you will need to point gdb at port 3333 (most likely on localhost, but you never know) with the target remote command (e.g. “target remote localhost:3333”)
I usually create a gdb target that will flash the correct image(s), then leave openocd running and ready to accept gdb commands.