Configuring the Trace Recorder
Configuring the SystemView Trace Recorder
Configuration is performed through the addition of the following files:
(1) os_cfg_trace.h
From this file you can enable and disable the recording of the beginning and end of each of the µC/OS-II API function calls. If not enabled, the trace will only have interrupt events and the µC/OS-II 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:
#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
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:
#define BUFFER_SIZE_UP 4096u
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 .(3) 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:
#define SEGGER_SYSVIEW_RTT_BUFFER_SIZE 4096u
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 .
(4) SEGGER_SYSVIEW_Config_uCOSII.c
From this file you can configure the BSP function that returns the system clock in Hertz. For example:
#define SYSVIEW_TIMESTAMP_FREQ (BSP_ClkFreqGet(BSP_CLK_ID_SYSCLK)) #define SYSVIEW_CPU_FREQ (BSP_ClkFreqGet(BSP_CLK_ID_SYSCLK))
#define SYSVIEW_RAM_BASE (0x20000000)
static void _cbSendSystemDesc(void) { SEGGER_SYSVIEW_SendSysDesc("N="SYSVIEW_APP_NAME",D="SYSVIEW_DEVICE_NAME",O=uCOS-II"); 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(); }
SEGGER_SYSVIEW_Config_uCOSII.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.