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.

AM6412: 100% CPU > FreeRTOS

Genius 13655 points
Part Number: AM6412


Hello Champs,

Customer is using mcu_plus_sdk_am64x_09_01_00_41 and meets the same issue as below post on AM6412. Is there a similar patch for AM6412?
https://e2e.ti.com/support/processors-group/processors/f/processors-forum/1125099/processor-sdk-j721e-freertos-application-on-r5f-using-100-cpu-according-to-the-stats/4175167

Call the vTaskGetRunTimeStats,after some time, it will exceed 100% CPU usage:

Below is IDLE task CPU usage every 2s.



Thanks
Regards
Shine

  • Hello Champs,

    Any suggestions on this issue is appreciated.

    Thanks
    Regards
    Shine

  • Hello Shine,

    Thank you for reaching out to Texas Instruments E2E support forum.

    I have taken you inputs and working on it. Please allow some time to revert back.

    Regards,

    Tushar

  • Hello Shine,

    Apologies for the delayed response.

    Can you please share the sample code to reproduce the issue? 

    Regards,

    Tushar

  • Hello Tushar,

    Thank you very much.

    Customer said that the project was too big to share.  However, the test was built on TI demo: EXAMPLES_ENET_LWIP_CPSW 

    Thanks
    Regards
    Shine

  • Hello Shine,

    Thank you for the above information. 

    If sharing the project is not possible, can you please tell the appropriate code changes to achieve more than 100% CPU usage.

    Regards,

    Tushar

  • Hello Tushar,

    Thank you very much.



    void TaskIdle(void*v1,void *v2)
    {
        unsigned long idleTaskCounter=0;
        RTOS_log("goto idletask OK");
        while(1)
        {
            char *printlist = pvPortMalloc(2048);//[2048];
            if(printlist==NULL) {RTOS_log("error @pvPortMalloc\r\n"); continue;}
    
            if(idleTaskCounter%(8*4)==0)
            {
                RTOS_log("free/largest heap 2 = %d/%d i am a idletask...\r\n",
                __TI_heap_total_available(),__TI_heap_largest_available());
                //cpu
                RTOS_Log("CPU:\r\n");
                vTaskGetRunTimeStats(printlist);
                RTOS_Log("%s",printlist);
            }
            if(idleTaskCounter%(8*4)==4)
            {
                //task
                RTOS_Log("Task:\r\n");
                vTaskList (printlist);
                RTOS_Log("%s",printlist);
            }
    
            vTaskDelay(250);    //
            idleTaskCounter++;
            vPortFree(printlist);
        }
    }
    void TaskIdle_creat()
    {
        _TaskParams params;
        params.stackstr = NULL;         
        params.stackSize = 4096;
        params.taskname = "Task_Idle";   
    
        params.priority = 5;
        RTOS_TaskCreat(TaskIdle, &params, NULL);
    
    }


    Customer added above function to main.c


    Then continue to observe more than 4h, save the printed data, after making the graph should be found 

    Thanks
    Regards
    Shine

  • Hello Shine,

    Thank you for providing the details.

    I have imported the above changes to enet_lwip_cpsw_am64x_r5fss0-0_freertos example.

    Then continue to observe more than 4h, save the printed data, after making the graph should be found 

    I am running the test and trying to reproduce the issue at my end and will update you regarding the same.

    Thanks for your patience.

    Regards,

    Tushar

  • Hello Tushar,

    Okay.

    Thank you very much.

    Regards
    Shine

  • Hello Shine,

    Thanks for your patience.

    I have filed an internal Jira ticket for this issue. If you have any other queries please feel free to ask.

    Regards,

    Tushar