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.

TMDS64EVM: TMDS64EVM Interrupt Inputs

Part Number: TMDS64EVM
Other Parts Discussed in Thread: SYSCONFIG

Tool/software:

Hello,

Using the build system : mcu_plus_sdk_am64x_10_01_00_32

The issue of interrupt misassignment to different ROUTER is described in details as follows :

Using example : gpio_input_interrupt

Pin assignment and interrupt router 7 to GPIO1_43 pin :

And the result in header file ti_drivers_config.h :

/* GPIO PIN Macros */

#define GPIO_PUSH_BUTTON_BASE_ADDR (CSL_GPIO1_BASE)

#define GPIO_PUSH_BUTTON_PIN (43)

#define GPIO_PUSH_BUTTON_DIR (GPIO_DIRECTION_INPUT)

#define GPIO_PUSH_BUTTON_TRIG_TYPE (GPIO_TRIG_TYPE_RISE_EDGE)

#define GPIO_PUSH_BUTTON_INTR_NUM     (CSLR_R5FSS0_CORE0_INTR_MAIN_GPIOMUX_INTROUTER0_OUTP_7)

And  Board_getGpioButtonIntrNum() assigns in ti_drivers_config.c  as :

uint32_t Board_getGpioButtonIntrNum(void)

{

    return (BOARD_BUTTON_GPIO_INTR_NUM);

}

In which BOARD_BUTTON_GPIO_INTR_NUM is defined as :

 /*

 * Board info

 */

/* This is based on DMSC board config and core */

#define BOARD_BUTTON_GPIO_INTR_NUM      (CSLR_R5FSS0_CORE0_INTR_MAIN_GPIOMUX_INTROUTER0_OUTP_7)

#define BOARD_BUTTON_GPIO_SWITCH_NUM    (5)

Please note the same interrupt number (39U) assigned correctly to BUTTON_GPIO_43

 -----------------------------------------

Everything is fine except when port this example into my project which already has another interrupt pin assigned but has not been creating the call back function for this interrupt yet. This interrupt label is : PRGM_INTN to GPIO1_7 and router is 0 , as follows :

 

The example interrupt is kept the same for GPIO_PUSH_BUTTON with GPIO1_47, router 7 :

So after project build and the interrupt to button SW5 (GPIO1_43) is not registered and not working

and further investigate from gpio_input_interrupt.c of the followings lines :

    pinNum          = GPIO_PUSH_BUTTON_PIN;

    intrNum         = Board_getGpioButtonIntrNum();

    buttonNum       = Board_getGpioButtonSwitchNum();

will lead to definition in the ti_drivers_config.h : 

#define GPIO_PUSH_BUTTON_BASE_ADDR (CSL_GPIO1_BASE)

#define GPIO_PUSH_BUTTON_PIN (43)

#define GPIO_PUSH_BUTTON_DIR (GPIO_DIRECTION_INPUT)

#define GPIO_PUSH_BUTTON_TRIG_TYPE (GPIO_TRIG_TYPE_RISE_EDGE)

#define GPIO_PUSH_BUTTON_INTR_NUM (CSLR_R5FSS0_CORE0_INTR_MAIN_GPIOMUX_INTROUTER0_OUTP_7)

But Board_getGpioButtonIntrNum() defines in ti_drivers_config.c as :

uint32_t Board_getGpioButtonIntrNum(void)

{

    return (BOARD_BUTTON_GPIO_INTR_NUM);

}

And   BOARD_BUTTON_GPIO_INTR_NUM is defined as :

/* This is based on DMSC board config and core */

#define BOARD_BUTTON_GPIO_INTR_NUM      (CSLR_R5FSS0_CORE0_INTR_MAIN_GPIOMUX_INTROUTER0_OUTP_0)

#define BOARD_BUTTON_GPIO_SWITCH_NUM    (5)

Which was the macro defined for PRGM_INTN pin in the ti_drivers_config.h :

#define PRGM_INTN_BASE_ADDR (CSL_GPIO1_BASE)

#define PRGM_INTN_PIN (7)

#define PRGM_INTN_DIR (GPIO_DIRECTION_INPUT)

#define PRGM_INTN_TRIG_TYPE (GPIO_TRIG_TYPE_RISE_EDGE)

#define PRGM_INTN_INTR_NUM     (CSLR_R5FSS0_CORE0_INTR_MAIN_GPIOMUX_INTROUTER0_OUTP_0)

So why is it that the interrupt router was wrongly assigned to BUTTON_GPIO_43 from the other original interrupt PRGM_INTN. Clearly the labels for the two interrupts are distinct and not related.

The problem only goes away when I remove the assignment of PRGM_INTN pin as interrupt in the SYSCONFIG.

  • Hi Huynh,

    Thanks for providing the above details. The template which generates those functions are currently created in such a way that it takes the BOARD_BUTTON_GPIO_INTR_NUM macro value from the first GPIO interrupt router.

    The BOARD_BUTTON_GPIO_SWITCH_NUM  macro is also hard code to have value 5 because the SW5 switch on the EVM responsible for generating GPIO interrupt from EVM  for gpio_input_interrupt example.

    The Board_getGpioButtonIntrNum function is also hard code to return BOARD_BUTTON_GPIO_INTR_NUM macro.

    Instead of using BOARD_BUTTON_GPIO_INTR_NUM macro for router number, you can use ${PIN_NAME}_INTR_NUM macro generated in ti_drivers_config.h file.

    Hope the above information helps.

    Regards,

    Tushar

  • I thought about direct assignment and it works

    intrNum         = GPIO_PUSH_BUTTON_INTR_NUM; instead of Board_getGpioButtonIntrNum();

    But I wonder how the template decides which interrupt amongst many interrupts to assign to BOARD_BUTTON_GPIO_INTR_NUM.

    Thanks.

  • Hi Huynh,

    The GPIO_PUSH_BUTTON is the name of pin which you configured using Sysconfig and the GPIO_PUSH_BUTTON_INTR_NUM will hold the router output configured for this pin only.

    The Board_getGpioButtonIntrNum() internally is returning BOARD_BUTTON_GPIO_INTR_NUM macro which will be the first GPIO interrupt number configured in sysconfig tool.

    Regards,

    Tushar