Thanks for your reply, i have outlined the steps below :
in the main folder:
make clean all PARTICLE_DEVELOP=1 PLATFORM=photon USE_SWD_JTAG=y
make program-dfu PARTICLE_DEVELOP=1 PLATFORM=photon USE_SWD_JTAG=y
I cannot connect using openocd after DFU update and reset (seems like JTAG pins are disabled), so i put the photon i DFU mode, and im able to connect.
$ /usr/local/Cellar/open-ocd/0.9.0/bin/openocd -f ../misc/utils/spark.cfg -c "gdb_port 3333"
Open On-Chip Debugger 0.9.0 (2015-05-28-12:05)
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
Info : JTAG tap: stm32f2x.cpu tap/device found: 0x4ba00477 (mfg: 0x23b, part: 0xba00, ver: 0x4)
Info : JTAG tap: stm32f2x.bs tap/device found: 0x06411041 (mfg: 0x020, part: 0x6411, ver: 0x0)
Info : stm32f2x.cpu: hardware has 6 breakpoints, 4 watchpoints
Then
$ telnet localhost 4444
Trying ::1...
telnet: connect to address ::1: Connection refused
Trying 127.0.0.1...
Connected to localhost.
Escape character is '^]'.
Open On-Chip Debugger
> reset halt
JTAG tap: stm32f2x.cpu tap/device found: 0x4ba00477 (mfg: 0x23b, part: 0xba00, ver: 0x4)
JTAG tap: stm32f2x.bs tap/device found: 0x06411041 (mfg: 0x020, part: 0x6411, ver: 0x0)
target state: halted
target halted due to debug-request, current mode: Thread
xPSR: 0x01000000 pc: 0x08002d6c msp: 0x20020000
>
And
$ arm-none-eabi-gdb -ex "target remote localhost:3333" ../build/target/user-part/platform-6-m/user-part.elf
GNU gdb (GNU Tools for ARM Embedded Processors) 7.8.0.20150604-cvs
Copyright (C) 2014 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law. Type "show copying"
and "show warranty" for details.
This GDB was configured as "--host=x86_64-apple-darwin10 --target=arm-none-eabi".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
<http://www.gnu.org/software/gdb/documentation/>.
For help, type "help".
Type "apropos word" to search for commands related to "word"...
Reading symbols from ../build/target/user-part/platform-6-m/user-part.elf...done.
Remote debugging using localhost:3333
0x08002d6c in ?? ()
(gdb) break setup()
Breakpoint 1 at 0x80a02f0: file src/application.cpp, line 40.
(gdb) info break
Num Type Disp Enb Address What
1 breakpoint keep y 0x080a02f0 in setup() at src/application.cpp:40
(gdb)
After this
Continuing.
Note: automatically using hardware breakpoints for read-only addresses.
From here the Photon boots, the tinker program runs, and GDB becomes unresponsive, no (gdb) promt
After a while i get
Ckeep_alive() was not invoked in the 1000ms timelimit. GDB alive packet not sent! (60106). Workaround: increase "set remotetimeout" in GDB
If i restart/reset it all, and im am quick, while the Photon boots (breathing white), after being connected in DFU mode and a reset halt
i can:
(gdb) continue
Continuing.
^C
Program received signal SIGINT, Interrupt.
0x0806bec4 in ?? ()
(gdb) continue
Continuing.
^C
Program received signal SIGINT, Interrupt.
0x0806bea8 in ?? ()
(gdb)
I tracked this to be some EEprom/Flash routines, probably for reading / writing system or config variables, after boot completes (blue flashing from the RGB begins) GDB is not responding again
So to me it looks the
system-part1.elf
and system-part2.elf
are build with JTAG pins set correctly, and the user application, in this case tinker is not… But, well without knowing the details of the drivers, and the CPU, yet, i have not been able to spot anywhere the JTAG pins are overwritten ?
//morten