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.

CCS/AM3359: HWI misses

Part Number: AM3359
Other Parts Discussed in Thread: SYSBIOS

Tool/software: Code Composer Studio

Hello Experts,

We are using AM3359 with below STK.

processor_sdk_rtos_am335x_3_00_00_04

pdk_am335x_1_0_3

NDK 2.24.3.35

SYS/BIOS 6.45.1.29

Running sample project "NIMU_BasicExample" is OK. After adding HWI task which is called every 10us, we notice HWI does not occur every 10us. Mostly we lost one event per 100 HWI events. HWI ISR is very short which just increments a counter. This is not occurred when halting NDK task. The number of HWI instance is only one.

Could you give me some considerations about the root cause of this phenomenon?

Regards, Uchikoshi

  • The RTOS team have been notified. They will respond here.
  • Hi Uchikoshi,

    NDK internal has HWI interrupt triggered by received Ethernet packet in EMAC. Have you tried different Hwi priority to see if your HWI still misses?

    software-dl.ti.com/.../Hwi.html

    Regards,
    Garrett
  • Hi Garrett,

    We set HWI priority to 8 but miss some HWIs. If there is no other method, we have to consider other way.

    thanks,
    Uchikoshi
  • Hello,

    To simply, I added below code into "NIMU_BasicExample" .

       Clock_Params_init(&clkParams);

       clkParams.startFlag = TRUE;

       clkParams.period = 1;  //  clock ticks = 100us in .cfg file, SWI priority is set to 15.

       Clock_create(clk0Fxn, 2, &clkParams, NULL);

    Void clk0Fxn(UArg arg0)

    {

       /* Toggle LED1 */

       GPIO_toggle(USER_LED1);

    }

    Hardware is BeagleBoneBlack. No Ethernet cable is connected on RJ45.

    Below is the capture of toggle waveform.

    Is there any way to prevent from missing swi isr with NDK?

    Regards,

    Uchikoshi

  • Uchikoshi-san,

    Can you enable TI RTOS system analyzer trace by adding logging into your RTOS configuration:

    var LoggingSetup = xdc.useModule('ti.uia.sysbios.LoggingSetup');
    LoggingSetup.loadLogging = true;
    LoggingSetup.loadLoggerSize = 1024;
    LoggingSetup.mainLoggerSize = 32768;
    LoggingSetup.sysbiosLoggerSize = 32768;
    LoggingSetup.sysbiosSwiLogging = true;
    LoggingSetup.sysbiosHwiLogging = true;
    LoggingSetup.sysbiosSemaphoreLogging = true;
    LoggingSetup.loadTaskLogging = true;
    LoggingSetup.loadSwiLogging = true;
    LoggingSetup.loadHwiLogging = true;
    LoggingSetup.enableTaskProfiler = true;
    LoggingSetup.sysbiosHwiLoggingRuntimeControl = true;
    LoggingSetup.sysbiosSwiLoggingRuntimeControl = true;
    LoggingSetup.eventUploadMode = LoggingSetup.UploadMode_JTAGSTOPMODE;
    

    You can then look at the Execution graph in system analyzer to see if you can catch the HWI and SWI and correlate why this occurs in the system.

    Also note, SWI have lower priority to HWI in the system so ensure no other HWI can pre-empt the SWI.

    Regards,

    Rahul

    PS: Logging setup tools wiki:

    http://processors.wiki.ti.com/index.php/UIA_2.0_LoggingSetup 

  • Hello Rahul,

    I captured system execution graph. NDK task ndk_config_Global_stackThread() runs every 200us and it seems to prevent HWI from executing. 

    execution.zip

    Could you please check attached fog file and confirm if this is unavildable phenomenon in case of NDK.

    If you need more information, please let me know.

    Regards,

    Uchikoshi  

  • Uchikoshi-san,

    If you look at the system analyzer graph, there appears to be a semaphore post and pend that correlates with the time in which the system doesn`t respond to HWIs. HWI and SWI are meant to run to completion and shouldn`t pend on any semaphore. Semaphores are only recommended to be used in tasks. Can you check which thread in the system is posting the semaphore that may be preventing the system from not responding to HWI triggers.

    Regardss,
    Rahul
  • It would be useful to see the zoomed in picture where the global_stack task is running. So basically have this zoomed in (along with the X-axis units).

    Are there other times when global_stack runs and it does not cause the issue.

    Note: the bin file is not very useful without the .out *, .uia.xml, and *rta.xml files.

    Todd

  • Hi Rahul, Todd

     

    Thank you for your advice.

    To simplify it, I just ran the NIMU_BasicExample in PDK as-is and turned on UIA for log. Can you see attached file?

     

    nimu_bbbam335x_xa8fg.uia.zip

    processor_sdk_rtos_am335x_3_00_00_04

    pdk_am335x_1_0_3

    NDK 2.24.3.35

    SYS/BIOS 6.45.1.29

    UIA 2.0.6.52

     

    It looks like that ti_sysbios_knl_Clock_workFunc__E() posts semaphore. This is not every time and only before execution of ti_ndk_config_Global_stackThread().

     

    I appreciate any of your advice.

     

    Regards,

    Uchikoshi