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.

posting a SWI inside an IPC function callback

hello again,

i wrote a program for EVM6474 with CCS4 where two cores (master and slave) are exchanging IPC events.

I post a "processing SWI" inside the callback function registered to the IPC event in the slave core. But the problem is the program does not switch immediately to the "processing SWI", and it continue the execution of the "callback function" instead. Then it executes the "processing SWI".

that creates for me a synchronization problem since i need to switch immediately to "processing SWI". I gave it the a priority "15" even "30", but in vain.

any way to make "processing SWI" preempt the callback function?

regards.

 

  • mohammed maktite said:
    any way to make "processing SWI" preempt the callback function?

    Hi Mohammed,

    What do you mean by a "processing SWI"?  Are you calling Swi_post() from within you Notify callback function and are you wondering why the Swi does not execute right away? Since the Notify callback function is called at ISR/Hwi-level, there is no way a Swi could preempt the callback function (no matter what its priority is).

    I'd like to better understand your use case--what are you trying to get done in your Swi and why does it cause a synchronization problem?

    Regards,

    Shreyas

  • thanks shreyas,

    I was calling SWI_post() to post the swi from within the notify callback function.

    The synchronization problem was that i wanted the SWI to be done before sending back an IPC (in the very bottom of the notify callback function) telling that the processing was done. In the same time, i prefer not to put the processing inside the callback function (HWI). So that's the dilemma.

    the synchronization problem take place because the IPC sent back to the master is sent before the processing is done. Since i want the master to send the processed data to the distant DSP through SRIO. So when the master try to send the data, he finds that the memory portion is still in use by the slave (processing core).

    core0 master                                                             core1    slave                                                  DSP2

    send notification --------------------------------------> begin process(post SWI)

                                                                                             |

                                                                                             |

                                                                                        end process

                                <------------------------------------   send notification

             |

    send data      -------------------------------------------------------------------------------------------------------->

    i think i'll remove the instruction sending back the notification to master from the HWI, and i'll put it in a swi with a priority lower than the processing SWI

    regards.