Hi Javier,
I checked both your main and pinmux files, and I noticed that you don't set SW3 completely. When I tried your code on my side, I saw that you have a function at pinmux.c that you never use called "BOARD_InitButtonsPins" where you can see the configuration for SW3; based on this observation I just added this function inside your main function and with this I was able to call the SW3 interruption without any problem.
int main(void) {
gpio_pin_config_t sw_config = {
kGPIO_DigitalInput, 0,
};
BOARD_InitBootPins();
BOARD_InitButtonsPins();
BOARD_InitBootClocks();
BOARD_InitBootPeripherals();
BOARD_InitDebugConsole();
PRINTF("Starting program!\n");
#if (defined(FSL_FEATURE_PORT_HAS_NO_INTERRUPT) && FSL_FEATURE_PORT_HAS_NO_INTERRUPT)
GPIO_SetPinInterruptConfig(BOARD_SW_GPIO, BOARD_SW_GPIO_PIN, kGPIO_InterruptFallingEdge);
#else
PORT_SetPinInterruptConfig(BOARD_SW_PORT, BOARD_SW_GPIO_PIN, kPORT_InterruptFallingEdge);
#endif
EnableIRQ(BOARD_SW_IRQ);
GPIO_PinInit(BOARD_SW_GPIO, BOARD_SW_GPIO_PIN, &sw_config);
while(1)
{
if(g_ButtonPress)
{
PRINTF("button pressed");
g_ButtonPress = false;
}
}
}
I hope this can help you.
Best Regards,
Ricardo Delsordo