Embedded Design Handbook

ID 683689
Date 8/28/2023
Public
Document Table of Contents

4.2.3.6. Modifying the Exception Handler

In some very special cases, you may wish to modify the existing HAL exception handler routine or to insert your own interrupt handler for the Nios® II processor. However, in most cases you need not modify the interrupt handler routines for the Nios® II processor for your software application.

Consider the following common issues and important points before you modify or replace the HAL-provided exception handler:

  • Interrupt vector address—The interrupt vector address for each Nios® II processor is set during compilation of the FPGA design. You can modify it during hardware configuration in Platform Designer.
  • Modifying the exception handler—The HAL-provided exception handler is fairly robust, reliable, and efficient. Modifying the exception handler could break the HAL-supplied interrupt handling API, and cause problems in the device drivers for other peripherals that use interrupts, such as the UART and the JTAG UART.

You may wish to modify the behavior of the exception handler to increase overall performance. For guidelines for increasing the exception handler’s performance, refer to “Accelerating Interrupt Service Routines”.