From a08ba4d488420f00782814c1b9db0ec05efb9049 Mon Sep 17 00:00:00 2001 From: Frederic Pillon Date: Wed, 23 Feb 2022 18:00:40 +0100 Subject: [PATCH 1/2] feat: support STM32WL family Fixes #44 Signed-off-by: Frederic Pillon --- src/port.c | 5 +++++ src/portmacro.h | 5 +++++ 2 files changed, 10 insertions(+) diff --git a/src/port.c b/src/port.c index 432f0f0..6857410 100644 --- a/src/port.c +++ b/src/port.c @@ -23,6 +23,10 @@ #endif #if (__CORTEX_M == 4U) +#if (__FPU_PRESENT == 0) +/* Fallback to CM3 port as there is no FPU */ +#include "../portable/GCC/ARM_CM3/port.c" +#else /* MPU not supported */ #if 0 /*(__MPU_PRESENT == 1)*/ #include "../portable/GCC/ARM_CM4_MPU/port.c" @@ -30,6 +34,7 @@ #include "../portable/GCC/ARM_CM4F/port.c" #endif #endif +#endif #if (__CORTEX_M == 7U) /* MPU not supported */ diff --git a/src/portmacro.h b/src/portmacro.h index 51cd339..f06372c 100644 --- a/src/portmacro.h +++ b/src/portmacro.h @@ -28,6 +28,10 @@ inline __attribute__(( always_inline )) static BaseType_t xPortIsInsideInterrupt #endif #if (__CORTEX_M == 4U) +#if (__FPU_PRESENT == 0) +/* Fallback to CM3 port as there is no FPU */ +#include "../portable/GCC/ARM_CM3/portmacro.h" +#else /* MPU not supported */ #if 0 /*(__MPU_PRESENT == 1)*/ #include "../portable/GCC/ARM_CM4_MPU/portmacro.h" @@ -35,6 +39,7 @@ inline __attribute__(( always_inline )) static BaseType_t xPortIsInsideInterrupt #include "../portable/GCC/ARM_CM4F/portmacro.h" #endif #endif +#endif #if (__CORTEX_M == 7U) /* MPU not supported */ From 8016ac2614dd11d71eebf2a60321d21468c6991c Mon Sep 17 00:00:00 2001 From: Alexandre Bourdiol Date: Fri, 25 Feb 2022 15:50:34 +0100 Subject: [PATCH 2/2] fix: support STM32WL family It happens on STM32WL that case 4 fails. And it seems to be linked to LiuLayland theoritical bound value, which is based on ideal system. It doesn't take into account things like RTOS task swap, ... So take more margin for case 4 by decreasing the cpu load of one task, so that global CPU moves away from theoretical bound. Signed-off-by: Alexandre Bourdiol --- examples/frLiuLayland/frLiuLayland.ino | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/frLiuLayland/frLiuLayland.ino b/examples/frLiuLayland/frLiuLayland.ino index ec8d7d4..723122b 100644 --- a/examples/frLiuLayland/frLiuLayland.ino +++ b/examples/frLiuLayland/frLiuLayland.ino @@ -31,7 +31,7 @@ struct task_t { task_t tasks1[] = {{10, 5, 2}, {15, 6, 1}}; task_t tasks2[] = {{10, 5, 2}, {15, 4, 1}}; task_t tasks3[] = {{10, 3, 3}, {13, 4, 2}, {17, 4, 1}}; -task_t tasks4[] = {{10, 3, 3}, {13, 4, 2}, {17, 2, 1}}; +task_t tasks4[] = {{10, 3, 3}, {13, 4, 2}, {17, 1, 1}}; task_t* taskList[] = {tasks1, tasks2, tasks3, tasks4}; int taskCount[] = {2, 2, 3, 3}; //------------------------------------------------------------------------------