SPRUJ79A November 2024 – December 2025 F29H850TU , F29H859TU-Q1
Stack Qualification is useful for checking stack overflows. In addition to stack overflow checking, SPSEL is useful for specifying which STACK is to be enabled for ERAD event checking in. By default STACK2 is used since that is the primary user stack when SPSEL_MATCHEN is disabled.
SPSEL are used for “protected call stacks”. Whenever an instruction is loaded into the D2 phase of the pipeline the associated LINK/STACK information is always loaded into the CPU. The STACK information associated with the current instruction packet is always reflected in the CURRSP of the ISTS register.
For an example, assume application code is running from STACK2 (primary user stack), then in the application code the STACK switches and STACK3 is used. Configured ERAD’s SPSEL = 0x3, and enabled SPSEL_MATCH_EN, then ERAD’s event fired triggers when checking what is executing for STACK3.
Within the EBC, there is direct access to the stack pointer which can detect stack overflow scenarios. To configure the stack overflow detection: