My options to reproduce is: PORT_USE_SYSCALL=FALSE, CORTEX_USE_FPU=TRUE, and CH_DBG_ENABLE_STACK_CHECK=TRUE
Here is a patch to fix the problem:
Code: Select all
diff --git a/os/common/ports/ARMv8-M-ML-ALT/compilers/GCC/chcoreasm.S b/os/common/ports/ARMv8-M-ML-ALT/compilers/GCC/chcoreasm.S
index 5fe8fba3e..fbc13c230 100644
--- a/os/common/ports/ARMv8-M-ML-ALT/compilers/GCC/chcoreasm.S
+++ b/os/common/ports/ARMv8-M-ML-ALT/compilers/GCC/chcoreasm.S
@@ -285,6 +285,9 @@ SVC_Handler:
.Lctxswitch:
/* SVC called from privilege mode for context switch.*/
#else
+#if PORT_SAVE_CONTROL
+ mrs r12, CONTROL
+#endif
mrs r2, PSP /* Position of the exc.frame.*/
#endif
/* Retrieving pointers to old and new context from the
Thanks!