Debug&compile in eclipse

I followed the tutorial on the website and I got eclipse and my photon working with the tinkerbreak example. I have a programmer board as jtag.

At this point I have a couple of questions. Even if I click on clean project, eclipse only recompiles when I do a change in code (a space is ok). If not, I just get a Nothing to build… or something like that.

Apart from that, whenever I click on debug button, I get an error. I have to create a new debug configuration and click “debug” from the form window. In the tutorial it is said that this have to be done once… something I am missing?

Now I tried to run the same configuration on my project. Multiple files and a .ino file as Main. I solved this problem replacing ino by cpp. But I get an error when I click on debug button. Code seems to upload without problem (in dfu mode). Jtag error says:

GNU ARM Eclipse 64-bits Open On-Chip Debugger 0.10.0-00113-g0f83948 (2017-01-24-18:48) Licensed under GNU GPL v2 For bug reports, read http://openocd.org/doc/doxygen/bugs.html Info : auto-selecting first available session transport "jtag". To override use 'transport select <transport>'. adapter speed: 1000 kHz adapter_nsrst_delay: 100 jtag_ntrst_delay: 100 none separate cortex_m reset_config sysresetreq Started by GNU ARM Eclipse Info : clock speed 1000 kHz Error: JTAG scan chain interrogation failed: all ones Error: Check JTAG interface, timings, target power, etc. Error: Trying to use configured scan chain anyway... Error: stm32f2x.cpu: IR capture error; saw 0x0f not 0x01 Warn : Bypassing JTAG setup events due to errors Error: Invalid ACK (7) in DAP response Error: JTAG-DP STICKY ERROR Error: Invalid ACK (7) in DAP response Error: JTAG-DP STICKY ERROR Error: Invalid ACK (7) in DAP response Error: JTAG-DP STICKY ERROR Error: Invalid ACK (7) in DAP response Error: JTAG-DP STICKY ERROR Error: Invalid ACK (7) in DAP response Error: JTAG-DP STICKY ERROR Error: Invalid ACK (7) in DAP response Error: JTAG-DP STICKY ERROR Error: Invalid ACK (7) in DAP response Error: JTAG-DP STICKY ERROR Error: Invalid ACK (7) in DAP response Error: JTAG-DP STICKY ERROR Error: Invalid ACK (7) in DAP response Error: JTAG-DP STICKY ERROR Error: Invalid ACK (7) in DAP response Error: JTAG-DP STICKY ERROR Error: Invalid ACK (7) in DAP response Error: JTAG-DP STICKY ERROR Error: Invalid ACK (7) in DAP response Error: JTAG-DP STICKY ERROR Error: Invalid ACK (7) in DAP response Error: JTAG-DP STICKY ERROR Error: Invalid ACK (7) in DAP response Error: JTAG-DP STICKY ERROR Error: Invalid ACK (7) in DAP response Error: JTAG-DP STICKY ERROR Error: Invalid ACK (7) in DAP response Error: JTAG-DP STICKY ERROR Error: Invalid ACK (7) in DAP response Error: JTAG-DP STICKY ERROR Error: Invalid ACK (7) in DAP response Error: JTAG-DP STICKY ERROR Error: Invalid ACK (7) in DAP response Error: JTAG-DP STICKY ERROR Error: Invalid ACK (7) in DAP response Error: JTAG-DP STICKY ERROR Error: Invalid ACK (7) in DAP response Error: JTAG-DP STICKY ERROR Error: Invalid ACK (7) in DAP response Error: JTAG-DP STICKY ERROR Error: Invalid ACK (7) in DAP response Error: JTAG-DP STICKY ERROR Error: Invalid ACK (7) in DAP response Error: JTAG-DP STICKY ERROR Error: Invalid ACK (7) in DAP response Error: JTAG-DP STICKY ERROR Error: Invalid ACK (7) in DAP response Error: JTAG-DP STICKY ERROR Error: Invalid ACK (7) in DAP response Error: JTAG-DP STICKY ERROR Error: Invalid ACK (7) in DAP response Error: JTAG-DP STICKY ERROR Error: Invalid ACK (7) in DAP response Error: JTAG-DP STICKY ERROR Error: Invalid ACK (7) in DAP response Error: JTAG-DP STICKY ERROR Error: Invalid ACK (7) in DAP response Error: JTAG-DP STICKY ERROR Error: Could not initialize the debug port Info : accepting 'gdb' connection on tcp/3333 Error: Target not examined yet Error: auto_probe failed Error: Connect failed. Consider setting up a gdb-attach event for the target to prepare target for GDB connect, or use 'gdb_memory_map disable'. Error: attempted 'gdb' connection rejected

With tinkerbreak this doesn’t occur. Any idea where should I look? Do you need anyting else of my configuration? Is there anything I should add to my files to allow breaking in execution?

It’s normal to only build the code when you make a change, otherwise every time you launch the debugger it will rebuild your code. If you really want to do that, change this:

$(TARGETBIN) : $(source)
	cd "$(FIRMWARE)/main" && make all PLATFORM=$(PLATFORM) APPDIR="$(APPDIR)" $(MAKEOPTS)

to this in the Makefile in your project directory:

$(TARGETBIN) : 
	cd "$(FIRMWARE)/main" && make all PLATFORM=$(PLATFORM) APPDIR="$(APPDIR)" $(MAKEOPTS)

Make sure you launch the debugger from the Run - Debug History menu, not the Debugging icon in the toolbar. The toolbar icon doesn’t work and I’m not sure why.

Also check the other console panes, there might be an additional error in one of those.

I’m not trying to run from Eclipse, but I am getting the same error when trying to invoke OpenOCD from the command line using Mac OS Sierra 10.12.3. I’m using the programmer shield with an Electron. I’m not sure where to go from here. Any things to try would be appreciated.

Gig-iMac-455:scripts sedly$ openocd -f interface/ftdi/particle-ftdi.cfg -f target/stm32f2x.cfg -c "telnet_port 4444"
Open On-Chip Debugger 0.10.0
Licensed under GNU GPL v2
For bug reports, read
	http://openocd.org/doc/doxygen/bugs.html
Info : auto-selecting first available session transport "jtag". To override use 'transport select <transport>'.
adapter speed: 1000 kHz
adapter_nsrst_delay: 100
jtag_ntrst_delay: 100
none separate
cortex_m reset_config sysresetreq
Info : clock speed 1000 kHz
Error: JTAG scan chain interrogation failed: all ones
Error: Check JTAG interface, timings, target power, etc.
Error: Trying to use configured scan chain anyway...
Error: stm32f2x.cpu: IR capture error; saw 0x0f not 0x01
Warn : Bypassing JTAG setup events due to errors
Error: Invalid ACK (7) in DAP response
Error: JTAG-DP STICKY ERROR
Error: Invalid ACK (7) in DAP response

Is your Photon in DFU mode (blinking yellow)? You probably won’t be able to connect to it manually in telnet mode if it’s in normal operating mode.

You are correct! Thanks for the help.

I just tested again with my code and this is what I got from debug window error:

Error in launch sequence:
Error in final launch sequence
Failed to execute MI command:
-target-select remote localhost:3333
Error message from debugger back end:
Remote communication error.  Target disconnected.: No error.
Failed to execute MI command:
-target-select remote localhost:3333
Error message from debugger back end:
Remote communication error.  Target disconnected.: No error.
Remote communication error.  Target disconnected.: No error.

My Main file is called Main.cpp, I don’t know if I should use anothe rname or so…