TruePERSPECTIVES_logo.png

Attach to running target using SEGGER J-Link

Posted by Mattias Norlander on Jun 30, 2015 2:08:00 PM

INTRODUCTION:

Atollic technical support team are often asked how to make Atollic TrueSTUDIO connect to a running target in order to troubleshoot a crashed CPU. This article shows, step-by-step, how to connect to a running target without restting it.

This approach is useful when trying to resolve problems which occur at rare occasions, often after several days of running your embedded application, by connecting Atollic TrueSTUDIO debugger via JTAG/SWD the embedded target using a SEGGER J-Link.

Finding the root cause of the problem in case of a CPU crash is further simplified by learning how to use the Fault Analyzer view. White paper and Video tutorial is provided!

Read More

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

How to debug FreeRTOS and OpenRTOS applications [application note]

Posted by Magnus Unemyr on Jun 4, 2015 9:37:00 AM

FreeRTOS is one of the most popular real-time operating systems in recent years. (OpenRTOS is technically identical to FreeRTOS but is sold as a commercial product.)

Many Cortex-M developers adding FreeRTOS to their STM32, LPC or EFM32 projects. But what about tool support? Professional developers need professional compiler and debugger IDEs and kernel-aware debug support for FreeRTOS in the IDE. We have written an application note about using this feature in the TrueSTUDIO IDE.

Read More

Topics: ARM Cortex, Debugging, Atollic TrueSTUDIO, RTOS

Learn more on Cortex-M hard fault exception analysis [video tutorial]

Posted by Magnus Unemyr on May 13, 2015 1:18:46 PM

Our free hard fault exception crash analyzis video tutorial will teach you how to analyse and fix Cortex-M system crashes which can be very difficult and time consuming. Hard faults can occur due to division by zero, stack overruns, pointer errors etc.

By using the methods and tools outlined in this video, the root cause and location of hardfault system crashes in popular Cortex-M based microcontrollers like STM32, Kinetis, LPC etc. can be easily identified in seconds, rather than hours.

Read More

Topics: ARM Cortex, Debugging, Atollic TrueSTUDIO

12 great tools and techniques for STM32 developers

Posted by Magnus Unemyr on May 13, 2015 12:35:00 PM

Are you a skilled embedded developer, creating great software for STM32? You are in good company. If so, this blog article is for you. I have collected a number of tools and techniques that can be used to help you write STM32 software in an even better way, launching your embedded product more timely and of higher quality.

What does it take to write great STM32 software? Naturally, you need to know C or C++ and possibly a tad bit of assembler as well. You also need to know your target device and its device driver libraries as well. STMicroelectronics will provide information on this. But when what? What are the “secret” techniques used by really skilled STM32 developers? What tips and tricks do they want to keep to themselves?

Read More

Topics: ARM Cortex, Software quality, Debugging, Embedded Software Development

What you need to know about debugging interrupts and exceptions on Cortex-M devices

Posted by Magnus Unemyr on Apr 28, 2015 11:20:34 AM

Any Cortex-M developer have likely struggled with getting interrupts to work, or tried to debug them. Getting it all hooked up can be rather tricky, from getting a correctly defined interrupt vector table linked on the right memory addresses, to enabling interrupts properly, and then processing them in an interrupt handler. It all involves advanced topics like linker configuration files, SFR register bit field configuration and manipulation, interrupt #pragmas, possibly inline assembly and more.

So how do you go about analyzing and debugging the behavior of your interrupts and exceptions on a Cortex-M device like STM32, Kinetis, LPC or EFM32? Interrupts and exceptions are by definition asynchronous to the execution flow of your application software and it can be very difficult to visualize interrupt behavior, and debug the same. So what is a Cortex-M developer to do? As it so happens, the Cortex-M core has brilliant hardware support for visualizing and debugging interrupt behavior. This is how to use it.

Read More

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

How to develop and debug BOOTLOADER + APPLICATION systems on ARM Cortex-M devices

Posted by Magnus Unemyr on Apr 27, 2015 4:21:00 PM

As we all painfully have come to learn - firmware is rarely bug-free and new requirements are usually added over time. And so there is a need for a method to upgrade the firmware of a shipped product when defects are found or new functionality is needed. From a logistics point of view, a product recall with a factory upgrade might not be a feasible option.

By separating the application logic from the booting process, developers can design a system that allows end-users or service technicians to upgrade the application software with a newer and presumably better version later on, without the need for recalls or factory upgrades. This can be done using a bootloader. But what is a bootloader and how is it implemented and debugged on an ARM Cortex-M device like STM32 or Kinetis? The post also links to a bootloader code example for STM32F4-Discovery.

Read More

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

New whitepaper on ETM/ETB instruction tracing on Cortex-M devices

Posted by Magnus Unemyr on Apr 23, 2015 2:19:57 PM

As outlined in a recent blog article, ETM/ETB instruction tracing is the heavy artillery in Cortex-M debugging, and you may need it to solve that impossible "one million dollar bug", or if you cannot stop on breakpoints without damaging physical equipment, which can be the case in motor control applications for example.

