This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

PROCESSOR-SDK-AM64X: AM64x MCU+ SDK FreeRTOS main task priority prevents clock operation

Part Number: PROCESSOR-SDK-AM64X

Hi,

in the mcu_plus_sdk_am64x_08_00_00_21code examples the FreeRTOS main task has the same maximum priority as the clock task:

FreeRTOSConfig.h: #define configTIMER_TASK_PRIORITY               (configMAX_PRIORITIES - 1)

C:\ti\mcu_plus_sdk_am64x_08_00_00_21\*\r5fss0-0_freertos\main.c: #define MAIN_TASK_PRI  (configMAX_PRIORITIES-1)

This prevents that clock objects can tick as long as the main task is busy (clock task cannot become active). I am not sure if this is good practice to run the main task with maximum priority. With reduced priority, e.g.

#define MAIN_TASK_PRI  (configMAX_PRIORITIES-2)

the clocks work fine.

Thanks & regards,

Frank

From C:/ti/mcu_plus_sdk_am64x_08_00_00_21/docs/api_guide_am64x/KERNEL_DPL_CLOCK_PAGE.html:

ClockP_Params clockParams;
ClockP_Object clockObj;
ClockP_Params_init(&clockParams);
clockParams.timeout = ClockP_usecToTicks(100*1000);
clockParams.period = clockParams.timeout;
clockParams.start = 1;
clockParams.callback = myClockCallback;
clockParams.args = &gPeriodicCount; /* pass address of counter which is incremented in the callback */
ClockP_construct(&clockObj, &clockParams);
  • Hi Frank,

    Good catch! You are correct! If the main task is in a infinite loop, then the Timer task will never start.

    On the other hand, in FreeRTOS situation, usually the main task is used to initialize the board and create the application tasks and then delete itself. 

    I will report this with the software team.

    Thanks!

    Ming