This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

Where/How are UART interrupt handlers set on nrf52840?

SDK Version: 13 Alpha

I've been able to track down, through app_uart.h, where UART interrupt priorities are set using NVIC_SetPriority(). Now I'd like to know where interrupts are mapped to there associated handler.

I have already fruitlessly searched for a NVIC_SetVector() in the SDK source. From what I've researched thus far, it seems interrupts may be pre-mapped to their weakly set handlers at initialization, however I have no confirmation.

I suspect it's hidden somewhere in the proprietary firmware, but would still appreciate knowing if there must be a call to NVIC_SetVector(IRQ_number, event_handler) or modification of SCB->VTOR somewhere in the code.

  • No it's not hidden anywhere in any proprietary firmware. It's standard ARM Cortex interrupt handling.

    There's a vector table starting at 0x00000000 (well that's actually the stack pointer and the vector table starts at 0x00000004). That's populated with the xxxIRQHandler symbols which are mostly weakly defined to the same spin forever handler.

    If you define a routine with one of those names, it will be linked in instead and its address will be the one put in the table instead of the do-nothing handler.

    That's it - that's all there is. That table is populated in one of the .s files in the tools section of the SDK, depending on what tool you're using. The interrupt handler names are of course the same in each one.

Related