AM2434: [AM2434] Synchronization Between Cores

Part Number: AM2434
Other Parts Discussed in Thread: SYSCONFIG

Tool/software:

Hi, 

I'm using the AM2434 EVM Board, I'm trying to synchronize the cores. I found that I can use the IpcNotify_syncAll, sendSync, and waitSync.
But there's a phase shift between cores. My use case is that I'm toggling two LEDs, one on each core. There's a delay every toggle that is different in each core, e.g. 1 second and 100 ms.
I used IpcNotify_syncAll to make the quick one wait for the slow one. And actually it does that.

The problem is there's a phase shift between the rising edges of the LEDs or the falling edges. That phase shift is not constant. It changes in every single edge.
The phase shift may vary between 15 micro-seconds up to 1 milli-second.

My questions are as following:

  • I need to understand why there's a phase shift like that.
  • How to eliminate that phase shift?
  • How does the sendSync and waitSync work? how do they exchange messages?

Thank you in advance.

  • Hi Salah, Information about IPC Notify can be found in MCU+SDK User Guide: AM243x MCU+ SDK: IPC Notify

    Mainly what IPC Notify example (AM243x MCU+ SDK: IPC Notify Echo) does is:

    • Initial core synchronization using IpcNotify_syncAll() to ensure all cores are ready before starting sending messages
    • Main core sends initial message to all cores participating
    • Remote cores message back
    • Uses semaphores for synchronization/completion 

    Coming back to your question on how IpcNotify_sendSync() and IpcNotify_waitSync() works.

    • IpcNotify_syncAll(): uses a 2-phase synchronization. First send sync signals to all enabled cores, then wait for all sync signal from all enabled cores
    • IpcNotify_sendSync(): Basically, implements a barrier synchronization by using IPC_NOTIFY_CLIENT_ID_SYNC in IpcNotify_sendMsg()

    int32_t IpcNotify_sendSync(uint32_t remoteCoreId)
    {
        return IpcNotify_sendMsg(remoteCoreId,
                    IPC_NOTIFY_CLIENT_ID_SYNC, /* Uses IPC_NOTIFY_CLIENT_ID_SYNC - a reserved client ID for sync operations */
                    0xFF, /* message value is dont care */
                    1 /* wait for messahe to be put in the HwFifo */
                    );
    }

    • IpcNotify_waitSync(): Basically, waits for a sync message from the specified remote core and returns when sync notification is received or timeout occurs

    I am not sure about how the phase is shifted, I am guessing you mean a delay?, if so, during synchronization latency will depends on time other core(s) respond. Please let me know if I misunderstood the issue. Also, if you can elaborate a bit more what you are trying to achieve (two LEDs in two different cores in blinking in sync? or something else?) it would be great.

    thank you,

    Paula

  • Hello, Paula,

    What I'm trying to do is - as you said - two LEDs in two different cores blinking in sync.
    And my problem is that they are not really in sync. and there are small delays between the LEDs. The delays are in micro-seconds and milli-seconds.

    I'm not really sure if that's a synchronization problem or it's a problem with the Timer somehow.
    So, for now, here are my questions:

    - Are the IpcNotify_sendSync, and IpcNotify_waitSync APIs a Software IPC mechanisms, or a Hardware IPC mechanisms?
    - Do those APIs use HW interrupt or not?

    - Regarding Timers, I see that the board can go up to 800MHz. How to achieve that? from sysconfig I can choose the MCU_HFOCS0 but it gives only 25MHz as I suppose. Maybe the delay I mentioned before is happening because of the timer or something. So, it would be helpful if you tell me how to get the 800MHz on the board for a single timer.

    Please tell me if you need more explanation for my problem.
    And thank you in advance for your help.