S32K312 stack overflow detection

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

S32K312 stack overflow detection

725 Views
rameshnairmetallic
Contributor I

Does this chip detect stack overflow or underflow conditions?

0 Kudos
Reply
1 Reply

699 Views
Robin_Shen
NXP TechSupport
NXP TechSupport

Hi

Sorry, there is no dedicated HW feature that would monitor the stack.

I recommend you to take a look at the discussion in Failure reaction in case of Stack overflow or underflow - S32K1
Safety manual for S32K1 suggest to use DWT. There are SW examples in the above discussion.
Safety manual for S32K3 does not explicitly talk about stack monitoring but the same method could be used.
Another option is to use MPU(memory protection unit) when you can configure small area bellow the stack as write-protected, so an exception is triggered in case of underflow. The MCU then detects a MemManage Fault exception when the stack overflows.

Also, the application can also monitor the stack pointer by reading it.

Best Regards,
Robin
-------------------------------------------------------------------------------
Note:
- If this post answers your question, please click the "ACCEPT AS SOLUTION" button. Thank you!

- We are following threads for 7 weeks after the last post, later replies are ignored
Please open a new thread and refer to the closed one, if you have a related question at a later point in time.
-------------------------------------------------------------------------------

0 Kudos
Reply