ARM Cortex-M debugger tricks: Go live with your debugger

Posted by Magnus Unemyr on Feb 3, 2015 11:56:00 AM


In many cases it is not overly useful to stop execution on a breakpoint to inspect variable values. Perhaps because you don’t want to debug the code in the first place. A typical example is when you run the embedded system in the lab, reading live sensor data for processing, during system-level testing or customer demos. Wouldn’t it be much better if you could display the variable values without stopping execution just to monitor what the system does at runtime?

Perhaps your embedded system have moving parts, and you want to read the X-, Y- and Z- axis positions as the machine turns or moves. Or you are in the metering business, reading temperatures from an oven or chemical processes.

In cases like those, and many others, it is very useful to be able to read and display variable values live, when the system is running at full speed performing its normal duties. This is in fact possible using the ARM Cortex-M processor and high-end development tools such as Atollic TrueSTUDIO C/C++ IDE and the SEGGER J-Link JTAG probe.


Atollic TrueSTUDIO includes a Live Expressions view in the debugger, enabling developers to watch variable values in “real time” as the target runs at full speed. The C/C++ IDE not only displays an unlimited number of variables with live update, but can also display the result of complex mathematical expressions worked-out in “real-time” as well. The Live Expressions view supports display of structures and array elements for full, “at-a-glance” visualization of complex data structures.

If you are using a Cortex-M processor like STM32, Kinetis, LPC or EFM32, and you use Atollic TrueSTUDIO and SEGGER J-Link, you may want to check out this capability. While this is a very useful tool in your debugging toolbox, it may be even more useful for system-level testing and customer demos during prototyping or early development phases.

This capability is not supported with all JTAG probes however, in case you are using the ST-LINK JTAG probe instead of SEGGER J-Link, you can use the Serial Wire Viewer (SWV) data trace interface to achieve a similar capability. To read more on event- and data- tracing using SWV/SWO on ARM Cortex-M devices, read this whitepaper:

 Read our SWV event and data tracing whitepaper!

Topics: ARM Cortex, Debugging, Atollic TrueSTUDIO, SEGGER J-Link, ST-LINK