I just got up and running with the programmer shield for photon :
- openocd installed and running
- confirmed can send commands through telnet
- able to send commands through gdb.
However, I’m seeing quite a few issues.
break points don’t seem to actually work :: I can see the code running on serial (i connected to the photon directly with an additional usb), but when it reaches the breakpoint in the code, nothing happens in gdb.
code freezes often :: Again, looking through serial, the code just seems to stop; nothing being printed, not actually progressing forward.
Is there some kind of general get started guide on doing this? I don’t know if it’s me breaking things or if this thing is just broken. Any help appreciated!!
EDIT: is it impossible to ‘serial’ into the device and have gdb going at the same time?
EDIT: is it possible that the jtagging/debug process can permanently break a photon? I’m now seeing the same freeze behavior in serial output even after plugging the chip in directly and not running opencd…
I haven’t actually tried this myself with the photon but do you have the pins configured for jtag?
Once you telnet to openocd, can you issue a reset to the micro, read memory, etc?
You need that all working before you can get gdb working.
Yes, all those things are working
Which ELF file are you feeding to GDB? Maybe the memory locations don’t match between the actual firmware and the ELF file you are using so the breakpoint is in a random location, explaining the code freezes.
My suggestion is to build a non-modular firmware from the main folder:
firmware/main $ make clean all program-dfu PLATFORM=photon MODULAR=n USE_SWD_JTAG=y
To make breakpoints work, GDB needs a chance to set them once. So if you add a breakpoint while the code is running, it won’t take effect right away. Do Ctrl-C then
continue for the breakpoint to stick. Or do
monitor reset halt, set all your breakpoints, then
Also make sure you are not using D3, D4, D5, D6, D7 in your firmware as those are used by the JTAG interface.
You can connect both the Photon USB and the programmer shield USB to be able to do serial and JTAG at the same time if you have enough USB ports on your computer.