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_start() call in main fails with error Hwi already defined

Other Parts Discussed in Thread: SYSBIOS

I am developing on a EVMK2X eval board (advantech XTCIEVMK2X), using Bios 6.35.04.50, IPC 3.00.03.28. I have configured and tested the interrupt setup and edma using ti/sysbios/family/c66/tci66xx/Cpintc and it works fine. I also have tested the messageq functionality and IPC. After combinig the two, the call to Ipc_start() fails with

ti.sysbios.family.c64p.Hwi: line 188: E_alreadyDefined: Hwi already defined: intr# 5 xdc.runtime.Error.raise: terminating execution

I am indeed using the irq5 for my edma completion when I set up my events and interrupt.

When I changed the interrupt to irq6, the error goes away! Is Ipc_start() assuming/setup to use irq5 internally? Is this documented somewhere?

Regards

  • Hi,

    The interrupt (nIRQ) and the priority of the interrupt inputs are programmable.

    The main purpose of the Ipc module is to initialize the various subsystems of IPC.
    All applications that use IPC modules must call the Ipc_start() API.

    Where you changed the IRQ, is it cfg file or source code file

  • As I mentioned above:

    "I have configured and tested the interrupt setup and edma using ti/sysbios/family/c66/tci66xx/Cpintc"

    meaning I setup an interrupt using Cpintc calling

    Hwi_create(5, (Hwi_FuncPtr)&CpIntc_dispatch, &hwiParams, &eb);

    which I intend to use for edma completion interrupt.

    I then call Ipc-start() to prepare for mesageQ use. It then get the above error.

    If I go back and change the interrupt to "6" and no error is posted.

    I also tried to call Hwi_create() after Ipc_start() in main() as well as a task. Same outcome.

    Thanks

     

  • Hi,

    Check the vectorID for particular event in the Cpintc or CIC guide.

  • I am not sure what is the meaning of

    "Check the vectorID for particular event in the Cpintc or CIC guide."

    Would someone look into this. It has been more than a week and no answer yet.

  • Hi,

    The interrupt vector id is 5 or 6 given by you, it’s working for without IPC. But is not working with 5 for when use IPC.
    If you are configuring through C file, need to get the interrupt vector for the particular event.
    Apologize for misunderstanding, find the more info in this wiki for how to config interrupts.
    http://processors.wiki.ti.com/index.php/Configuring_Interrupts_on_Keystone_Devices

  • I will re state the problem:

    -I am able to correctly setup an interrupt for edma completion using vector 5 or 6.

    Problem:

    -When I integrate IPC code where I call "Ipc_start()" and using the vector # 5, the IPC crashes with the

    error I posted.

    If I choose vector 6 instead of 5, no error is posted.

     

  • Hi,

    There is no document for vector id use of IPC. But it may be how we are using the IPC in the application.

    Should be able to use the 5 or 6 id. When use IPC module through XDCtools configuration file,
    var Ipc = xdc.useModule('ti.sdo.ipc.Ipc');
    Then you need to give the synchronize call in the cfg file.
    Ipc.procSync = Ipc.ProcSync_ALL;

  • Hello Shervin,

    Could you please attach the project with the failure?

    regards,

    David

  • Hi,

    I am afraid I can not send any projects. I have cut the sequence of calls that I am making.

    Please note that Ipc_start() and multicore communication works.

    The Interruot 5 used a edma completion interrupt also works fine.

    when combining the two I get an error message:

    ti.sysbios.family.c64p.Hwi: line 188: E_alreadyDefined: Hwi already defined: intr# 5
    xdc.runtime.Error.raise: terminating execution

    here is my code setting up the interrupt and mapping the events:

     

    CpIntc_mapSysIntToHostInt(0, EDMA3CC0_CC_GINT, HOST_INT_CIC0_OUT32_CORE0_ONLY);

    CpIntc_dispatchPlug(EDMA3CC0_CC_GINT, EDMAIsr, EDMA3CC0_CC_GINT, TRUE); CpIntc_enableHostInt(0, HOST_INT_CIC0_OUT32_CORE0_ONLY);

    eventId = CpIntc_getEventId(HOST_INT_CIC0_OUT32_CORE0_ONLY);

    Hwi_Params_init(&hwiParams);

    /* host interrupt 32 (HOST_INT_CIC0_OUT32_CORE0_ONLY)(core0 only) */ hwiParams.arg = HOST_INT_CIC0_OUT32_CORE0_ONLY;

    /* event ID corresponding to the host interrupt */ hwiParams.eventId = eventId; hwiParams.enableInt = TRUE;

    hHwi_5 = Hwi_create(5, (Hwi_FuncPtr)&CpIntc_dispatch, &hwiParams, &eb);

    Hwi_enableInterrupt(5);

    once the call to Ipc_start() is made the error occures.

    I can also switch the order of Ipc_start() and interrupt setup and same error happens.

    debugging into some calls indeedt the error "E_alreadyDefined" can be seen.

    the .cfg that I use seems adequate for each case but not both!

    Thanks

    Shervin

     

     

  • Shervin,

    Please double check the HWI configuration once again, the below code for your reference only.
    You can modify this code for according your requirement.

    Hwi_Params_init(&hwiparams5);
    hwiparams5.arg=0;
    hwiparams5.eventId=60;

    Hwi5=Hwi_create(5, Hwi_isr5, &hwiparams5, &eb);

    Hwi_Params_init(&hwiparams6);
    hwiparams6.arg=0;
    hwiparams6.eventId=61;

    Hwi6=Hwi_create(6, Hwi_isr6, &hwiparams6, &eb);

    It may be any hard-coded interrupt assignments for the EDMA.
    After run it and check the RTOS Object View for HWI and see what HWI are defined.

    There's a simple example to configure a HWI as IPC-Interrupt:
    http://e2e.ti.com/support/dsp/c6000_multi-core_dsps/f/639/p/187011/849689.aspx#849689