STM32CubeWBA: Trace management

Revision as of 20:41, 21 March 2023 by Registered User (Escoda Michael moved page Connectivity:STM32CubeWBA System Modules/Trace management to Connectivity:STM32CubeWBA Trace management without leaving a redirect)


Under construction.png Coming soon
Info white.png Information
This page is not yet finished but will be soon.


1. Introduction

An application often needs to manage a system of trace for debug purpose or to communicate with another system (console, monitoring, …). The Advanced Trace is a simple module designed to provides all the trace services. This module has been designed with three major constraints:

  • Low impact on the real time execution.
  • No specific associated processing, the trace evacuations are managed in background.
  • Low footprint.

2. Concepts

The Advanced Trace is split into two layers:

Advanced Trace services
API that regroups all the services available for traces.
Trace Interface
Interface between the HW and the Advance Trace services layer.

2.1. Advanced Trace services

The advanced trace proposes some interesting features to users for Trace debugging or logging:

Trace FIFO management
The advanced trace module manages a circular FIFO - Size is customizable - to store all the application data before their push on the media. The module guarantees the data integrity and parallel access to the trace services.
  • Unchunk mode:
The “unchunk” mode is an optional mode which could be enabled inside the utilities’ configuration header. The goal of this mode is to guarantee that a frame is not split inside two transfers.
  • Timestamp management:
The timestamp management allows the user to add a timestamp buffer ahead of the frame to output.
However, user shall follow two steps:
  • User shall create a callback function that returns a time stamp buffer and its buffer size.
  • Use the adequate functions that allow timestamp management.
This mode can be activated within the utilities’ configuration header.
  • Verbose level and region management:
The Verbose Level and the Region are two different levels to determine whether a frame can be sent or not. If one of these two condition fails, the frame is discarded.
The Verbose Level
The user can define his own current verbose level. The default setup is 0 meaning only value frame with verbose level equal to zero are sent through the Advanced Trace. If the application verbose level is lower or equal to the current verbose level, the frame is sent else discarded.
The Region
The user can define his own region mask. The default setup is 0 meaning only application frame with region equal to zero are sent through the Advanced Trace. If the application region value is equal to zero or if value is aligned with the mask region, the frame is sent else discarded.
  • Overrun management:
This feature aims to indicate when frame has been discarded due to a FIFO full. The switch enabled is not enough to make it functional, the user shall provide a callback function which returns an overrun frame and the size of this frame.
This feature can be activated within the utilities’ configuration header.

2.2. Trace interface

The trace interface handles the HW interface. The only requirements for the HW are to provide characteristics such as:

  • Shall be able to send data (8-bit data).
  • Shall be able to receive data.

This hardware layer has been built to match with the UART but there is others’ HW IPs compatibles with these requirements: USB, I2C, SPI, etc. The choice shall be managed by the application designer according to the available resources and the application requirements.

3. Interfaces

TBD.

4. How to

TBD.