Nios® V Processor Software Developer Handbook

ID 743810
Date 10/06/2025
Public
Document Table of Contents

9.5.1.7.1. Separate Trap Stack

Use the hal.linker.enable_exception_stack BSP setting to enable a separate trap stack.

The HAL trap handler in CLINT-Direct and CLIC interrupt mode takes care of correctly changing the stack pointer on entry to and exit from an ISR or exception handler. Since the HAL trap handler is not present under CLINT-Vectored interrupt mode, each ISR must manage the stack pointer, as well as context switching.

Table 53.  Separate Exception Trap Stack Usage
Separate

Trap Stack

Application Stack Trap Stack
Not enabled
  • Application
  • Exceptions
  • Platform interrupts
  • Timer interrupts
  • Software interrupt
Enabled
  • Application
  • Exceptions
  • Platform interrupts
  • Timer interrupts
  • Software interrupt