Using ETM/ETB instruction tracing, you can record execution history for later analysis, and thus work out what the CPU did prior to the bug. To do that, you need an ETM-trace enabled debug probe, such as the SEGGER J-Trace, as well as a debugger IDE like Atollic TrueSTUDIO with trace support. For ETB, no particular trace-enabled debugger probe is needed, but the target device needs to have ETB on-chip. You can read more on ETM/ETB instruction tracing on Cortex-M devices like STM32, Kinetis or LPC in our new whitepaper.

Read More

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

Why STM32 developers still need an SFR view to study the STM32 special function peripheral registers

Posted by Magnus Unemyr on Apr 20, 2015 11:08:55 AM

Writing device-drivers for microcontrollers like STM32 is very complicated if you haven’t written a few of them before; not only do you need to understand the peripheral module hardware and their special function registers (SFR’s), you also have to be an ace on the meaning of SFR bit-fields and bits, understand interrupt vector tables, #pragmas, inline assembly and other intricate things.

Not too many years ago, semiconductor vendors didn’t provide device-driver libraries with their microcontrollers, and so each customer had to write them from scratch. What a waste of engineering time and duplication of resources! Way too many years later, they started to ship static device driver libraries or device-driver generations tools to help struggling developers. STMicroelectronics for example provide both static STM32 device-driver libraries, as well as the STM32CubeMX device initialization tool. And so, with readymade device driver libraries available, do STM32 developers need to worry about SFR’s anymore? I’d say yes, for reasons outlined in this blog article.

Read More

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

Using SEGGER J-Trace to record and analyze execution history with ETM instruction tracing

Posted by Magnus Unemyr on Apr 16, 2015 2:02:00 PM

The Segger J-Link and other JTAG/debug probes (like ST-LINK for STM32 devices) offer great debugging capabilities on ARM Cortex-M devices, such as STM32, EFM32, XMC or Kinetis. Debugging techniques supported by J-Link and ST-LINK include for example hard fault crash analysis and real-time system analysis with event- and data tracing using the Serial Wire Viewer (SWV) interface.

This is great, but what if you are still stuck? Or perhaps you will damage physical H/W if you stop execution on a breakpoint, which can be the case in motor control applications. In such case, you may need to call for the heavy debugging artillery. For ARM Cortex developers, that means bringing in a debug probe that can record execution history for later analysis, using the ETM instruction trace interface from ARM. To do that, you need an ETM-trace enabled debug probe, such as the SEGGER J-Trace, as well as a debugger IDE like Atollic TrueSTUDIO with trace support..

Read More

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

Top reasons why the embedded industry standardize on ARM processors, the GNU compiler and the Eclipse IDE

Posted by Magnus Unemyr on Apr 14, 2015 3:05:00 PM

It is currently a very strong trend in the embedded industry to standardize on ARM Cortex devices, the GNU gcc compiler (with its accompanying gdb debugger), and the Eclipse IDE. I call the ARM, GNU and ECLIPSE combo “AGE”.

What are the driving factors for this strong trend? And what are the benefits for embedded developers to jump on the ARM Cortex, GNU gcc/gdb and Eclipse train? In my opinion, there are many benefits that provide embedded developers with great advantages.

Read More

Topics: ECLIPSE, ARM Cortex, GNU tools (GCC/GDB), Debugging, Atollic TrueSTUDIO, Embedded Software Development, Project migration

Are STM32 developers using FreeRTOS blind?

Posted by Magnus Unemyr on Apr 14, 2015 11:56:21 AM

One of the most popular real-time operating systems in recent years is FreeRTOS; and many STM32 developers use it successfully in their STM32 designs. FreeRTOS is a free-of-charge lightweight RTOS, offering threading capabilities on Cortex-M devices, including STM32.

While commercial RTOS’es may support more advanced capabilities, FreeRTOS is good enough for many; and hence its popularity considering its price. It is probably the most widely used RTOS for microcontrollers by now. Are you too using FreeRTOS on STM32? Great, but don’t be blind!

Read More

Topics: ARM Cortex, Debugging, Atollic TrueSTUDIO, RTOS

11 techniques every Cortex-M developer should consider

Posted by Magnus Unemyr on Apr 13, 2015 1:31:27 PM

Are you a skilled Cortex-M developer, perhaps developing great software? Of course you are. No one would admit to being a lousy developer. However, it is useful to sometimes take a step back and see if there are new techniques or skills available that can help you improve. In this blog article, I have collected a number of techniques that can be deployed to help you develop Cortex-M software in a better way, releasing software more timely and of higher quality.

First of all, you obviously need to know C or C++ and possibly a tad bit of assembler as well. This is a must; if you don’t master this, order a book on Amazon.com immediately. You likely need to know your target device and its device driver libraries as well. Your semiconductor vendor will provide information on this. But when what? What are the “secret” techniques used by really skilled embedded developers?

Read More

Topics: ARM Cortex, Software quality, Debugging, Embedded Software Development