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: How to implement GPIO interrupts on main domain?

Part Number: TDA4VM

Hi team,

The customer has referenced the GPIO-related code in main_led_blink.c, but the GPIO interrupts still do not work successfully. The code is as follows: 

Fullscreen
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
//Configure GPIO0_99 (W23) as an interrupt
typedef enum {
ENUM_TEST_GPIO_INT_FUN_W23 = 0,
}GPIO_CTL;
GPIO_PinConfig gpioPinConfigs[] =
{
GPIO_DEVICE_CONFIG(0, 99) | GPIO_CFG_IN_INT_BOTH_EDGES | GPIO_CFG_INPUT,
};
GPIO_CallbackFxn gpioCallbackFunctions[] =
{
NULL,
};
GPIO_v0_Config GPIO_v0_config =
{
gpioPinConfigs,
gpioCallbackFunctions,
sizeof(gpioPinConfigs) / sizeof(GPIO_PinConfig),
sizeof(gpioCallbackFunctions) / sizeof(GPIO_CallbackFxn),
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

Could you help check this case? Thanks.

Best Regards,

Cherry

  • Hi Cherry,

    For which GPIO instance are you trying to configure the interrupt? I see, in the comment you want to configure GPIO0_99 but you are setting the base address for GPIO6 in gpio_cfg.baseAddr = CSL_GPIO6_BASE; .

    Also, before we investigate the interrupt, can you try and toggle the intended GPIO pin and see if you are able to toggle it?

    Regards,
    Parth

  • Hello,
    I don't know how to configure gpio_cfg.baseAddr, there is no documentation on how gpio_cfg.baseAddr should be configured. I configured CSL_GPIO6_BASE because I think 99/16=6, so I configured CSL_GPIO6_BASE. How should gpio_cfg.baseAddr be configured?
    In addition, if I configure GPIO0_99 as a normal GPIO output function, I can configure GPIO0_99 to output a high level or a low level.

    Does TI have an introduction document about GPIO interrupts on TDA4 R5F? I didn't find any relevant documentation in TI's documentation.
    Could you please provide an example of a GPIO interrupt that can be run on TDA4 MCU2_0? For example, take GPIO0_99 as an example.

  • Hi Qidong,

    We do not have any documentation currently.

    . I configured CSL_GPIO6_BASE because I think 99/16=6, so I configured CSL_GPIO6_BASE.

    This base address should be the GPIO instance's base address. So, in your case it should be CSL_GPIO0_BASE.

    Please refer to the discussion in https://e2e.ti.com/support/processors-group/processors/f/processors-forum/882426/tda4vmxevm-how-to-build-gpio-driver-for-mcu2_0-main_r5_0_0  for reference

    Regards,
    Parth

  • Hello, when I use the GPIO0_99 pin to configure the interrupt, I call the following code, GPIO_socConfigIntrPath always returns -1. Where is the configuration problem?

    Fullscreen
    1
    2
    3
    4
    5
    6
    7
    8
    9
    GPIO_v0_HwAttrs gpio_cfg;
    status = GPIO_socGetInitCfg(0, &gpio_cfg);
    printf("%s %s %d status = %d.\n", __FILE__, __func__, __LINE__ status);
    status = GPIO_socConfigIntrPath(GPIO_MAIN_DOMAIN_0, TEST_GPIO_INT_FUN_W23, &gpio_cfg, 1);
    printf("%s %s %d status = %d.\n", __FILE__, __func__, __LINE__ status);//there status=-1
    status = GPIO_socSetInitCfg(0, &gpio_cfg);
    printf("%s %s %d status = %d.\n", __FILE__, __func__, __LINE__ status);
    XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

  • Hi,

    What is the interrupt number you are using? Have you tried toggling the GPIO and see if you are able to toggle it?
    Can you please share your complete code, also, please on which core are you running this test.

    Regards,
    Parth