SparkFun Forums 

Where electronics enthusiasts find answers.

Open source ARM Debugger
By gauna
#197282
Hello,

I'm using openSuse 42.3, openocd 0.10.0 and eclipse to program and debug an Atmel ATSAM3X8E with an Atmel-ICE in CMSIS-DAP-mode (idVendor=03eb, idProduct=2141)

I can start debuggin but it doesn't work. OpenOCD is doing something but program execution is obiously not started. Then I start VirtualBox with Win10 and AVRStudio running a debug-session and everything works fine. Afterwards I can close VirtualBox and go back to linux and eclipse and now it works, too, as along as I don't restart my machine. AVRStudio seems to setup my debugging interface in an other way, but I don't know what. How can I fix this problem?



My config-file is
Code: Select all
source [find interface/cmsis-dap.cfg]

transport select jtag

set CHIPNAME at91sam3ax8e

source [find target/at91sam3ax_8x.cfg]

$_TARGETNAME configure -event gdb-attach {
   halt
 }
 $_TARGETNAME configure -event gdb-attach {
   reset init
 }

 gdb_memory_map enable
 gdb_flash_program enable
and the response in eclipse before using AVRStudio is
Code: Select all
Open On-Chip Debugger 0.10.0
Licensed under GNU GPL v2
For bug reports, read
	http://openocd.org/doc/doxygen/bugs.html
adapter speed: 500 kHz
adapter_nsrst_delay: 100
jtag_ntrst_delay: 100
cortex_m reset_config sysresetreq
Started by GNU MCU Eclipse
Info : CMSIS-DAP: SWD  Supported
Info : CMSIS-DAP: JTAG Supported
Info : CMSIS-DAP: Interface Initialised (JTAG)
Info : CMSIS-DAP: FW Version = 01.21.0076
Info : SWCLK/TCK = 1 SWDIO/TMS = 1 TDI = 1 TDO = 1 nTRST = 0 nRESET = 1
Info : CMSIS-DAP: Interface ready
Info : clock speed 500 kHz
Info : cmsis-dap JTAG TLR_RESET
Info : cmsis-dap JTAG TLR_RESET
Info : JTAG tap: at91sam3ax8e.cpu tap/device found: 0x4ba00477 (mfg: 0x23b (ARM Ltd.), part: 0xba00, ver: 0x4)
Info : at91sam3ax8e.cpu: hardware has 6 breakpoints, 4 watchpoints
Info : accepting 'gdb' connection on tcp/3333
Info : cmsis-dap JTAG TLR_RESET
Info : cmsis-dap JTAG TLR_RESET
Info : cmsis-dap JTAG TLR_RESET
Info : JTAG tap: at91sam3ax8e.cpu tap/device found: 0x4ba00477 (mfg: 0x23b (ARM Ltd.), part: 0xba00, ver: 0x4)
target halted due to debug-request, current mode: Thread 
xPSR: 0x01000000 pc: 0x0010004c msp: 0x20001000
Info : cmsis-dap JTAG TLR_RESET
Info : cmsis-dap JTAG TLR_RESET
Info : cmsis-dap JTAG TLR_RESET
Info : JTAG tap: at91sam3ax8e.cpu tap/device found: 0x4ba00477 (mfg: 0x23b (ARM Ltd.), part: 0xba00, ver: 0x4)
target halted due to debug-request, current mode: Thread 
xPSR: 0x01000000 pc: 0x0010004c msp: 0x20001000
semihosting is enabled
Info : sam3 auto-erases while programming (request ignored)
Warn : keep_alive() was not invoked in the 1000ms timelimit. GDB alive packet not sent! (4671). Workaround: increase "set remotetimeout" in GDB
Info : cmsis-dap JTAG TLR_RESET
Info : cmsis-dap JTAG TLR_RESET
Info : cmsis-dap JTAG TLR_RESET
Info : JTAG tap: at91sam3ax8e.cpu tap/device found: 0x4ba00477 (mfg: 0x23b (ARM Ltd.), part: 0xba00, ver: 0x4)
target halted due to debug-request, current mode: Thread 
xPSR: 0x01000000 pc: 0x0010004c msp: 0x20001000, semihosting
Info : cmsis-dap JTAG TLR_RESET
Info : cmsis-dap JTAG TLR_RESET
Info : cmsis-dap JTAG TLR_RESET
Info : JTAG tap: at91sam3ax8e.cpu tap/device found: 0x4ba00477 (mfg: 0x23b (ARM Ltd.), part: 0xba00, ver: 0x4)
target halted due to debug-request, current mode: Thread 
xPSR: 0x01000000 pc: 0x0010004c msp: 0x20001000, semihosting
===== arm v7m registers
(0) r0 (/32): 0x000000FF
(1) r1 (/32): 0x20000790
(2) r2 (/32): 0x200008E5
(3) r3 (/32): 0x00000000
(4) r4 (/32): 0x2000096C
(5) r5 (/32): 0x200008E5
(6) r6 (/32): 0x00000002
(7) r7 (/32): 0x200008E7
(8) r8 (/32): 0x2000096C
(9) r9 (/32): 0x05040001
(10) r10 (/32): 0x71200440
(11) r11 (/32): 0x0021411A
(12) r12 (/32): 0x00000000
(13) sp (/32): 0x20001000
(14) lr (/32): 0xFFFFFFFF
(15) pc (/32): 0x0010004C
(16) xPSR (/32): 0x01000000
(17) msp (/32): 0x20001000
(18) psp (/32): 0x49210920
(19) primask (/1): 0x00
(20) basepri (/8): 0x00
(21) faultmask (/1): 0x00
(22) control (/2): 0x00
===== Cortex-M DWT registers
(23) dwt_ctrl (/32)
(24) dwt_cyccnt (/32)
(25) dwt_0_comp (/32)
(26) dwt_0_mask (/4)
(27) dwt_0_function (/32)
(28) dwt_1_comp (/32)
(29) dwt_1_mask (/4)
(30) dwt_1_function (/32)
(31) dwt_2_comp (/32)
(32) dwt_2_mask (/4)
(33) dwt_2_function (/32)
(34) dwt_3_comp (/32)
(35) dwt_3_mask (/4)
(36) dwt_3_function (/32)
Info : DAP transaction stalled (WAIT) - slowing down

