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.

[参考译文] TDA4VH-Q1:MCU3_0寄存器 MAIN_GPIO 中断。、但却达 IDN'无法正常工作

Guru**** 2460440 points


请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

https://e2e.ti.com/support/processors-group/processors/f/processors-forum/1480773/tda4vh-q1-mcu3_0-register-main_gpio-interrupts-but-it-didn-t-work

器件型号:TDA4VH-Q1

工具与软件:

您好!

SDK8.5

我需要在 MCU3_0中配置 GPIO0_48以捕获 上升沿中断。

这里是我的代码

GPIO_PinConfig gpioPinConfigs[] =
{
    /* Input pin with interrupt enabled */
    GPIO_DEVICE_CONFIG(0, 48) |
    GPIO_CFG_IN_INT_RISING | GPIO_CFG_IN_PD,
};

GPIO_v0_Config GPIO_v0_config =
{
    gpioPinConfigs,
    NULL,
    1,
    1,
    12
};
void exit_irq_test(void)
{
    appLogPrintfNoIsr("yes irq\r\n");
}
void gpio_exti_config()
{
    int                           pinNum  = 48;
    GPIO_v0_HwAttrs gpio_cfg;
    GPIO_socGetInitCfg(0, &gpio_cfg);  // IDX uses the bankNum variable, is it correct?
    gpio_cfg.baseAddr = CSL_GPIO0_BASE;
    gpio_cfg.intCfg[0].intNum = 0; //My guess is that the interrupt number is incorrectly configured
    gpio_cfg.intCfg[0].intcMuxNum      = INVALID_INTC_MUX_NUM;  // Refer to the main_led_blink.c configuration
    gpio_cfg.intCfg[0].intcMuxInEvent  = 0;                     // Refer to the main_led_blink.c configuration
    gpio_cfg.intCfg[0].intcMuxOutEvent = 0;                     // Refer to the main_led_blink.c configuration
    GPIO_socSetInitCfg(0, &gpio_cfg);                          // IDX uses the bankNum variable, is it correct?
    GPIO_init();
    GPIO_setCallback(0, exit_irq_test);
    GPIO_enableInt(0);
}

我根据 main_led_blink.c 配置来完成该操作。

我猜是中断号配置不正确。但在 main_led_blink.c 中找不到中断号配置

#if defined (j721e_sim)|| defined (j721e_evm)|| defined (j7200_evm)|| defined (j721s2_evm)|| defined (j784s4_evm)

/*没有主域 GPIO 引脚直接连接到 GP EVM 上的 LED、
使用 WKUP 域 GPIO 引脚、这些引脚连接到基板上的 LED */
CFG->baseAddr = CSL_WKUP_GPIO0_BASE;

#endif

  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

    GPIO_PinConfig gpioPinConfigs[] =
    {
        /* Input pin with interrupt enabled */
        GPIO_DEVICE_CONFIG(0, 48) |
        GPIO_CFG_IN_INT_RISING | GPIO_CFG_IN_PD,
    };
    GPIO_CallbackFxn gpioCallbackFunctions[] = {
        NULL
    };
    GPIO_v0_Config GPIO_v0_config =
    {
        gpioPinConfigs,
        gpioCallbackFunctions,
        1,
        1,
        12
    };
    void exit_irq_test(void)
    {
        appLogPrintfNoIsr("yes irq\r\n");
    }
    void gpio_exti_config()
    {
        int                           pinNum  = 48;
        GPIO_v0_HwAttrs gpio_cfg;
        GPIO_socGetInitCfg(0, &gpio_cfg);  // IDX uses the bankNum variable, is it correct?
        gpio_cfg.baseAddr = CSL_GPIO0_BASE;
        gpio_cfg.intCfg[0].intNum = 0; //My guess is that the interrupt number is incorrectly configured
        gpio_cfg.intCfg[0].intcMuxNum      = INVALID_INTC_MUX_NUM;  // Refer to the main_led_blink.c configuration
        gpio_cfg.intCfg[0].intcMuxInEvent  = 0;                     // Refer to the main_led_blink.c configuration
        gpio_cfg.intCfg[0].intcMuxOutEvent = 0;                     // Refer to the main_led_blink.c configuration
        GPIO_socSetInitCfg(0, &gpio_cfg);                          // IDX uses the bankNum variable, is it correct?
        GPIO_init();
        GPIO_setCallback(0, exit_irq_test);
        GPIO_enableInt(0);
    }

    相关代码写错了;实际代码看起来像这样、但仍然无法正常工作

  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

    我找到了错误的原因。在 SDK8.5中、Sciclient_rmIrqGetNode 函数使用二进制搜索来匹配 gRmIrqTree 中的 IRQ_node。

    但是、gRmIrqTree 中的 ID 不按顺序排列、这会导致节点 tisci_IRQ_GPIOMUX_INTRTR0不匹配。

    因为此节点的 id 为10、但它位于背面