Configuring the Trace Recorder#

os_cfg.h#

From this file, you can enable and disable the trace recorder.

Listing - os_cfg.h#
#define OS_CFG_TRACE_EN                   DEF_ENABLED

os_trace_cfg.h#

From this file, you can enable and disable the recording of the beginning and end of each of the Micrium OS Kernel API function calls. If not enabled, the trace will only have interrupt events and the Micrium OS Kernel scheduler events.

You can also configure the maximum number of tasks and other kernel objects to include in the trace. The code below shows an example:

Listing - os_cfg_trace.h#
#define OS_CFG_TRACE_API_ENTER_EN         DEF_ENABLED

#define OS_CFG_TRACE_API_EXIT_EN          DEF_ENABLED

#define OS_CFG_TRACE_MAX_TASK                  32u

#define OS_CFG_TRACE_MAX_RESOURCES            256u

SEGGER_RTT_Conf.h#

From this file, you can configure the maximum number of bytes for the ring buffer used to stream the trace data up to the host application running on the PC. Low numbers will result in less data footprint at the expense of possible dropped events due to overflows during the communication. The code below shows an example:

Listing - SEGGER_RTT_Conf.h#
#define BUFFER_SIZE_UP                       4096u

Note: The file SEGGER_RTT_Conf.h contains other settings that are beyond the scope of this document. For more information on this configuration file refer to the SEGGER SystemView Documentation.

SEGGER_SYSVIEW_Conf.h#

From this file, you can configure the maximum number of bytes for the ring buffer used to stream the trace data up to the host application running on the PC. Low numbers will result in less data footprint at the expense of possible dropped events due to overflows during the communication. The code below shows an example:

Listing - SEGGER_SYSVIEW_Conf.h#
#define SEGGER_SYSVIEW_RTT_BUFFER_SIZE       4096u

From this file you also get to configure the way the trace recorder will get a system timestamp and the currently active interrupt ID. This file already has that implemented for the ARM Cortex-M devices. If your device is not an ARM Cortex-M, then this is the place to configure those two things.

Note: The file SEGGER_SYSVIEW_Conf.h contains other settings that are beyond the scope of this document. For more information on this configuration file refer to the SEGGER SystemView Documentation.

SEGGER_SYSVIEW_Config_MicriumOSKernel.c#

From this file, you can configure the BSP function that returns the system clock in Hertz. For example:

Listing - SEGGER_SYSVIEW_Config_MicriumOSKernel.c - System Clock#
#define SYSVIEW_TIMESTAMP_FREQ (CPU_TS_TmrFreqGet(&local_err))

#define SYSVIEW_CPU_FREQ       (CPU_TS_TmrFreqGet(&local_err))

From this file you also get to configure the lowest RAM address where you intend to allocate the Trace buffer. For example:

Listing - SEGGER_SYSVIEW_Config_MicriumOSKernel.c - RAM Base Address#
#define SYSVIEW_RAM_BASE                  (0x20000000)

And finally, from this file you get to register each of the interrupts you are interested in. By default, the interrupts will be displayed in the Analyzer with their vector number only. So, if you want to specify a name for the interrupts, then you can do so from this file. For example:

Listing - SEGGER_SYSVIEW_Config_MicriumOSKernel.c - Interrupt Names#
static void _cbSendSystemDesc(void) {

    SEGGER_SYSVIEW_SendSysDesc("N="SYSVIEW_APP_NAME",D="SYSVIEW_DEVICE_NAME",O=Micrium OS Kernel");

    SEGGER_SYSVIEW_SendSysDesc("I#15=SysTick ISR");

    SEGGER_SYSVIEW_SendSysDesc("I#77=Ethernet ISR");

    SEGGER_SYSVIEW_SendSysDesc("I#83=USB OTG FS ISR");

    SEGGER_SYSVIEW_SendSysDesc("I#104=LCD TFT ISR");

    //

    SYSVIEW_SendResourceList();

}

Note: The file SEGGER_SYSVIEW_Config_MicriumOSKernel.h contains other settings that are beyond the scope of this document. For more information on this configuration file refer to the SEGGER SystemView Documentation.