OpenOCD: Flashing Firmware To Arm Cortex M Microcontrollers

While it's relatively simple to compile code for an ARM microcontroller as part of a build process using GCC/Make, it can be difficult to know which toolchain to use in order to flash a firmware binary to the microcontroller.

You can also search online to buy flash programmers for arm MCUs.

LEAPER-3D - Leap Electronic - USB FLASH PROGRAMMER, WITH PC MODE

Image Source: Google

However, Microcontroller Evaluation boards include an embedded hardware programmer/ICDI chip. These can only be programmed with tools that are exclusive to Windows. There is also a community-made flashing program for Linux. But these programs are limited to certain microcontroller families.

OpenOCD is our rescue. It uses the On-Chip Debugger on most microcontroller boards to flash and debug ARM microcontrollers. We have created this guide because there is not enough documentation on how to use it.

What is OpenOCD?

OpenOCD, a program that can be installed on a Linux platform, allows you to connect to a Microcontroller and flash it. You can use either vendor-supplied ICDIs such as ST-Link or purpose-built hardware like a Bus Pirate, Olimex ARM -OCD-H, or a Bus Pirate.

It includes a GDB server that can be connected to debugging, as well as a Telnet server that can be used for passing OpenOCD commands to Flashing. OpenOCD supports many microcontrollers for debugging and flashing.

Note: The TM4C123GXL Evaluation Board is being used in this guide. However, other well-known ARM microcontrollers such as the STM32 + attached ICDI Debugger can also be used.