AnsweredAssumed Answered

Interrupts stop working after some time (even after hard reset)

Question asked by Anthony DeSouza on Aug 21, 2019
Latest reply on Sep 10, 2019 by Jing Pan

I'm working on a project with an i.MX RT1020 EVK using NXP's SDK and FreeRTOS. I'm encountering some strange behaviour with interrupts.


  1. After first programming the board, the interrupts (attached to push buttons) work fine (lets say the up, down, left, right buttons)
  2. After some while, a few of the interrupts stop working (only up button works)
  3. Even after multiple resets and even after removing the power and reconnecting, these interrupts do not work
  4. Even after reprogramming the board, the interrupts do not work, HOWEVER
  5. The interrupts work again if I program the board with a different firmware and reprogram back to the original.

It's a very strange problem. Perhaps some sort of non-volatile memory is being corrupted. Perhaps the IVT? (but shouldn't that be fixed by reprogramming?)

Any help would be appreciated.


The relevant code for setting up my interrupts is listed below. Note, I have this set up for all the buttons, with four interrupt handlers, but I'm only showing one below.


void init(void) {     gpio_pin_config_t sw_config = { kGPIO_DigitalInput, 0, kGPIO_IntRisingOrFallingEdge };     // button1->rail = GPIO1    // button1->pin = 29U    GPIO_PinInit(button1->rail, button1->pin, &sw_config);     EnableIRQ(GPIO1_Combined_0_15_IRQn);     GPIO_PortEnableInterrupts(button1->rail, 1U << button1->pin);     GPIO_PortClearInterruptFlags(button1->rail, 1U << button1->pin);     // Repeat for other buttons} void GPIO1_Combined_0_15_IRQHandler(void) {     PRINTF("Interrupt!\r\n");     isr_callback(); // Do stuff    GPIO_PortClearInterruptFlags(button1->rail, 1U << button1->pin); }


EDIT: I'm not sure how to post code in this forum without messing up the formatting, so I'll attach the file that contains the fragment.


EDIT 2: Added, see my comment below