This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Is it possible to configure ISR_RESERVED_DUMMY for my own purposes?

Hi Nordic!

I've got an nRF52832DK and use SEGGER Embedded Studio via nRF Connect

I'm trying to familiarize myself with arm's exception handling.

Looking in ses_startup_nrf52.s I see there are many "ISR_RESERVED_DUMMY" entries and I thought I could change one of those to a ISR_HANDLER Test_IRQHandler and use it in my code to use custom interrupts.

In a simple main.c I have the following code

int main(void) {
  // LEDs
  NRF_P0->DIRSET |= (1 << 17) | (1 << 18) | (1 << 19) | (1 << 20);
  NRF_P0->OUTSET |= (1 << 17) | (1 << 18) | (1 << 19) | (1 << 20);

  NVIC_ClearPendingIRQ(42);
  NVIC_EnableIRQ(42);


  NVIC_SetPendingIRQ(42);

  while (1)
  {
    ;
  }
}


void Test_IRQHandler(void)
{
  NRF_P0->OUTCLR = (1 << 18);
}

But LED2 (pin 18) never lit... so I assume that it is not possible or I did something wrong Slight smile

Parents
  • Hi 

    It is not possible to use interrupt vectors that are not assigned to anything unfortunately. These interrupts are not supported by the underlying hardware. 

    Still, if you are running out of software interrupts it is actually possible to use any hardware interrupt vector that you don't need as a software interrupt. 

    As an example, the QDEC peripheral is only used by very specific applications (scroll wheels in mice primarily), and if you don't need to use the QDEC peripheral you are free to use the QDEC interrupt handler as a software interrupt. 

    To try this just replace 42 with QDEC_IRQn in your code, and replace Test_IRQHandler with QDEC_IRQHandler. 

    Best regards
    Torbjørn

Reply
  • Hi 

    It is not possible to use interrupt vectors that are not assigned to anything unfortunately. These interrupts are not supported by the underlying hardware. 

    Still, if you are running out of software interrupts it is actually possible to use any hardware interrupt vector that you don't need as a software interrupt. 

    As an example, the QDEC peripheral is only used by very specific applications (scroll wheels in mice primarily), and if you don't need to use the QDEC peripheral you are free to use the QDEC interrupt handler as a software interrupt. 

    To try this just replace 42 with QDEC_IRQn in your code, and replace Test_IRQHandler with QDEC_IRQHandler. 

    Best regards
    Torbjørn

Children
No Data
Related