Embedded Design Handbook

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

6.2.2.3.1. Enabling Run Time Stack Checking

Using the Nios® II Software Build Tools for Eclipse, you can enable the HAL to check for stack overflow.

If you enable stack overflow checking and you register an instruction-related exception handler, on stack overflow, the HAL calls the instruction-related exception handler. If you enable stack overflow checking and do not register an instruction-related exception handler, and you enable a JTAG debug module for your Nios® II processor, on stack overflow, execution pauses in the debugger, exactly as it does when the debugger encounters a breakpoint. To enable stack overflow checking, in the BSP Editor, in the Settings tab, under Advanced, under hal, click enable_runtime_stack_checking.

For information about the instruction-related exception handler, refer to "The Instruction-Related Exception Handler" in the Exception Handling chapter of the Nios® II Gen2 Software Developer’s Handbook.