Difference between CONFIG_HW_STACK_PROTECTION and CONFIG_STACK_SENTINEL #28866
-
Hi, I'm wondering what should be used between CONFIG_HW_STACK_PROTECTION and CONFIG_STACK_SENTINEL at least regarding NRF MCU. Does both of them catch every stack overflow? Thanks! Xavier |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
The HW stack protection relies on HW-based mechanisms to detect thread stack overflows. Examples:
Stack sentinel is supposed to be used when the CPU does not have a native HW stack protection mechanism. It marks a "guard" area at the end of the thread stack with a given pattern. Each time a thread switches-out, -in or during IRQ exit, the area is checked whether it still holds the pattern and an CPU error is triggered if not. HW-based mechanisms mush be used when they are available. |
Beta Was this translation helpful? Give feedback.
The HW stack protection relies on HW-based mechanisms to detect thread stack overflows. Examples:
Stack sentinel is supposed to be used when the CPU does not have a native HW stack protection mechanism. It marks a "guard" area at the end of the thread stack with a given pattern. Each time a thread switches-out, -in or during IRQ exit, the area is checked whether…