- Install OpenOCD. You need version >= 0.8.0.
- This version is not in Ubuntu 14.04, but the packages from Ubuntu Utopic work fine there
brew install open-ocd
looks to be 0.8.0
-
Save the openocd script below as
tessel-busblaster.cfg
. -
Plug the JTAG cable into the Bus Blaster's adapter board and the Tessel. Pin one is towards the USB port; the cable goes over the center of the board.
-
Run
arm-none-eabi-gdb out/Release/tessel-firmware.elf -ex 'target remote | openocd -c "gdb_port pipe;" -f ../jtag/tessel-busblaster.cfg'
(adjust paths as appropriate) to launch gdb.
c
- continuectrl-c
- stopp expr
- print the value of the C expressionexpr
bt
- stack backtraces
- step instruction, goes into callsn
- next instruction, skips over callsfin
- run until return from functionbreak function
- break at the beginning of a function (can also passfile.c:line
)delete 1
- delete the first breakpointtbreak
- break only once
mon reset
- Reset Tessel and all on-chip peripherals (like the reset button)mon soft_reset_halt
- Reset the CPU only
-
Make sure your
.elf
file matches the firmware on the Tessel. Otherwise the position information will be wrong and calls will crash. -
LPC1800 SPIFI Flash is functional from OpenOCD, but I don't recommend using it. Flash Tessel with the bootloader (
make arm-deploy
) before running GDB. -
The ROM confuses JTAG on reset. If you
c
and thenctrl-c
, it recovers. To debug the very beginning of execution, usemon soft_reset_halt tbreak main c