SPRADI6 May 2024 F29H850TU , F29H859TU-Q1 , TMS320F2800132 , TMS320F2800133 , TMS320F2800135 , TMS320F2800137 , TMS320F2800152-Q1 , TMS320F2800153-Q1 , TMS320F2800154-Q1 , TMS320F2800155 , TMS320F2800155-Q1 , TMS320F2800156-Q1 , TMS320F2800157 , TMS320F2800157-Q1 , TMS320F28P650DH , TMS320F28P650DK , TMS320F28P650SH , TMS320F28P650SK , TMS320F28P659DH-Q1 , TMS320F28P659DK-Q1 , TMS320F28P659SH-Q1
The enhanced bus comparator (EBC) unit in the ERAD module can monitor the internal address and data buses, and the EBC triggers the RTOSINT interrupt when a specified bus and mask matches a specified value. Hence, the basic approach for detecting stack overflow is to configure the EBC unit to trigger an interrupt when the data write address bus falls within some range prior to the end of a stack. Figure 4-2 illustrates this concept. Since this memory is reserved for stack use only, a data write within the specified address range indicates that the stack usage is approaching the allocated size limit. Detection of an impending stack overflow triggers a maskable interrupt. Programmed error response and any necessary software requirements are defined by the system integrator.
The API function STL_SP_configSP(const STL_SP_Handle spHandle) is found in the example project, and the source code is in f280013x\source\stl_sp.c. The STL_SP_MARGIN parameter needs to be configured, with a reference value of 0x50. This parameter defines the memory space range observed from the end of the stack.