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

Migrating from Eclipse/GCC to Atollic TrueSTUDIO

Posted by Mattias Norlander on Mar 25, 2015 6:46:00 PM

We get lots of questions from developers who are using "home-made" Eclipse / GCC development tools. They want to know if there is a simple way to migrate their legacy code into Atollic TrueSTUDIO. The answer is, 'Yes,' but there are several factors to consider.

This article highlights the major reasons to why many engineers eventually moves towards a commercial tool. It also suggest an easy migration path from an "home-made" Eclipse / GCC development tool to Atollic TrueSTUDIO.

Read More

Topics: ECLIPSE, GNU tools (GCC/GDB), Project migration

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 2)

Posted by Magnus Unemyr on Mar 9, 2015 3:15:00 PM

In this third 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 multichannel console output re-direction such that the output goes to several different console windows in the debugger using the JTAG cable, offering separate console views for different parts of your S/W.

Before reading this article on multichannel console output using SWV/ITM, I recommend you first read the previous blog post on singlechannel printf() redirection using ITM, and perhaps also the general overview of SWV event- and data- tracing available in Cortex-M devices.

Read More

Topics: ECLIPSE, ARM Cortex, GNU tools (GCC/GDB), Debugging, Atollic TrueSTUDIO, RTOS

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

Build your embedded code as a Windows .EXE app

Posted by Magnus Unemyr on Jan 30, 2015 11:13:00 AM

  

Embedded developers typically run their embedded code on the target platform, such as a Cortex-M based microcontroller like STM32, Kinetis, LPC or EFM32. This is all and well, but sometimes it is really hard to debug and test the code in an embedded board. There are certain use-cases when it would be much easier to debug and test the embedded code on a Windows PC instead.

Control algorithms processing live sensor data comes to mind, as live sensor data is difficult to reproduce when testing modifications to the algorithm. Wouldn’t it be much easier to test the algorithm implementation on a PC, using well-known predefined data from a data file, rather than from the live sensor in real-time?

Read More

Topics: ARM Cortex, GNU tools (GCC/GDB), Debugging, Atollic TrueSTUDIO

The embedded industry standardise on ARM, ECLIPSE and GNU

Posted by Magnus Unemyr on Jan 19, 2015 4:17:00 PM

 

segla

ARM is taking a stronger and stronger grip on the embedded market, and is now the de-facto standard microcontroller architecture. This trend has been strengthened a lot since the introduction of the low-cost Cortex-M0 and Cortex-M3 cores, and continues with the powerful Cortex-M4 and Cortex-M7 cores for high-end microcontrollers. And of course, for DSP and application processor type of applications, Cortex-R and Cortex-A is being increasingly used.

An equally strong paradigm shift is happening in the embedded tools industry, where the GNU C/C++ compiler and debugger tools (gcc, gdb, binutils, etc.) are quickly emerging as a standard tool solution as well. This trend is valid with both smaller companies who appreciate the better return on investment compared to traditional proprietary tools, as well as multinational corporations who value a tool-chain that exist for almost all CPU architectures in common use, on all relevant host operating systems. Furthermore, the GNU tools helps avoid a proprietary lock-in and offers second source suppliers and support should the need arise. These benefits are not possible with proprietary tools.

Read More

Topics: ECLIPSE, ARM Cortex, GNU tools (GCC/GDB)