SparkFun Forums 

Where electronics enthusiasts find answers.

Open source ARM Debugger
By mahonri
#186360
Hi All. I have an Atmel SAM D21 Explained Pro board. I used the edbg program to flash the led_toggle program. It is running, I see the LED flashing. I built openocd and am able to connect to the target.

$ openocd -f ./openocd.cfg
Open On-Chip Debugger 0.10.0-dev-00117-ga652a4e (2015-11-21-13:20)
Licensed under GNU GPL v2
For bug reports, read
http://openocd.org/doc/doxygen/bugs.html
Info : only one transport option; autoselect 'swd'
none separate
adapter speed: 400 kHz
cortex_m reset_config sysresetreq
Info : CMSIS-DAP: SWD Supported
Info : CMSIS-DAP: Interface Initialised (SWD)
Info : CMSIS-DAP: FW Version = 02.01.0157
Info : SWCLK/TCK = 1 SWDIO/TMS = 1 TDI = 1 TDO = 1 nTRST = 0 nRESET = 1
Info : CMSIS-DAP: Interface ready
Info : clock speed 400 kHz
Info : SWD IDCODE 0x0bc11477
Info : at91samd21j18.cpu: hardware has 4 breakpoints, 2 watchpoints
Info : accepting 'gdb' connection on tcp/3333
Info : SAMD MCU: SAMD21J18A (256KB Flash, 32KB RAM)

Next, I tried connecting with gdb, but don't seem to be able to halt and restart program execution.

$ /opt/arm-cortex-gnu-toolchain-linux_x86_64/bin/arm-none-eabi-gdb led_toggle_flash.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-linux-gnu --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 led_toggle_flash.elf...done.
(gdb) monitor halt reset
"monitor" command not supported by this target.
(gdb)

Can someone please give me some pointers on how to attach to a program that is already running from flash, restart it, set breakpoints, continue running etc?

Thanks,

Dallas