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.

RTOS/AM3352: SWI example

Part Number: AM3352

Tool/software: TI-RTOS

Dear Champs,

I'm trying to develop SWI example on AM335x RTOS and I found SWI was not generated even after SWI_post().

Could you please help to debug this issue?

Especially I'm wondering how I can pass SWI_Handle into swi_post() when I created SWI in the cfg file, and I used 'extern' in the C code as below, but I'm not sure.

in main.c:

extern Swi_Handle LEDSwi;

Void taskFxn(UArg a0, UArg a1)
{
System_printf("enter taskFxn()\n");

Task_sleep(10);
//Hwi_post(5);
Swi_post(LEDSwi);
System_printf("exit taskFxn()\n");
}

in app.cfg:

var swi0Params = new Swi.Params();
swi0Params.instance.name = "LEDSwi";
swi0Params.priority = 1;
Program.global.LEDSwi = Swi.create("&mySwiFxn", swi0Params);
LoggingSetup.sysbiosSwiLogging = true;

I uploaded full sources in below.

test_swi.zip

Thanks and Best Regards,

SI.

  • The RTOS team have been notified. They will respond here.
  • I realized SWI was generated only 1 time, and thus I modified my source to have SWI_post in the HWI in below.

    test_Swi2.zip

    But, SWI was not generated in this case, and the result is as below.

    in above SysMin buffer, middle '0' should be changed whenever SWI was generated as I increased counter as below.

    Please let me know how I can resolve this issue and successfully generate SWI.

    Void myHwiFxn(UArg arg)
    {
    Hwi_clearInterrupt(5);
    counter++;
    Swi_post(LEDSwi);
    System_printf("%d, %d, %d Hwi_interrupt!\n", counter, counter2, counter3);
    AppDelay(DELAY_VALUE);
    AppDelay(DELAY_VALUE);
    AppDelay(DELAY_VALUE);
    AppDelay(DELAY_VALUE);
    }

    Void mySwiFxn(UArg arg)
    {
    counter2++;
    System_printf("%d Swi_interrupt!\n", counter2);
    AppDelay(DELAY_VALUE);
    AppDelay(DELAY_VALUE);
    AppDelay(DELAY_VALUE);
    AppDelay(DELAY_VALUE);
    }

    Thanks and Best Regards,

    SI.

  • Hi,

    I resolved this. I seemed there was no time gap for SWI to be active.
    When I used timer, this issue was resolved.

    Thanks and Best Regards,
    SI.