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.