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.

Unable to configure the interrupt for GPIO input pin

Other Parts Discussed in Thread: SYSBIOS

I wan to configure interrupt for GPIO0_7, GPIO2_11,GPIO2_13 pins as input for beaglebone. but the following code returns the error like when an interrupt comes,

[CortxA8] ti.sysbios.family.arm.a8.intcps.Hwi: line 946: E_undefined: Hwi undefined, intnum: 32
xdc.runtime.Error.raise: terminating execution
/* intnum 32 is SYS_INT_GPIOINT2A*/

[CortxA8] ti.sysbios.family.arm.a8.intcps.Hwi: line 946: E_undefined: Hwi undefined, intnum: 33
xdc.runtime.Error.raise: terminating execution

/*intnum 33 is SYS_INT_GPIOINT2B*/

But I could able to read GPIO's well, problem is interrupt not coming. please find the following code for reference

    GPIO0ClkConfig();

    GPIO2ClkConfig();

    IntAINTCInit();

    IntMasterIRQEnable();



    GPIOModuleEnable(SOC_GPIO_2_REGS);
    GPIOModuleEnable(SOC_GPIO_0_REGS);

    GPIOModuleReset(SOC_GPIO_0_REGS);
    GPIOModuleReset(SOC_GPIO_2_REGS);


    //GPIODirModeSet(baseAddr, pinNum, gpioPinConfig->dir);
    GPIODirModeSet(SOC_GPIO_0_REGS, 7, GPIO_DIR_INPUT);
    GPIODirModeSet(SOC_GPIO_2_REGS,11, GPIO_DIR_INPUT);
    GPIODirModeSet(SOC_GPIO_2_REGS,13, GPIO_DIR_INPUT);

    GPIODebounceFuncControl(SOC_GPIO_0_REGS, 7, GPIO_DEBOUNCE_FUNC_DISABLE);
    GPIODebounceFuncControl(SOC_GPIO_2_REGS, 11, GPIO_DEBOUNCE_FUNC_DISABLE);
    GPIODebounceFuncControl(SOC_GPIO_2_REGS, 13, GPIO_DEBOUNCE_FUNC_DISABLE);

     GPIOIntTypeSet(SOC_GPIO_0_REGS, 7, GPIO_INT_TYPE_RISE_EDGE);
     GPIOIntTypeSet(SOC_GPIO_2_REGS, 11, GPIO_INT_TYPE_RISE_EDGE);
     GPIOIntTypeSet(SOC_GPIO_2_REGS, 13, GPIO_INT_TYPE_RISE_EDGE);

        /* Enable interrupt for the specified GPIO Pin. */
    GPIOPinIntEnable(SOC_GPIO_0_REGS, GPIO_INT_LINE_1, 7);
    GPIOPinIntEnable(SOC_GPIO_2_REGS, GPIO_INT_LINE_1, 11);
    GPIOPinIntEnable(SOC_GPIO_2_REGS, GPIO_INT_LINE_1, 13);

  GPIOWakeupGlobalDisable(SOC_GPIO_0_REGS);
   GPIOWakeupGlobalDisable(SOC_GPIO_2_REGS);


       /* Configure input GPIO Pin to wakeup */
   GPIOPinIntWakeUpDisable(SOC_GPIO_0_REGS, GPIO_INT_LINE_1,7);
   GPIOPinIntWakeUpDisable(SOC_GPIO_2_REGS, GPIO_INT_LINE_1,11);
   GPIOPinIntWakeUpDisable(SOC_GPIO_2_REGS, GPIO_INT_LINE_1,13);

    IntRegister(SYS_INT_GPIOINT2A, TI_gpio2sync0Isr); //ioPin->gpioIsr);
    IntRegister(SYS_INT_GPIOINT2B,TI_gpio2sync1Isr);
    IntRegister(SYS_INT_GPIOINT0A,TI_gpio0IRQIsr);

        /* Set the priority for the GPIO system interrupt in INTC. */
        IntPrioritySet(SYS_INT_GPIOINT2A, 2, AINTC_HOSTINT_ROUTE_IRQ);
        IntPrioritySet(SYS_INT_GPIOINT2B, 1, AINTC_HOSTINT_ROUTE_IRQ);
        IntPrioritySet(SYS_INT_GPIOINT0A, 0, AINTC_HOSTINT_ROUTE_IRQ);


         /* Enable the GPIO system interrupt in INTC. */
              IntSystemEnable(SYS_INT_GPIOINT2A);
              IntSystemEnable(SYS_INT_GPIOINT2B);
              IntSystemEnable(SYS_INT_GPIOINT0A);

 

Please help me to sort this out.

  • Prasanna,

    If you are using SysBIOS, you need to use the Hwi module for registering for interrupts. You cannot use the StarterWare APIs for the interrupt controller.

    There are a lot of posts in the forum related to inter-working between SysBIOS & StarterWare. You could search within the forum with the two keywords (StarterWare SysBIOS) and should get several links that might help you.

    Regards,

    Mugdha