and after running AVRStudio
Code: Select all
Open On-Chip Debugger 0.10.0
Licensed under GNU GPL v2
For bug reports, read
	http://openocd.org/doc/doxygen/bugs.html
adapter speed: 500 kHz
adapter_nsrst_delay: 100
jtag_ntrst_delay: 100
cortex_m reset_config sysresetreq
Started by GNU MCU Eclipse
Info : CMSIS-DAP: SWD  Supported
Info : CMSIS-DAP: JTAG Supported
Info : CMSIS-DAP: Interface Initialised (JTAG)
Info : CMSIS-DAP: FW Version = 01.21.0076
Info : SWCLK/TCK = 1 SWDIO/TMS = 1 TDI = 1 TDO = 1 nTRST = 0 nRESET = 1
Info : CMSIS-DAP: Interface ready
Info : clock speed 500 kHz
Info : cmsis-dap JTAG TLR_RESET
Info : cmsis-dap JTAG TLR_RESET
Info : JTAG tap: at91sam3ax8e.cpu tap/device found: 0x4ba00477 (mfg: 0x23b (ARM Ltd.), part: 0xba00, ver: 0x4)
Info : at91sam3ax8e.cpu: hardware has 6 breakpoints, 4 watchpoints
Info : accepting 'gdb' connection on tcp/3333
Info : cmsis-dap JTAG TLR_RESET
Info : cmsis-dap JTAG TLR_RESET
Info : cmsis-dap JTAG TLR_RESET
Info : JTAG tap: at91sam3ax8e.cpu tap/device found: 0x4ba00477 (mfg: 0x23b (ARM Ltd.), part: 0xba00, ver: 0x4)
target halted due to debug-request, current mode: Thread 
xPSR: 0x01000000 pc: 0x00080154 msp: 0x20000850
Info : cmsis-dap JTAG TLR_RESET
Info : cmsis-dap JTAG TLR_RESET
Info : cmsis-dap JTAG TLR_RESET
Info : JTAG tap: at91sam3ax8e.cpu tap/device found: 0x4ba00477 (mfg: 0x23b (ARM Ltd.), part: 0xba00, ver: 0x4)
target halted due to debug-request, current mode: Thread 
xPSR: 0x01000000 pc: 0x00080154 msp: 0x20000850
semihosting is enabled
Info : sam3 auto-erases while programming (request ignored)
Warn : keep_alive() was not invoked in the 1000ms timelimit. GDB alive packet not sent! (4663). Workaround: increase "set remotetimeout" in GDB
Info : cmsis-dap JTAG TLR_RESET
Info : cmsis-dap JTAG TLR_RESET
Info : cmsis-dap JTAG TLR_RESET
Info : JTAG tap: at91sam3ax8e.cpu tap/device found: 0x4ba00477 (mfg: 0x23b (ARM Ltd.), part: 0xba00, ver: 0x4)
target halted due to debug-request, current mode: Thread 
xPSR: 0x01000000 pc: 0x00080164 msp: 0x20000f10, semihosting
Info : cmsis-dap JTAG TLR_RESET
Info : cmsis-dap JTAG TLR_RESET
Info : cmsis-dap JTAG TLR_RESET
Info : JTAG tap: at91sam3ax8e.cpu tap/device found: 0x4ba00477 (mfg: 0x23b (ARM Ltd.), part: 0xba00, ver: 0x4)
target halted due to debug-request, current mode: Thread 
xPSR: 0x01000000 pc: 0x00080164 msp: 0x20000f10, semihosting
===== arm v7m registers
(0) r0 (/32): 0x00080420
(1) r1 (/32): 0x00000000
(2) r2 (/32): 0x400E0E00
(3) r3 (/32): 0x0000FFFF
(4) r4 (/32): 0x00000000
(5) r5 (/32): 0x80000000
(6) r6 (/32): 0x20000704
(7) r7 (/32): 0x00100000
(8) r8 (/32): 0x00000100
(9) r9 (/32): 0x05040001
(10) r10 (/32): 0x20000004
(11) r11 (/32): 0x00000001
(12) r12 (/32): 0x20000800
(13) sp (/32): 0x20000F10
(14) lr (/32): 0xFFFFFFFF
(15) pc (/32): 0x00080164
(16) xPSR (/32): 0x01000000
(17) msp (/32): 0x20000F10
(18) psp (/32): 0x49210920
(19) primask (/1): 0x00
(20) basepri (/8): 0x00
(21) faultmask (/1): 0x00
(22) control (/2): 0x00
===== Cortex-M DWT registers
(23) dwt_ctrl (/32)
(24) dwt_cyccnt (/32)
(25) dwt_0_comp (/32)
(26) dwt_0_mask (/4)
(27) dwt_0_function (/32)
(28) dwt_1_comp (/32)
(29) dwt_1_mask (/4)
(30) dwt_1_function (/32)
(31) dwt_2_comp (/32)
(32) dwt_2_mask (/4)
(33) dwt_2_function (/32)
(34) dwt_3_comp (/32)
(35) dwt_3_mask (/4)
(36) dwt_3_function (/32)