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.

TDA4VM: TDA4VM,RTOS SDK, gpio AD22(GPIO0_7) ,interrupt

Part Number: TDA4VM
Other Parts Discussed in Thread: SYSCONFIG

Use AD22 as input pin and enable interrupt for rising edge trigger detection,but it can not enter the Interrupt Service Function

there is my code,is there any problem?run in R5F

#define TEST_GPIO_INT_FUN_AD22 (7)
/* GPIO Driver board specific pin configuration structure */
GPIO_PinConfig gpioPinConfigs[] =
{
    GPIO_DEVICE_CONFIG (0x00, TEST_GPIO_INT_FUN_AD22) | GPIO_CFG_IN_INT_RISING | GPIO_CFG_INPUT,
};

void AppGpioCallbackFxn_AD22 (void)
{
    printf ("caiting enterAppGpioCallbackFxn_AD22\n");
}


/* GPIO Driver call back functions */
GPIO_CallbackFxn gpioCallbackFunctions[] =
{
    NULL
};

/* GPIO Driver configuration structure */
GPIO_v0_Config GPIO_v0_config =
{
    gpioPinConfigs,
    gpioCallbackFunctions,
    1,
    1,
    0x8U
};
    Board_initCfg boardCfg;

    GPIO_v0_HwAttrs gpio_cfg;

    CSL_REG32_WR(CSL_CTRL_MMR0_CFG0_BASE + CSL_MAIN_CTRL_MMR_CFG0_PADCONFIG7, 0x00050007);
    /* Get the default SPI init configurations */
    GPIO_socGetInitCfg(0x00, &gpio_cfg);

    /* change default GPIO port from MAIN GPIO0 to CSL_GPIO0_BASE  */
    gpio_cfg.baseAddr = CSL_GPIO0_BASE;
    gpio_cfg.intCfg[0].intNum = CSLR_R5FSS0_CORE0_INTR_R5FSS0_INTROUTER0_OUTL_0 + 0;
    gpio_cfg.intCfg[0].intcMuxNum      = INVALID_INTC_MUX_NUM;
    gpio_cfg.intCfg[0].intcMuxInEvent  = 0;
    gpio_cfg.intCfg[0].intcMuxOutEvent = 0;
   
    /* Set the default GPIO init configurations */
    GPIO_socSetInitCfg(0x00, &gpio_cfg);

       /* GPIO initialization */
    GPIO_init();

    /* Set the callback function */
    GPIO_setCallback(0x00, AppGpioCallbackFxn_AD22);

    /* Enable GPIO interrupt on the specific gpio pin */
    GPIO_enableInt(0x00);
  • Hi ting,

    Did you complete the pinmux configuration for GPIO0_7? You can refer to the TI SysConfig tool to help with this.

    Regards,

    Neehar

  • yes, i  completed the pinmux configuration for GPIO0_7

    static pinmuxPerCfg_t gGpio0PinCfg[] =
    {
        /* MyGPIO1 -> GPIO0_7 -> AD22 */
        {
            PIN_PRG1_PRU0_GPO6, PIN_MODE(7) | \
            ((PIN_PULL_DISABLE | PIN_INPUT_ENABLE) & (~PIN_PULL_DIRECTION))
        },    
        /* MySYSTEM1 -> GPIO0_0 -> AC18 */
        {
            PIN_EXTINTN, PIN_MODE(7) | \
            ((PIN_PULL_DISABLE | PIN_INPUT_ENABLE) & (~PIN_PULL_DIRECTION))
        },
        /* MyGPIO0 -> GPIO0_97 -> Y28 */
        {
            PIN_RGMII6_TX_CTL, PIN_MODE(7) | \
            ((PIN_PULL_DISABLE | PIN_INPUT_ENABLE) & (~PIN_PULL_DIRECTION))
        },
        /* MyGPIO0 -> GPIO0_117 -> W4 */
        {
            PIN_SPI1_CS1, PIN_MODE(7) | \
            ((PIN_PULL_DISABLE | PIN_INPUT_ENABLE) & (~PIN_PULL_DIRECTION))
        },
        /* MyGPIO0 -> GPIO0_127 -> AC4 */
        {
            PIN_UART1_CTSN, PIN_MODE(7) | \
            ((PIN_PULL_DISABLE | PIN_INPUT_ENABLE) & (~PIN_PULL_DIRECTION))
        },
        {PINMUX_END}
    };
    static pinmuxModuleCfg_t gGpioPinCfg[] =
    {
        {0, TRUE, gGpio0PinCfg},
        {1, TRUE, gGpio1PinCfg},
        {PINMUX_END}
    };
  • and the GPIO0_7 is int the main domain, i check the address is correct,and the GPIO0_7 can get input io status success, but only the interrupt can not be detetctd, and can not enter the Interrupt Service Function

  • Hi ting,

        gpio_cfg.intCfg[0].intNum = CSLR_R5FSS0_CORE0_INTR_R5FSS0_INTROUTER0_OUTL_0 + 0;
        gpio_cfg.intCfg[0].intcMuxNum      = INVALID_INTC_MUX_NUM;
        gpio_cfg.intCfg[0].intcMuxInEvent  = 0;
        gpio_cfg.intCfg[0].intcMuxOutEvent = 0;

    You will want to adjust the interrupt configuration for the specific pin number GPIO0_7. Therefore, you will want to make changes to the interrupt configuration gpio_cfg.intCfg[7]. Refer to this FAQ for more information.

    Thanks,

    Neehar