From ac04a8a56a1591ddbaf6558b8eab9837a7d2f3cb Mon Sep 17 00:00:00 2001
From: Damien George <damien.p.george@gmail.com>
Date: Thu, 25 Sep 2014 15:47:53 +0100
Subject: [PATCH] stmhal: Enable 8-byte stack alignment for IRQ handlers.

---
 stmhal/system_stm32f4xx.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/stmhal/system_stm32f4xx.c b/stmhal/system_stm32f4xx.c
index 4f8090204..e9742caf4 100644
--- a/stmhal/system_stm32f4xx.c
+++ b/stmhal/system_stm32f4xx.c
@@ -199,6 +199,9 @@ void SystemInit(void)
 #else
   SCB->VTOR = FLASH_BASE | VECT_TAB_OFFSET; /* Vector Table Relocation in Internal FLASH */
 #endif
+
+  /* dpgeorge: enable 8-byte stack alignment for IRQ handlers, in accord with EABI */
+  SCB->CCR |= SCB_CCR_STKALIGN_Msk;
 }
 
 /**
-- 
GitLab