<img height="1" width="1" style="display:none" src="https://www.facebook.com/tr?id=1596188457259603&amp;ev=PageView&amp;noscript=1">
TruePERSPECTIVES_logo.png

Cortex-M debugging: Memory access history trace log using SWV/SWO

Posted by Magnus Unemyr on Mar 31, 2015 11:35:00 AM

In my previous blog post on real-time variable watch using Serial Wire Viewer (SWV/SWO) tracing, I outlined how Cortex-M devices can feed advanced debuggers with real-time updates on variable vales as the target system executes at full speed. This is implemented using a hardware supported real-time data access trace capability, not using polling, and thus all variable reads or writes are truly detected (provided buffer overflows don’t happen due to bandwidth problems).

In this blog article, I will extend upon this and explain how this capability can also be used to provide a true memory/variable access history trace log; showing you exactly which reads or writes have been made to a memory location or variable. This is incredibly useful, if for example a variable is inadvertently getting an illegal value and you cannot understand where this value is written to the variable, or why.

Read More

Topics: ECLIPSE, ARM Cortex, GNU tools (GCC/GDB), Debugging, Atollic TrueSTUDIO, SEGGER J-Link, ST-LINK

Cortex-M debugging: Real-time variable watch using SWV/SWO

Posted by Magnus Unemyr on Mar 25, 2015 3:06:00 PM

In this blog article, I will provide the first of three articles on what capabilities are available to Cortex-M developers in terms of real-time variable value visualization and memory access history analysis, using Serial Wire Viewer tracing. Using H/W support in Cortex-M devices (including STM32, Kinetis, EFM32, etc.), advanced debuggers can provide a lot of useful information to developers in pain trying to find that particularly hard to find “million-dollar” bug.

In particular, capabilities highlighted in the three articles in this blog post series are the possibility to watch variable values in real-time as the application runs at full execution speed (no need to stop on a breakpoint to check the value of a variable), the possibility to analyze the variable/memory access history in detail, as well as providing a graphical real-time plot of variable values in “oscilloscope style” as the application runs at full speed.

Read More

Topics: ARM Cortex, GNU tools (GCC/GDB), Debugging, Atollic TrueSTUDIO, SEGGER J-Link, ST-LINK

Cortex-M debugging: Software tracing using SWV/ITM

Posted by Magnus Unemyr on Mar 19, 2015 10:53:00 AM

In this article I will cover how to instrument the application to perform general software tracing on Cortex-M devices (such as STM32, Kinetis, LPC or EFM32) using the Instrumentation Trace Macrocell (ITM), which is part of the Serial Wire Viewer (SWV) real-time tracing module in the ARM CoreSight debugger technology.

Using ITM, the application can “print” arbitrary data to a debugger console using the JTAG probe/cable, thus offering a very useful insight into the internal behavior of a Cortex-M system running at full speed. By reading this article you will learn how to leverage this capability to instrument your application with “trace points” and see what your application does without stopping execution.

Read More

Topics: ARM Cortex, GNU tools (GCC/GDB), Debugging, Atollic TrueSTUDIO, SEGGER J-Link, ST-LINK

Cortex-M debugging: printf() redirection to a debugger console using SWV/ITM (part 1)

Posted by Magnus Unemyr on Feb 25, 2015 7:11:00 AM

 

In this second blog post on Serial Wire Viewer (SWV) real-time tracing, I will cover how the instrumentation trace macrocell (ITM) in Cortex-M devices (such as STM32, Kinetis, LPC, EFM32, etc.) can be used for printf() re-direction such that the output goes to a console window in the debugger using the JTAG cable, removing the need for any USB or UART cable.

My first blog post in this article series was a basic background and introduction to Serial Wire Viewer tracing, and starting with this article, I will cover the specific debugger capabilities that are enabled by SWV and its related technologies SWD, SWO and ITM. First out is this article on how to use ITM.

Read More

Topics: ECLIPSE, ARM Cortex, GNU tools (GCC/GDB), Debugging, Atollic TrueSTUDIO, SEGGER J-Link, ST-LINK

Cortex-M debugging: Introduction to Serial Wire Viewer (SWV) event- and data tracing

Posted by Magnus Unemyr on Feb 22, 2015 12:06:00 PM

 

While talking to our TrueSTUDIO customers, as well as many other Cortex-M developers, it has become clear to me that many developers are not aware of the powerful system analysis and debugging mechanisms available in Cortex-M devices. By better utilizing the capabilities that are already in their possession, embedded developers could easily become a lot more efficient in their debugging efforts.

I touched upon this subject in my earlier blog post on Hard fault system crash analysis on Cortex-M devices, and I will continue with a series of blog posts on real-time event- and data tracing using the Serial Wire Viewer (SWV) debug interface, which is available in Cortex-M cores and hence in popular devices like STM32, Kinetis, LPC or EFM32. This is the first blog post in the article series; several more will come in the next couple of weeks.

Read More

Topics: ECLIPSE, ARM Cortex, GNU tools (GCC/GDB), Debugging, Atollic TrueSTUDIO, SEGGER J-Link, ST-LINK

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.

Read More

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

Easily solve runtime errors using the hard fault crash analyzis capabilities of Cortex-M

Posted by Magnus Unemyr on Jan 29, 2015 11:06:00 AM

  

I think many Cortex-M developers are not fully aware of the powerful debug capabilities included in their Cortex-M based microcontrollers, like STM32, Kinetis, LPC or EFM32. This is valid for the super-useful Serial Wire Viewer (SWV) real-time event and data tracing capabilities, but perhaps even more so, the hard fault crash analyzis capabilities integrated in the Cortex-M core.

For example, our Atollic TrueSTUDIO debugger includes a hard fault crash analyzer, which detects hard-to-find runtime errors during full-speed target execution. Perhaps your system crashes a couple of times every week due to a sensor reading out-of-range values, causing a pointer error to bring the CPU to a hard fault due to accessing illegal memory or on misaligned boundaries. This type of problems can be really hard to find and solve.

Read More

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