Testing and debugging OpenOCD code
In order to test a patch on OpenOCD mailing list which affects various versions of Arm architecture, no single hardware setup suffices developer needs. This guide is aimed to facilitate OpenOCD development and testing by providing a step by step guide to setup hardware environments based on three different target boards covering most common Arm architecture variants.
We have selected following hardware boards:
Nitrogen Board (Cortex M7):Â
Nitrogen is a 96Boards compliant IoT Edition board and has support for Zephyr RTOS. This board is based on the Arm Cortex M7 core which will enable us to test its support in OpenOCD and also allow us to debug CMSIS-DAP support with its on-chip USB to JTAG support.Â
Please click here to set up the hardware/software environment for OpenOCD based JTAG debugging with Nitrogen board. Once the hardware and software setup is complete we can run x86_64 host GDB and attach it to the running OpenOCD process. As a test set a breakpoint at openocd-src/src/target/cortex_m.c:cortex_m_resume and hit resume. This breakpoint will hit once you hit resume on arm-noneabi-gdb which is connected to OpenOCD for debugging a blinky demo running on Nitrogen board.
Raspberry Pi (Arm v7/AArch64/AArch32):Â
Raspberry Pi is a readily available reasonably priced board with JTAG debugging capability available through its GPIO interface. It also have a very good community support which makes it an ideal choice for testing and debugging OpenOCD support for Arm 32-bit support and AArch64/AArch32 support using Raspberry Pi 2 B and Raspberry Pi 3 B respectively. Click here for instructions on how to set up a Raspberry Pi board for JTAG debugging with OpenOCD.