# Programming Microcontrollers using OpenOCD on a Raspberry Pi ## Overview ![](https://cdn-learn.adafruit.com/assets/assets/000/031/341/medium800/raspberry_pi_nrf.jpg?1458160756) Yay you have finally moved on from 8-bit chips and are ready to try out some 32-bit hotness! Those ARM Cortex chips look fun, some have built in bluetooth, or 2.4ghz radios, or usb...all you have to do is learn how to program them. # OpenOCD On your way to learning how to use your favorite new ARM Cortex you may have heard of [OpenOCD](http://openocd.org/). OpenOCD is the software that we will use to do the actual programming of chips. Unlike the AVR ISP programming protocol, every ARM chip is significantly different to program, with platform-unique commands, flash locations, fuse bits, settings, etc. Teasing out those details is a struggle and if you change chips you have to start all over _even if both chips are, say, Cortex-M3 based!_ Each chip fab tends to supply its own programming software - Atmel has Atmel Studio, Nordic has NRFGo, ST has ST Link - but often times that software is Windows only. OpenOCD is great because its cross platform, open source, and has support for a vast number of chips & programmers. You can use OpenOCD with dongle-programmers such as J-Link and ST-Link or even an FTDI chip. But, if you have a spare Raspberry Pi (and who doesn't these days?) you can use it as a native OpenOCD programmer with just a few wires. It's also really _fast_ to program chips natively, and if you have to program a mess of chips, it can make things speedy - an extra 30 seconds adds up when you're doing 1000! - [Next Page](https://learn.adafruit.com/programming-microcontrollers-using-openocd-on-raspberry-pi/compiling-openocd.md) ## Featured Products ### Raspberry Pi 3 - Model B - ARMv8 with 1G RAM [Raspberry Pi 3 - Model B - ARMv8 with 1G RAM](https://www.adafruit.com/product/3055) Did you really think the Raspberry Pi would stop getting better? At this point, we sound like a broken record, extolling on the new Pi’s myriad improvements like we’re surprised that the folks at the Raspberry Pi Foundation are continuously making their flagship board better. ... In Stock [Buy Now](https://www.adafruit.com/product/3055) [Related Guides to the Product](https://learn.adafruit.com/products/3055/guides) ### Raspberry Pi 2 - Model B v1.2 - ARM Cortex-A53 with 1G RAM [Raspberry Pi 2 - Model B v1.2 - ARM Cortex-A53 with 1G RAM](https://www.adafruit.com/product/2358) Didn't think the Raspberry Pi could get any better? You're in for a big surprise! The Raspberry Pi 2 Model B is out and it's amazing! With an upgraded ARM Cortex-A53 quad-core processor, Dual Core VideoCore IV Multimedia coprocessor, and a full Gigabyte of RAM, this... No Longer Stocked [Buy Now](https://www.adafruit.com/product/2358) [Related Guides to the Product](https://learn.adafruit.com/products/2358/guides) ### Raspberry Pi Model B+ 512MB RAM [Raspberry Pi Model B+ 512MB RAM](https://www.adafruit.com/product/1914) OMG OMG OMG, did you hear? There's a Raspberry Pi called the Model B+ and check it out...more USB ports, more GPIO, better power supply, four mounting holes, less sticky-out SD card! Yep, that's right, the fantastic engineers at Raspberry Pi HQ have blessed us with a new design.... In Stock [Buy Now](https://www.adafruit.com/product/1914) [Related Guides to the Product](https://learn.adafruit.com/products/1914/guides) ### SWD (2x5 1.27mm) Cable Breakout Board [SWD (2x5 1.27mm) Cable Breakout Board](https://www.adafruit.com/product/2743) This adapter board is designed to make it easier to use ARM dev boards that use slimmer 2x5 (0.05"/1.27mm pitch) SWD cables for programming.  It's helpful for using products like the [JTAGulator](https://www.adafruit.com/products/1550), In Stock [Buy Now](https://www.adafruit.com/product/2743) [Related Guides to the Product](https://learn.adafruit.com/products/2743/guides) ### 10-pin 2x5 Socket-Socket 1.27mm IDC (SWD) Cable - 150mm long [10-pin 2x5 Socket-Socket 1.27mm IDC (SWD) Cable - 150mm long](https://www.adafruit.com/product/1675) These little cables are handy when programming or debugging a tiny board that uses 10-pin 1.27mm (0.05") pitch SWD programming connectors. We see these connectors often on ARM Cortex dev kits, and have a few handy in our ARM-dev box. We thought you may want a backup cable as well, so now... In Stock [Buy Now](https://www.adafruit.com/product/1675) [Related Guides to the Product](https://learn.adafruit.com/products/1675/guides) ### JTAG (2x10 2.54mm) to SWD (2x5 1.27mm) Cable Adapter Board [JTAG (2x10 2.54mm) to SWD (2x5 1.27mm) Cable Adapter Board](https://www.adafruit.com/product/2094) This adapter board is designed for adapting a 'classic' 2x10 (0.1"/2.54mm pitch) JTAG cable to a slimmer 2x5 (0.05"/1.27mm pitch) SWD Cable.  It's helpful for using products like the [JTAGulator](https://www.adafruit.com/products/1550) or Out of Stock [Buy Now](https://www.adafruit.com/product/2094) [Related Guides to the Product](https://learn.adafruit.com/products/2094/guides) ### SEGGER J-Link EDU - JTAG/SWD Debugger [SEGGER J-Link EDU - JTAG/SWD Debugger](https://www.adafruit.com/product/1369) [Discontinued - **you can grab ** SEGGER J-Link EDU Mini - JTAG/SWD Debugger **instead!**](https://www.adafruit.com/product/3571) The SEGGER J-Link EDU is identical to the more expensive [J-Link BASE](https://www.adafruit.com/products/2209) model except... No Longer Stocked [Buy Now](https://www.adafruit.com/product/1369) [Related Guides to the Product](https://learn.adafruit.com/products/1369/guides) ### SEGGER J-Link BASE - JTAG/SWD Debugger [SEGGER J-Link BASE - JTAG/SWD Debugger](https://www.adafruit.com/product/2209) The SEGGER J-Link BASE is identical to the cheaper [J-Link EDU](https://www.adafruit.com/products/1369) model except for the **terms of use**. If you're going to use your debugger strictly for personal, non-commercial projects, such as publishing... In Stock [Buy Now](https://www.adafruit.com/product/2209) [Related Guides to the Product](https://learn.adafruit.com/products/2209/guides) ## Related Guides - [CircuitPython on the nRF52](https://learn.adafruit.com/circuitpython-on-the-nrf52.md) - [Debugging CircuitPython On SAMD w/Atmel Studio 7](https://learn.adafruit.com/circuitpython-samd-debugging-w-atmel-studio-7.md) - [Introducing the Adafruit Bluefruit LE Friend](https://learn.adafruit.com/introducing-adafruit-ble-bluetooth-low-energy-friend.md) - [CircuitPython NeoPixel Library Using SPI](https://learn.adafruit.com/circuitpython-neopixels-using-spi.md) - [Bootloading Basics](https://learn.adafruit.com/bootloader-basics.md) - [Programming an M0 using an Arduino](https://learn.adafruit.com/programming-an-m0-using-an-arduino.md) - [Blinking an LED with the Zephyr RTOS](https://learn.adafruit.com/blinking-led-with-zephyr-rtos.md) - [Adafruit FT232H With SPI & I2C Devices](https://learn.adafruit.com/adafruit-ft232h-with-spi-and-i2c-libraries.md) - [Adafruit Metro M4 Express AirLift (WiFi)](https://learn.adafruit.com/adafruit-metro-m4-express-airlift-wifi.md) - [Adafruit Metro M0 Express](https://learn.adafruit.com/adafruit-metro-m0-express.md) - [Running PyPortal Code on Blinka with Displayio](https://learn.adafruit.com/running-pyportal-code-on-blinka-with-displayio.md) - [Debug Header for the Feather [M0]](https://learn.adafruit.com/make-a-simple-debugging-featherwing-for-the-m0.md) - [How to Program SAMD Bootloaders](https://learn.adafruit.com/how-to-program-samd-bootloaders.md) - [Adafruit MatrixPortal S3](https://learn.adafruit.com/adafruit-matrixportal-s3.md) - [How to Find Hidden COM Ports](https://learn.adafruit.com/how-to-find-hidden-com-ports.md)