μC/OS-III 要求
configure and initialize a few things in your C project:
■ Make sure OS_CFG_DBG_EN is set to DEF_ENABLED
■ Make sure OS_CFG_STAT_TASK_EN is set to DEF_ENABLED
■ Make sure OS_CFG_TASK_PROFILE_EN is set to DEF_ENABLED
■ Make sure CPU_CFG_INT_DIS_MEAS_EN is set to DEF_ENABLED
■ You need to provide a timestamp timer which is used to measure delta timebetween events such as task execution time, CPU usage on a per-task basis, etc.
For ARM Cortex-M, we use the cycles counter and for Renesas RX, we typically use
CMT1. Ideally, they should be an 'UP' timer as fast as the CPU cycles but in some
cases could be in the few MHz range. Implementation details are typically found in
CPU_TS_TmrInit() and BSP_TS_TmrInit().
■ Call OSStatTaskCPUUsageInit() in the first task that starts (after BSP_Init() andCPU_Init())
■ Call CPU_IntDisMeasMaxCurReset() in the first task that starts (after BSP_Init()and CPU_Init())
■ Call OSStatReset() in the first task that starts (after BSP_Init() and CPU_Init())
■ Make sure optimization is set to LOW because the tools will remove unusedvariables which could be needed for debug