Skip to content

Commit 4482ca0

Browse files
committed
[freertos] Add CM33 support
1 parent 3596c83 commit 4482ca0

File tree

2 files changed

+17
-0
lines changed

2 files changed

+17
-0
lines changed

ext/aws/FreeRTOSConfig.h.in

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,16 @@ See http://www.FreeRTOS.org/RTOS-Cortex-M3-M4.html. */
9393
#ifndef configUSE_16_BIT_TICKS
9494
# define configUSE_16_BIT_TICKS 0
9595
#endif
96+
// required for Cortex M23/M33 ports
97+
#ifndef configENABLE_FPU
98+
# define configENABLE_FPU {{ 1 if with_fpu else 0 }}
99+
#endif
100+
#ifndef configENABLE_MPU
101+
# define configENABLE_MPU 0
102+
#endif
103+
#ifndef configENABLE_TRUSTZONE
104+
# define configENABLE_TRUSTZONE 0
105+
#endif
96106

97107
/* Defaulted by FreeRTOS but changed by modm */
98108

ext/aws/module.lb

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,9 +96,12 @@ def build(env):
9696
"frequency": env.get("frequency", 1000),
9797
"with_debug": env.has_module(":debug"),
9898
"with_heap": env.has_module(":platform:heap"),
99+
"with_fpu": env.get(":platform:cortex-m:float-abi", "soft") != "soft",
99100
}
100101
path = core.replace("cortex-m", "ARM_CM").replace("+", "").replace("fd", "f").upper()
101102
path = path.replace("CM7F", "CM7/r0p1") # use subfolder for M7
103+
path = path.replace("CM33F", "CM33") # common port for FPU/non-FPU version
104+
path = path.replace("CM33", "CM33_NTZ/non_secure") # no trustzone supported, use non_secure subfolder
102105
path = "freertos/FreeRTOS/Source/portable/GCC/{}".format(path)
103106

104107
env.outbasepath = "modm/ext"
@@ -112,6 +115,10 @@ def build(env):
112115
env.copy("{}/port.c".format(path), "freertos/port.c")
113116
# Copy the portmacro.h file
114117
env.copy("{}/portmacro.h".format(path), "freertos/inc/freertos/portmacro.h")
118+
# Copy the portasm.c/.h files for CM33
119+
if "CM33" in path:
120+
env.copy("{}/portasm.c".format(path), "freertos/portasm.c")
121+
env.copy("{}/portasm.h".format(path), "freertos/inc/freertos/portasm.h")
115122

116123
# Generate the FreeRTOSConfig.h file
117124
env.template("FreeRTOSConfig.h.in", "freertos/inc/freertos/FreeRTOSConfig.h")

0 commit comments

Comments
 (0)