Keil Logo



How do I insert dummy interrupt vectors in my code for debug purposes?


Create an interrupt service routine using the interrupt keyword for each unused interrupt. In these routines, use a while (1) {} statement to create a tight loop jumping to itself. The following is a typical example:

void empty_isr (void) interrupt 0
        while (1) {};

Copy it for each interrupt and remember to change the interrupt number. If you forget, the linker posts an error message about code space overlap.

If a spurious interrupt is received, your interrupt handler halts your program in this tight loop. This may give you an idea where the problem may lie.

Last Reviewed: Saturday, May 8, 2004

Did this article provide the answer you needed?
Not Sure
  Arm logo
Important information

This site uses cookies to store information on your computer. By continuing to use our site, you consent to our cookies.

Change Settings

Privacy Policy Update

Arm’s Privacy Policy has been updated. By continuing to use our site, you consent to Arm’s Privacy Policy. Please review our Privacy Policy to learn more about our collection, use and transfers
of your data.