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.

CC2652R7: GPIO interrupt occur even though interrupt are disabled.

Part Number: CC2652R7

The interrupt for a specific Pin (Index 14) is enabled, and when that interrupt occurs, the callback function disables the interrupt for a specific Pin (index 14) .

However, the interrupt still occur even after the interrupts are disabled.

This Pin is connected to a switch.

I design to generate an interrupt when the switch is pressed.

Sometimes this problem occur.


I implemented the following to disable interrupts.

void callback_function(uint_least8_t pin)
{
   GPIO_disableInt(14);
}

This callback_function is a function registered with GPIO_setCallback,

This function is called when an interrupt occurs.

I checked the variable (pin) after the interrupt occured, and pin was 14.

Also, EDGE_IRQ_EN of IOCFG was 0 (No interrupt generation).

Please let me know if I'm doing something wrong or missing a way to disable interruptions.
Or if there is another cause, please let me know.

<SDK Version>
simplelink_cc13xx_cc26xx_sdk_5_30_01_01

  • Hi satoshi,

    Here is the GPIO TI Driver Runtime APIs.  I recommend that you use GPIO_disableInt and GPIO_clearInt outside of the context of callback_function as disabling an interrupt while it is being serviced could cause an issue.  Also, have you further tried to disable the interrupt by using GPIO_setConfig or GPIO_setInterruptConfig?  You can also debug the application registers to confirm that IOC:IOCFG14:EDGE_IRQ_EN is turned off.

    Regards,
    Ryan

  • Hello Ryan-san,

    Thank you for your answer.

    I have not tried to use GPIO_setConfig or GPIO_setInterruptConfig, so I will try to use GPIO_setInterruptConfig.

    I will try to implement it like this.
    void callback_function(uint_least8_t pin)
    {
       GPIO_setInterruptConfig(14,GPIO_CFG_INT_DISABLE);
    }

    Is it ok to call this API in callback_function?

  • You can reference an example of GPIO_setConfig usage in GPIO_Board_keyCallback from project_zero:

    static void GPIO_Board_keyCallback(uint_least8_t index)
    {
        Log_info1("Button interrupt: %s",
                  (uintptr_t)((index == CONFIG_GPIO_BTN1) ? "Button 0" : "Button 1"));
    
        // Disable interrupt on that gpio for now. Re-enabled after debounce.
        GPIO_setConfig(index, GPIO_CFG_IN_PU | GPIO_CFG_IN_INT_FALLING | GPIO_CFG_INT_DISABLE);
    
        // Start debounce timer
        switch(index)
        {
        case CONFIG_GPIO_BTN1:
            Util_startClock((Clock_Struct *)button0DebounceClockHandle);
            break;
        case CONFIG_GPIO_BTN2:
            Util_startClock((Clock_Struct *)button1DebounceClockHandle);
            break;
        }
    }

    Thus this should be acceptable to implement.

    Regards,
    Ryan