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.

Ipc_stop timeout

Other Parts Discussed in Thread: OMAP-L138

Hi, everyone. I am using messageQ in syslink_2_21_01_05  for communication between ARM and DSP in OMAP-L138

I customize my own program by modifying TI's example. (ex02_messageq). Eventually, I want to use it in real-time application, where ARM collect one set of data and send to DSP for calculating on one working cycle. So I think it is more efficient to separate App_create(), App_exec() and App_delete() function on ARM side. During initialization, App_create() is called. During working, App_exec() is called for handling the calculation, where one set of data is managed every time. And App_delete() is called when exiting. 

So here is the problem. When initialization, on DSP side, is it necessary to call Ipc_stop() at the end?

If it isn't necessary, it will warn that "Ipc_stop timeout - Ipc_stop not called by slave". What does the "Ipc_stop timeout" mean?

On the API Guide, it says:

  Ipc_stop():

        Resets the Ipc state.

       This function should be called only once and only after detaching from all processors. Once called, Ipc is placed           back to the same state as it was before Ipc_start() was called.

So there is no explanation for so-called "time out".

If it is necessary. As the guide says, Ipc_stop() will  place Ipc back to the same state as it was before Ipc_start() was called. So should I initialize Ipc again by using Ipc_start() and relative operation? 

Does anyone have an idea? Thank you!

 

  • Hi Chengyang,

    When you stop Syslink on the Arm side with:

        /* invoke the SysLink stop callback */
        status = Ipc_control(remoteProcId, Ipc_CONTROLCMD_STOPCALLBACK, NULL);

    this will try to attempt to synchronize with the shutting down on the DSP side.  Calling Ipc_stop() on the DSP side sets some variables in shared memory so the Arm side will know that it is safe to unmap memory regions used by the DSP. So the Arm side will wait for a timeout period, for the DSP to stop using shared resources.  By not calling Ipc_stop() on the DSP side, you will get that "Ipc_stop() not called by slave" warning.  After the timeout, the Arm side will continue on, unmapping the slave's shared memory regions.

    If you want to use Ipc again, then on the DSP side, you would need to call Ipc_start().

    Best regards,

        Janet

  • Thank you for your answer. There are still points unclear to me.

    First, as you say,  By not calling Ipc_stop() on the DSP side, you will get that "Ipc_stop() not called by slave" warning. So does it mean that when the DSP program is compiled, the compiler will check if the program can successfully run to Ipc_stop()? If not, then how the OMAP judge that Ipc_stop() is not called. I think all the instances is running in real time, so how OMAP can ensure that Ipc_stop will not be called later?

    Second, if I will continue using IPC in another function which only execute when get specific messages from ARM. Then should I call Ipc_stop() at the end of the current function? If I don't have to, I believe I will get the warning. Will it influence the program's running? ( As you say After the timeout, the Arm side will continue on, unmapping the slave's shared memory regions. Does it mean that after warning, ARM will still delete IPC? ) If I have to, then in THE another function mentioned above, should I configure the IPC again on DSP ?

    I am looking forward to your answer. Thank you.

  • Hi Chengyang,

    You get the warning about Ipc_stop() not being called from

        Ipc_control(remoteProcId, Ipc_CONTROLCMD_STOPCALLBACK, NULL);

    on the Arm, when you don't call Ipc_stop() on the DSP.  On the Arm side, the Ipc_control() call just waits for the DSP to clear a flag in shared memory.  Calling Ipc_stop() on the DSP side clears this flag.  Ipc_control(STOPCALLBACK) will wait for a timeout for this flag to be cleared.

    So, once you call Ipc_control(STOPCALLBACK) on the Arm, you must stop using Ipc on the DSP.  If you want to use Ipc at a later time, you can call Ipc_start() after the call to Ipc_stop(), and this will poll until you have called Ipc_control(STARTCALLBACK) on the Arm side.  For example, if you have a server running on the DSP, you can send a message from the Arm to the server, indicating you want to stop using Ipc.  When the server receives this message, it can execute this code:

        do {
            status = Ipc_detach(masterId);
        } while (status < 0);

        do {
            status = Ipc_stop();
        } while (status < 0);

        do {
            status = Ipc_start();
        } while (status < 0);

    This would allow you to use Ipc on the DSP when your function is called at a later time.  Another option, would be to not call Ipc_control(STOPCALLBACK) on the Arm.

    Best regards,

        Janet

  • Hi Janet.

    Thank you for your answer. After reading it, I checked my project carefully. unfortunately, I use NO Ipc_CONTROLCMD_STOPCALLBACK in  Ipc_control.

    As a result, I still cannot figure out my problem. What I want is building and initializing IPC between ARM and DSP in this project. So are there any other possibilities that I get this warning? Does it have a bed influence on the running of the project?

    Thank you again, and I am looking forward to your reply.

    janet said:
    Ipc_control

     

  • Hi Chengyang,

    You could try adding some print statements on the Arm side of your application to narrow down where this warning is coming from.  You could also start over with the messageQ example, and modify it in stages to see when the problem comes in.

    Best regards,

        Janet