De grootste kennisbank van het HBO

Inspiratie op jouw vakgebied

Vrij toegankelijk

Terug naar zoekresultatenDeel deze publicatie

Enabling open-source trace tooling on NXP S32K344

Open access

Rechten:

Enabling open-source trace tooling on NXP S32K344

Open access

Rechten:

Samenvatting

Many ARM Cortex-M-based microcontrollers include tracing features which allow monitoring hardware events (e.g. exceptions occurring, a specific instruction being executed or a specific address range being accessed by the CPU). Tracing enables non-intrusive insight into software execution (i.e. software behavior and performance is preserved), as opposed to using intrusive debugging methods such as setting breakpoints and/or single-stepping. Unfortunately, tracing features are currently mostly exploited through high-end, expensive tooling from commercial vendors, making it hard to use tracing features in a cost-effective manner. A recent development is the Orbuculum suite, which is a collection of open-source tools that use ARM tracing features for various purposes.

NXP Mobile Robotics is currently transitioning towards using an NXP S32K3 series microcontroller with an ARM Cortex-M7 CPU for one of their development boards, and they are facing challenges with mapping an application to the M7 core and the various types of memory available in the system such that the application performs optimally. NXP Mobile Robotics is interested in making tracing features usable on S32K3 in a cost-effective manner, so that their users can use tracing to gain insight into how effectively an application exploits the hardware in the microcontroller. To this end, this graduation report focusses on enabling tracing features on an S32K344 MCU and enabling/developing tools that allow using these tracing features cost-effectively.

Based on the project goal and requirements defined in consultation with NXP Mobile Robotics, the tracing features available in S32K344 were investigated. The S32K344 features three types of trace sources that monitor various types of hardware events: the Data Watchpoint and Trace unit (DWT), the Instrumentation Trace Macrocell (ITM) and the Embedded Trace Macrocell (ETM). The S32K344 also contains two types of off-chip interfaces for receiving trace data: Single Wire Output (SWO; available on the debug headers of many ARM Cortex-M-based development kits) and parallel trace. SWO is capable of much lower maximum trace bandwidth than parallel trace due to using only a single pin instead of five, but this also makes SWO more cost-effective and less complex. Due to bandwidth requirements of the various types of trace sources, DWT and ITM tracing can be done over either SWO or parallel trace, while ETM tracing can practically only be done using the high-bandwidth parallel trace interface.

Based on the available trace sources, a list of tools to enable/develop was defined. In this graduation report, three tools which utilize DWT/ITM tracing and function over SWO were enabled/developed: (1) orbtop (from the Orbuculum suite), which allows reconstructing CPU load of an application; (2) an ITCM mapping tool, allowing automatic identification and mapping of high-load application functions to the S32K344’s fastest memory; and (3) orbstat (from the Orbuculum suite), which allows generating call graphs of the running application to gain insight into frequency of and the relationship between function calls. A list of tracing tools that likely require ETM and/or DWT/ITM over the parallel trace interface was also defined, but at time of writing these have not yet been implemented due to prioritizing development of the tools that could function over the less complex SWO interface.

To demonstrate applicability of the three enabled/developed tracing tools, they were exercised with PX4 Autopilot (flight control software for autonomous vehicles) as an example application, running on an NXP MR-Buggy3 rover platform. Using the insights provided by the tracing tools, various optimizations were done to PX4 Autopilot.

Complementary to the enabled/developed tracing tools and in line with the intent to make them accessible to future users, a user guide was written that explains how to set up and use the tracing tools.

Toon meer
OrganisatieHogeschool Utrecht
AfdelingInstitute for Design and Engineering
PartnerNXP Semiconductors
Datum2023-05-22
TypeBachelor
TaalEngels

Op de HBO Kennisbank vind je publicaties van 26 hogescholen

De grootste kennisbank van het HBO

Inspiratie op jouw vakgebied

Vrij toegankelijk