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.

Swi_post

Other Parts Discussed in Thread: SYSBIOS

Hello,

do you have any clues why Swi_post returns such error :

argument of type "void (*)(void)" is incompatible with parameter of type "ti_sysbios_knl_Swi_Handle"

 It is written in documentation  that argument of Swi_post function should be a handler to swi function. I'm completely new to DSP ans SYS/BIOS system so any help would be very appreciated. 

There is part of code below:

void ledswi(void)
{
	Log_info0("obsluga swi\n");

}

void migacz(void)
{
	Log_info0("obsluga hwi\n");
	Swi_post(&ledswi);


}

"migacz" is my basic HWI function and "ledswi" is my SWI function.

  • Hi,

    You need to pass in the Swi_Handle that you want to post, not the function pointer. The handle is returned from the Swi create function.

    Where did you create the Swi (statically in the .cfg file or dynamically via the Swi_create() API)?

    If it was dynamically, Swi_create() returns the handle.

    If it was statically, you specify the variable name in the graphical tool. Then make sure in include <xdc/cfg/global.h> in the file that calls Swi_post() (and simply use the handle variable in the Swi_post()).

    Todd

  • I created my SWI by using GUI panel also I included global.h header as you said but still no luck. I'm getting the same error.  Swi_post call has changed too, now it looks like this :

    Swi_post(ledswi)

    Can you check this part of code ?  I wonder if i miss something here ?

    #include <xdc/std.h>
    
    #include <xdc/runtime/Error.h>
    #include <xdc/runtime/System.h>
    #include <xdc/runtime/Log.h>
    #include <xdc/cfg/global.h>
    
    
    #include <ti/sysbios/BIOS.h>
    #include <ti/sysbios/knl/Task.h>
    #include <ti/sysbios/knl/Swi.h>
    
    
    #include <ti/uia/events/UIAEvt.h>
    #include <ti/uia/events/UIAErr.h>
    #include <ti/uia/events/UIAStatistic.h>
    
    
    #include <csl_tmr.h>
    #include <stdio.h>
    #include <csl_intc.h>
    #include <soc.h>
    #include <csl_intcAux.h>
    #include <cslr_dev.h>
    #include <stdlib.h>
    #include <string.h>
    

    Thanks for your time.

  • What is the handle name you specified? For example, below I created a Swi call swi0. The function is swi0Fxn.

    The call to post the Swi is as follows:

    #include <ti/sysbios/knl/Swi.h>
    #include <xdc/cfg/global.h>
    ...
        Swi_post(swi0);

  • It looks the same to me. My SWI functions is called "ledswi".

  • You need to call

    Swi_post(swi0);

    not

    Swi_post(ledswi);

  • Hah, shame on me ! This shows that  there are many things I have to learn. 

    Anyway thank you very much for your support ! You're great !