Why NVIC_EnableIRQ handler function only run once? I have a code that spit out random number when the ISR register is ready:
#define TRNG_KEY  0x524E47
uint8_t lut[10] = {0xF6, 0x12, 0xAE, 0xEC, 0xD8, 0x7C, 0x7E, 0xE0, 0xFE, 0xFC};
uint32_t msk = 0x1FE;

void setup()
{
  Serial.begin(9600);
  PIOC-&gt;PIO_PER = msk;
  PIOC-&gt;PIO_OER = msk;
  PIOC-&gt;PIO_OWDR = ~msk;

  PMC-&gt;PMC_PCER1 = PMC_PCER1_PID41;
  TRNG-&gt;TRNG_CR = TRNG_CR_ENABLE | TRNG_CR_KEY(TRNG_KEY);
  TRNG-&gt;TRNG_IER = 1 &lt;&lt; 0;
}

void loop()
{
  if (TRNG-&gt;TRNG_ISR == 1) {
  PIOC-&gt;PIO_ODSR = lut[REG_TRNG_ODATA % 10];
  }
  delay(500);
}

The code above works. However, when I tried to switch to internal interrupt:
#define TRNG_KEY  0x524E47
uint8_t lut[10] = {0xF6, 0x12, 0xAE, 0xEC, 0xD8, 0x7C, 0x7E, 0xE0, 0xFE, 0xFC};
uint32_t msk = 0x1FE;

void setup()
{
  Serial.begin(9600);
  PIOC-&gt;PIO_PER = msk;
  PIOC-&gt;PIO_OER = msk;
  PIOC-&gt;PIO_OWDR = ~msk;

  PMC-&gt;PMC_PCER1 = PMC_PCER1_PID41;
  TRNG-&gt;TRNG_CR = TRNG_CR_ENABLE | TRNG_CR_KEY(TRNG_KEY);
  TRNG-&gt;TRNG_IER = 1 &lt;&lt; 0;

  NVIC_EnableIRQ(TRNG_IRQn);
}

void loop()
{

}

void TRNG_Handler(void) {
  PIOC-&gt;PIO_ODSR = lut[REG_TRNG_ODATA % 10];
}

The code only spit out one random number and then freezes, indicating TRNG_Handler(void) was only executed once. I cannot figure out why.
Thanks in Advance !
Two things:

Never use delay() inside an ISR. On some systems it may work, but on most it will just block. It's bad practice to have your ISRs run for more time that absolutely needed anyway.
You need to read the status register for the TRNG to clear the interrupt flag. You're doing that in your first code sample with if (TRNG-&gt;TRNG_ISR == 1) {.