3.5 Runtime stack checking exceptions
When multistack configurations are used, it is very useful to be informed when a particular stack becomes full. For this reason, the dsPIC (R) DSC core allows the user to specify a stack limit over which an exception should be raised. The stack limit is contained inside the internal register SPLIM. Erika Enterprise and Erika Enterprise Basic are able to automatically handle the SPLIM register, setting it at runtime to the top of the current stack when a multistack configuration.
The SPLIM feature is by default disabled, because it adds some (little) overhead at each stack change. To enable it, you must include the following lines inside the OIL configuration file:
...
CPU_DATA = PIC30 {
...
ENABLE_SPLIM = TRUE;
};
...
Please note that Erika Enterprise does not provide a default handler for the stack overflow exception generated by the SPLIM register. The exception should be specified by the developer as the behavior to implement is often application dependent.


