SIMPLELINK-OPENOCD: Issues stepping though code using OpenOCD and GDB on CC1352P1

Hello,

I am using a CC1352P1 LaunchXL from TI, and interfacing this with an ENC28J60 to add ethernet functionality. I am using gdb from the arm-embedded-toolchain. I was able to get OpenOCD from https://git.ti.com/cgit/sdo-emu/openocd working and step through code on my board, using the following commands :

To program and step through the code:

$ src/openocd -s tcl/ -f interface/xds110.cfg -c “adapter_khz 1500” -c “transport select jtag” -f target/ti_cc13x2.cfg -c “gdb_memory_map disable” -c “program spimaster_CC1352P1_LAUNCHXL_tirtos_ccs.out”

Open On-Chip Debugger 0.10.0

Licensed under GNU GPL v2

For bug reports, read

openocd.org/.../bugs.html

adapter speed: 1500 kHz

jtag

srst_only separate srst_gates_jtag srst_open_drain connect_deassert_srst

adapter_nsrst_delay: 100

Info : XDS110: connected

Info : XDS110: firmware version = 3.0.0.2

Info : XDS110: hardware version = 0x0023

Info : XDS110: connected to target via JTAG

Info : XDS110: TCK set to 2500 kHz

Info : clock speed 1500 kHz

Info : JTAG tap: cc13x2.jrc tap/device found: 0x3bb4102f (mfg: 0x017 (Texas Instruments), part: 0xbb41, ver: 0x3)

Error: cc13x2.jrc: IR capture error; saw 0x3f not 0x01

Warn : Bypassing JTAG setup events due to errors

Info : JTAG tap: cc13x2.jrc tap/device found: 0x3bb4102f (mfg: 0x017 (Texas Instruments), part: 0xbb41, ver: 0x3)

Info : JTAG tap: cc13x2.dap enabled

Info : cc13x2.cpu: hardware has 6 breakpoints, 4 watchpoints

target halted due to debug-request, current mode: Thread

xPSR: 0x61000000 pc: 0x1000118e msp: 0x11001ff0

** Programming Started **

auto erase enabled

wrote 32768 bytes from file spimaster_CC1352P1_LAUNCHXL_tirtos_ccs.out in 0.851487s (37.581 KiB/s)

** Programming Finished **

Info : accepting ‘gdb’ connection on tcp/3333

Info : JTAG tap: cc13x2.jrc tap/device found: 0x3bb4102f (mfg: 0x017 (Texas Instruments), part: 0xbb41, ver: 0x3)

Info : JTAG tap: cc13x2.dap enabled

In another terminal :

$ sudo Downloads/gcc-arm-none-eabi-9-2019-q4-major/bin/arm-none-eabi-gdb -tui spimaster_CC1352P1_LAUNCHXL_tirtos_ccs.out

In GDB:

(gdb) target remote localhost:3333

Remote debugging using localhost:3333

0x1000118e in ?? ()

(gdb) monitor reset halt

JTAG tap: cc13x2.jrc tap/device found: 0x3bb4102f (mfg: 0x017 (Texas Instruments), part: 0xbb41, ver: 0x3)

JTAG tap: cc13x2.dap enabled

target halted due to debug-request, current mode: Thread

xPSR: 0x61000000 pc: 0x1000118e msp: 0x11001ff0

After this, I can set breakpoints and step through code. I’ve tried generic things like blinking GPIO LED’s and that works when I step over the relevant line in my code. However, some pieces of code such as SPI transfers to turn on the LED on the ENC28J60, which works in ‘free’ mode, do not run when I step over the relevant line of code in debug mode. I am using an SPI clock speed of 8MHz, and I’ve tried 2 MHz to 12 MHz with similar results.

I should also add that I am able to debug the interface properly with Code Composer Studio’s internal debugger. However, I want to move away from using CCS and that’s why I tried using OpenOCD.

What could be going wrong?

Warm regards,

Samyukta