stack underflow and overflow control

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 
已解决

stack underflow and overflow control

跳至解决方案
931 次查看
smt87
Contributor II

Hi,

I want to control stack underflow and overflow. I use S32K116. I know it does not have DWT module. How can i control this safety controls in any way? What can i do for testing stack underflow?

0 项奖励
回复
1 解答
920 次查看
PetrS
NXP TechSupport
NXP TechSupport

Hi,

if a stack is placed at beginning/end of SRAM then you can get a hard fault as soon as the stack overflows/underflow.
Or software can write a unique guard value to the SRAM area at the stack limit address. The software checks this address periodically. If guard value is overwritten, a stack overflow/underflow fault is reported by SW.

BR, Petr

在原帖中查看解决方案

0 项奖励
回复
1 回复
921 次查看
PetrS
NXP TechSupport
NXP TechSupport

Hi,

if a stack is placed at beginning/end of SRAM then you can get a hard fault as soon as the stack overflows/underflow.
Or software can write a unique guard value to the SRAM area at the stack limit address. The software checks this address periodically. If guard value is overwritten, a stack overflow/underflow fault is reported by SW.

BR, Petr

0 项奖励
回复