summaryrefslogtreecommitdiff
path: root/src/stm/ao_interrupt.c
diff options
context:
space:
mode:
authorKeith Packard <keithp@keithp.com>2012-10-24 22:46:55 -0700
committerKeith Packard <keithp@keithp.com>2012-10-25 00:07:14 -0700
commit4b13d3c659240e5a8347b1ba7ab0bf1d8355eba3 (patch)
treeef3e1a8e37d8ba3c362f1fdf43e5e9bd09157af9 /src/stm/ao_interrupt.c
parente80fa6de4ccc5c4851eab9fb941f9282d2e3eb16 (diff)
altos: Add stack-guard code. Uses STM MPU to trap stack overflow.
This marks the lowest portion of the stack as inaccessible to the CPU, causing the processor to fault when it reaches it. The fault then generates a panic message so that the user can know what happened. Signed-off-by: Keith Packard <keithp@keithp.com>
Diffstat (limited to 'src/stm/ao_interrupt.c')
-rw-r--r--src/stm/ao_interrupt.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/stm/ao_interrupt.c b/src/stm/ao_interrupt.c
index 6b4a9700..a423d8b1 100644
--- a/src/stm/ao_interrupt.c
+++ b/src/stm/ao_interrupt.c
@@ -15,6 +15,7 @@
* 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
*/
+#include <ao.h>
#include "stm32l.h"
#include <string.h>
@@ -28,7 +29,7 @@ extern char __bss_start__, __bss_end__;
void stm_halt_isr(void)
{
- for(;;);
+ ao_panic(AO_PANIC_CRASH);
}
void stm_ignore_isr(void)