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.

SYS/BIOS, OMAP-L138 experimenter kit, ARM9, UART2 interrupt isn't triggering

Other Parts Discussed in Thread: SYSBIOS

Hello,

I am trying to trigger UART2 interrupt in SYS/BIOS. I see in debug mode that when it receives data the IPEND bit is set to 0 and RBR/THR register receives proper data but the registered interrupt doesn't want to trigger. Do I need anything more than this code for configuring interrupt?

#include <ti/sysbios/family/arm/da830/Hwi.h>

xdc_Void myIsr(xdc_UArg arg)
{
Hwi_beginIRQ();
System_printf("\r\nInterrupt");
Hwi_endIRQ();
}
int main()
{
Hwi_Params hwiParams;
Hwi_Handle myHwi;
Error_Block eb;
Error_init(&eb);
Hwi_Params_init(&hwiParams);
hwiParams.eventId = 61;
 hwiParams.enableInt = true;
	myHwi = Hwi_create(2, (ti_sysbios_interfaces_IHwi_FuncPtr)myIsr, &hwiParams, &eb);
if (myHwi == NULL)
System_abort("Hwi create failed");
Hwi_enableIRQ();
(...) //some task creation with System_flush() and task_sleep
 BIOS_start(); 
}

Of course UART2 is configured as well for triggering interrupts. 
  • Hi,

    Are you using any of the BIOSPSP?

    If not, please visit the link  http://software-dl.ti.com/dsps/dsps_public_sw/psp/BIOSPSP/index.html to download the BIOSPSP. You can refer the UART drivers available in the PSP to get more insight on the implementation   

    Thanks and Regards,

    Sandeep K

  • Hello Sandeep,

    I have checked those drivers and I have found following function:

    static Void uartRegisterInterrupt(Ptr                   inDevp,
    Uint32 hwiNumber,
    Uint16 evt,
    Uart_pspUartIsr intIsr)
    {
    static Uint32 key = 0;
    Uart_Object *instHandle = NULL ;
    ECM_Attrs ecmattrs = ECM_ATTRS;

    assert((NULL != intIsr) && (NULL != inDevp));

    instHandle = (Uart_Object *)inDevp;

    assert(NULL != instHandle);

    key = (Uint32)_disable_interrupts();

    /*Enable the interrupt later */
    ecmattrs.unmask = 0u;

    /*setup arg such that isr will get 'chan' as arg */
    ecmattrs.arg = (Arg)instHandle;

    /* Plug the ISR with interrupt (event) number */
    ECM_dispatchPlug(evt, (ECM_Fxn)intIsr, &ecmattrs);

    /* Enabling the event */
    ECM_enableEvent(evt);

    /* Enabling the HWI_ID where corresponding ECM group is configured */
    C64_enableIER(1 << hwiNumber);

    /* Enabling the interrupts */
    _restore_interrupts(key);
    }
    
    
    I didn't found any information about API that it's using. 
    Is it compatible with SYS/BIOS as well or only with older version? 

    added later:

    OK I have found some information about this API in 

    TMS320C6000 DSP/BIOS 5.x Application Programming Interface (API)

    Reference Guide but I using SYS/BIOS and ARM core.

    So am I doing something wrong when I am registering the

    UART2 interrupt in SYS/BIOS or this is not the way? And can

    I use this API to SYS/BIOS on ARM core?

  • Hello,

    Today I have figured out why the interrupt doesn't want to trigger.

    I should pass the the interrupt number which comes from the hardware

    specification to function  Hwi_create instead of hwiParams.eventId.

  • You should NOT be using the Hwi_beginIRQ() and Hwi_endIRQ() APIs in your ISR handler!

    These convenience APIs are provided for interrupts that do NOT use the SYS/BIOS interrupt dispatcher. All interrupts defined using Hwi.create() or Hwi_create() use the dispatcher.

    Also, you should NOT invoke Hwi_enableIRQ() in main().

    SYS/BIOS enables IRQs within the call to BIOS_start().

    Enabling interrupts in main() prior to BIOS_start() can cause unpredictable behavior.

    Alan

  • Thank you for your information. 

    Can I ask you how is possible to create a interrupt function which doesn't use the dispatcher? 

    I was thinking that zero latency interrupts (with priority = 0) created by the Hwi_create aren't

    using the dispatcher.

    I am not using Hwi_enableIRQ() in main. This code snipped show all things that

    [just-in-case] I tested for trying to make UART2 INT work.

  • Using a priority of ZERO when creating a Hwi object will map the interrupt to FIQ rather than IRQ.

    FIQs are never disabled by SYS/BIOS. Consequently, these interrupts should have zero latency.

    FIQs are never ENABLED by SYS/BIOS either, so that step must be performed by the user's application by invoking Hwi_enableFIQ().

    Alan

  • Alan,

    Thanks for confirming my conjecture.