JTAG and SWDWith the advent of JTAG this is less of a problem, but not all microcontrollers have JTAG interfaces. Because a full JTAG interface requires at least five controller pins (the fully full JTAG connector has 20 pins!), MCU manufacturers sometimes prefer using a simplified or customized debugging interface that occupies fewer resources. Smaller ARM-core-based processors for instance often are equipped with an SWD (Serial Wire Debug) port instead that needs only two pins.
Besides choosing a suitable debug tool, setting up a debugging environment is not an easy task. Of course, if you throw enough money at it, the situation improves greatly, but when you have to go the low-cost GDB-with-OpenOCD way things are less comfortable.
Black Magic Probe supports JTAG and SWDThe Black Magic Probe (BMP) by 1BitSquared that we are going to try out in this article is a debugging tool that addresses these problems. Not only does it support both JTAG and SWD, it also has a built-in GNU Debugger (GDB) server simplifying toolchain setup, and works on Windows, Linux and macOS.
Before you get too excited, BMP targets ARM Cortex-M and Cortex-A based microcontrollers, but there are many of those on the market (STM32, SAM, LPC, nRF5, and many more).
Black Magic Probe specifications
- Load your application into the target Flash memory or RAM.
- Single step through your program.
- Run your program in real time and halt on demand.
- Examine and modify CPU registers and memory.
- Obtain a call stack backtrace.
- Up to six hardware assisted breakpoints.
- Set up to four hardware assisted read, write or access watchpoints.
- Unlimited software breakpoints when executing your application from RAM.