Dear TI:
I'm using TDA4VM, with qnx_sdk8.2 and rtos_sdk8.2(08_02_00_21).
On MCU2_0 with freertos OS, I registered 2 GPIO interrupts with GPIO1_26 and GPIO1_2.
I encountered an issue that GPIO1_26 interrupt handler is called only after GPIO1_2 interrupt handler is called.
From my mode, GPIO1_26 is registered after GPIO1_2. If I register GPIO1_26 before GPIO1_2, I will encounter an issue that GPIO1_2 interrupt handler is called only when GPIO1_26 interrupt handler is called.
Here is my code:
#include <ti/drv/gpio/GPIO.h> #include <ti/drv/gpio/src/v0/GPIO_v0.h> #include <ti/drv/gpio/soc/GPIO_soc.h> void Loop_PullUpDownGPIOs() { while (1) { // pull up/down GPIO1_26 ... appLogWaitMsecs(2000u); // pull up/down GPIO1_2 ... appLogWaitMsecs(5000u); } } #define GPIO1_PORT_NUM (1U) #define GPIO1_2_PIN_NUM (2U) #define GPIO1_26_PIN_NUM (26U) #define CSLR_R5FSS0_CORE0_INTR_GPIOMUX_INTRTR0_OUTP_24 (184U) static void Callback_GPIO1_2(void) { printf("%s:%d: enter\n", __func__, __LINE__); } static void Callback_GPIO1_26(void) { printf("%s:%d: enter\n", __func__, __LINE__); } GPIO_PinConfig gpioPinConfigs[] = { GPIO_DEVICE_CONFIG(GPIO1_PORT_NUM, GPIO1_2_PIN_NUM) | GPIO_CFG_IN_INT_BOTH_EDGES | GPIO_CFG_INPUT, GPIO_DEVICE_CONFIG(GPIO1_PORT_NUM, GPIO1_26_PIN_NUM) | GPIO_CFG_IN_INT_BOTH_EDGES | GPIO_CFG_INPUT, }; GPIO_CallbackFxn gpioCallbackFunctions[] = { Callback_GPIO1_2, Callback_GPIO1_26, }; GPIO_v0_Config GPIO_v0_config = { gpioPinConfigs, gpioCallbackFunctions, sizeof(gpioPinConfigs) / sizeof(GPIO_PinConfig), sizeof(gpioCallbackFunctions) / sizeof(GPIO_CallbackFxn), 0, }; static void TestTaskMain(void* arg0, void* arg1) { GPIO_v0_HwAttrs gpio_cfg; GPIO_IntCfg *intCfg; printf("%s:%d: enter\n", __func__, __LINE__); appLogWaitMsecs(30*1000); printf("%s:%d: begin\n", __func__, __LINE__); GPIO_socGetInitCfg(GPIO1_PORT_NUM ,&gpio_cfg); intCfg = gpio_cfg.intCfg; intCfg[GPIO1_2_PIN_NUM].intNum = CSLR_R5FSS0_CORE0_INTR_GPIOMUX_INTRTR0_OUTP_24; intCfg[GPIO1_2_PIN_NUM].eventId = 0; intCfg[GPIO1_2_PIN_NUM].intcMuxNum = INVALID_INTC_MUX_NUM; intCfg[GPIO1_2_PIN_NUM].intcMuxInEvent = 0; intCfg[GPIO1_2_PIN_NUM].intcMuxOutEvent = 0; intCfg[GPIO1_26_PIN_NUM].intNum = CSLR_R5FSS0_CORE0_INTR_GPIOMUX_INTRTR0_OUTP_24; intCfg[GPIO1_26_PIN_NUM].eventId = 0; intCfg[GPIO1_26_PIN_NUM].intcMuxNum = INVALID_INTC_MUX_NUM; intCfg[GPIO1_26_PIN_NUM].intcMuxInEvent = 0; intCfg[GPIO1_26_PIN_NUM].intcMuxOutEvent = 0; GPIO_socSetInitCfg(GPIO1_PORT_NUM, &gpio_cfg); GPIO_init(); GPIO_enableInt(0); GPIO_enableInt(1); Loop_PullUpDownGPIOs(); }
Please help. Thanks in advance.