Debug Zephyr app on Nitrogen board with OpenOCD

Nitrogen is a 96Boards compliant IoT Edition board and is a low cost option for debugging Arm Cortex M support in OpenOCD. This guide provides a quick setup guide for Nitrogen board with the outcome of debugging OpenOCD code related to Arm Cortex M support.

Prerequisite: Set up OpenOCD development environment

Host Environment: Ubuntu version 18.04

Hardware requirements:

  • Nitrogen Board
  • Micro USB cable

Build Zephyr Blinky demo for Nitrogen board:

Zephyr getting started guide[1] provides a step by step guide to set up Zephyr build environment and build a LED blinking demo for Nitrogen board. Following steps are taken from Zephyr getting started guide and more details can be found here[1].

Install dependencies:

Note: Update cmake version if cmake --version returns < 3.13.1

Get Zephyr and install Python dependencies:

Install a Toolchain:

Build blinky demo and load it up using GDB via OpenOCD:

Expected output of OpenOCD console after successfully connecting with Nitrogen board


Expected output of GDB console after successfully loading blinky demo: 

References:

  1. https://docs.zephyrproject.org/latest/getting_started/index.html
  2. https://docs.zephyrproject.org/latest/boards/arm/96b_nitrogen/doc/index.html