OpenOCD Debugging Prerequisites (Bare Metal and MPLAB® Harmony)

Last modified by Microchip on 2026/10/06 15:47

Pre-Requisite Setup Instructions: Debugging With OpenOCD

Download the required OpenOCD tools. Unzip it and find the Tools folder.
Steps 2, 3, 4, and 5 install the required tools from this folder
.OpenOCD Tools

Install Debugging Dependencies for VS Code®

Follow Steps 1–7 to install the required development tools for successfully debugging a bare-metal application using MPLAB® Extensions for VS Code®.

Download and Install VS Code

Download and install VS Code for your operating system (Windows®, Linux®, or macOS®).

Make sure VS Code launches successfully after installation.

Install the MPLAB Extension Pack from the VS Code Marketplace.

  1. Open VS Code.
  2. Go to Extensions.
  3. Search for "MPLAB Extension Pack".
  4. Click Install.

MPLAB Extension Pack on the VS Code Marketplace

Install the Cortex-Debug extension.

  1. Open VS Code.
  2. Go to Extensions.
  3. Search for "Cortex-Debug".
  4. Click Install.

Cortex Debug Extension on VS Code Marketplace

Install the Serial Monitor extension.

  1. Open VS Code.
  2. Go to Extensions.
  3. Search for "Serail Monitor".
  4. Click Install.

Serial Monitor extension on VS Code Marketplace


Install and Verify OpenOCD

Copy the OpenOCD folder from the extracted file downloaded from GitHub®. Copy the OpenOCD-20250710-0.12.0 folder ​to C:\.

OpenOCD Tools

Add OpenOCD to path environment variables.

Add the OpenOCD bin directory (C:\OpenOCD-20250710-0.12.0\bin) to your system Path environment variable.

Open environment variables:
edit system environment Vaiables

OpenOCD Bin

Verify the installation.

Open Command Prompt and verify OpenOCD is installed correctly by running:

openocd –-version.

Command Prompt window


Arm® GNU Toolchain Installation

Install Arm GNU Toolchain.

Install arm-gnu-toolchain-14.3.rel1-mingw-w64-x86_64-arm-none-eabi.exe from the unzipped folder by double-clicking it. Once the installation is complete, the following window appears:

Arm GNU Toolchain window

Warning

Check the Add to path system environment variable option before clicking Finish.

The Arm GNU Toolchain path should be automatically set by the installer in the PATH system environment variables; if not, add the path manually to the system path variable:

C:\Program Files (x86)\Arm GNU Toolchain arm-none-eabi\14.3 rel1\bin

System variable update

Verify the installation.

Open Command Prompt and verify the installation by running:

arm-none-eabi-gcc --version.

arm


Install at91bootstrap Windows Build Dependencies

Add make and bc tools from the unzipped folder downloaded from GitHub to Path system environment variables:

Eg: C:\Users\xxxx\Downloads\open_ocd_tools\make

System path

Verify make and bc from the Command Prompt:

  • make --version
  • bc --version

make


Install Python®

Install Python from the unzipped folder, OpenOCD_Tools\python, and add it to the system environment variable as shown in the accompanying image:

Python

Verify python: python --version.

Python version


Verify UsbDriverTool Is Working

Execute UsbDriverTool.exe from the unzipped folder and ensure it opens successfully.

If prompted to update Windows driver software, complete the update and ensure the application launches correctly.


Install Git (optional)

Back to Top