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.

Notify callback called multiple times

Hello all,

C6678 EVM

bios_6_35_04_50

pdk_C6678_1_1_2_6

xdctools_3_25_03_72

I have 5 cores (cores 0, 1, 2, 3, 4) enables in my project and core0 can be used to notify cores1,2,3,4 based on a timer.

for this test, core 0 is set to notify core 1 only using:

Notify_sendEvent(1, INTERRUPT_LINE, INBOUND_MONITORING_EVENTID, rssiBuff[rssiWrIndex], TRUE);

 

and core 1 registered the notify as follows:

status = Notify_registerEventSingle(0, INTERRUPT_LINE, INBOUND_MONITORING_EVENTID, (Notify_FnNotifyCbck)monitoring_cbFxn, NULL);

all other cores (2, 3, 4) are using the same above line to register the notify.

 

PROBLEM: Core 1 get called 4 times for every time core 0 sends an even (Notify_sendEven(1,...)) ????

 

When I built the project using only cores 0 and 1, core 1 get notified only once per core 0 send event (desired).

 

Why core 1 get notified 4 times eventhough core 0 is calling core 1 only once?

 

Regards,

 

Murad

 

 

  • Also, I tried using status = Notify_registerEventSingle(0, INTERRUPT_LINE, INBOUND_MONITORING_EVENTID, (Notify_FnNotifyCbck)monitoring_cbFxn, NULL);

    but I got the following error:

    [C66xx_1] Notify_registerEvent failed
  • Hi Murad,

    Would you please give information like whether you observed this in the TI released package? If yes, please provide the name of the example, package name and version; So that we can try from our end and try to reproduce it.

  • Hello Shankari,
    I listed the info about my project at the beginning of this post...unfortunately, I can't share the project but as I said, we have 5 cores communicate in a star topology where core 0 sends a Notify to a selected core 1, 2, 3, or 4...when a core receives a Notify, it updates a counter and posts a SWI and return...what we noticed is that the counter increments 4 times and the SWI is called once per core0 Notify...when I disabled the other cores and only used core0 and core1, counter incremented only once.

    What other information do you need?

    Regards,

    Murad
  • Hello Shankari,
    When I move the commented code below (rssiWrIndex++;) to inside the SWI_ISR, the counter only increments once...this means that the Notify callback is called 4 times while the SWI is only executed once...how can you explain that?...(Remember, core0 is only calling Notify_sendEvent() once!!!)...is it because Notify is HWI and the repeat of 4 times happens too fast that the SWI only get executed after the 4th callback.

    Void monitoring_cbFxn(UInt16 procId, UInt16 lineId,
    UInt32 eventId, UArg arg, UInt32 payload)
    {

    notifyPayload = payload;

    // rssiWrIndex++;

    Swi_post(DSP_wrapper_swi);

    }

    Regards,

    Murad
  • Murad

    Before we continue let's do the following experiment

    Run the example with core 0, 1 and 2 enabled and see how many times the call-back is called,

    and then repeat it with core 0,1,2, and 3

    And report the results back to this e2e posting

    Ran

  • Hello Ran,
    When I enable only cores 0 and 1, core 1 call back is only called once...if I enable cores 0, 1, 2...core 1 call back is called twice...and so on...core 1 callback is called n-1 where n is the total number of cores enabled!?!?!?!?!?
  • My guess is that somehow all the call backs are directed into core 1. Can you look again at the code and see if there is a typo that directs all the call back to core 1?

    Ran
  • Thanks Ran,
    I was thinking the same...maybe each core retransmit the Notify to all other cores, but nothing in the code states that. The Notify implementation in our project is very straightforward:
    -All core synchronize all processors using: Ipc.procSync = Ipc.ProcSync_ALL;
    -All cores call: Ipc_start();
    -core 0 Notify core 1 using: Notify_sendEvent(1, 0, 10, count, TRUE);
    -cores1,2,3,4 register Notify callback using:
    Notify_registerEvent(0, 0, 10, (Notify_FnNotifyCbck)monitoring_cbFxn, NULL);
    -The callback is given above...simply get the payload, increment a counter, and post a SWI


    Regards,

    Murad
  • I am not sure.

    try to change the order and make sure that you do not send event before the other cores finish registering the call back

    Ran
  • Actually, to avoid such scenario, I added the following to the .cfg file:

    var fxn = new Ipc.UserFxn;
    fxn.attach = '&NotifyAttachFxn';
    fxn.detach = '&NotifyDetachFxn';
    Ipc.addUserFxn(fxn, 0x0);

    and used the callbacks to call "Notify_registerEvent(...)"

    So, I really don't know why the multi calls to the callback!?!?


    Regards,

    Murad