Skip to content

Commit eeb3a3f

Browse files
committed
feat: moved to CMSIS 6.2.0
Add new package CMSIS-DSP and CMSIS-NN. Signed-off-by: Frederic Pillon <frederic.pillon@st.com>
1 parent dfdf369 commit eeb3a3f

File tree

3 files changed

+18
-6
lines changed

3 files changed

+18
-6
lines changed

CI/update/stm32wrapper.py

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,9 @@
1919
system_path = ""
2020

2121
# CMSIS outside of the core. Can be updated by arg
22-
CMSIS_path = core_path.parent / "ArduinoModule-CMSIS" / "CMSIS_5"
22+
# CMSIS_VERSION = "CMSIS_5"
23+
CMSIS_VERSION = "CMSIS_6"
24+
CMSIS_path = core_path.parent / "ArduinoModule-CMSIS" / CMSIS_VERSION
2325
CMSIS_DSPSrc_path = ""
2426

2527
# Out sources files
@@ -82,7 +84,7 @@ def checkConfig(arg_core, arg_cmsis):
8284

8385
if arg_core is not None:
8486
core_path = Path(arg_core).resolve()
85-
CMSIS_path = core_path.parent / "ArduinoModule-CMSIS" / "CMSIS_5"
87+
CMSIS_path = core_path.parent / "ArduinoModule-CMSIS" / CMSIS_VERSION
8688

8789
if not core_path.is_dir():
8890
print(f"Could not find {core_path}")
@@ -103,7 +105,11 @@ def checkConfig(arg_core, arg_cmsis):
103105

104106
if arg_cmsis is not None:
105107
CMSIS_path = Path(arg_cmsis).resolve()
106-
CMSIS_DSPSrc_path = CMSIS_path / "CMSIS" / "DSP" / "Source"
108+
109+
if CMSIS_VERSION == "CMSIS_6":
110+
CMSIS_DSPSrc_path = CMSIS_path / ".." / "CMSIS-DSP" / "Source"
111+
else:
112+
CMSIS_DSPSrc_path = CMSIS_path / "CMSIS" / "DSP" / "Source"
107113

108114

109115
def printCMSISStartup(log):
@@ -289,13 +295,16 @@ def wrap(arg_core, arg_cmsis, log):
289295
print("CMSIS DSP generation skipped.")
290296
else:
291297
# Delete all subfolders
292-
deleteFolder(CMSIS_DSP_outSrc_path / "*")
298+
for path_object in CMSIS_DSP_outSrc_path.glob("*"):
299+
if path_object.is_dir():
300+
deleteFolder(path_object)
293301
for path_object in CMSIS_DSPSrc_path.glob("**/*"):
294302
if path_object.is_file() and path_object.name.endswith(".c"):
295303
dn = path_object.parent.name
296304
fn = path_object.name
297305
if dn in fn:
298306
fdn = CMSIS_DSP_outSrc_path / dn
307+
createFolder(fdn)
299308
with open(fdn / (f"{fn}"), "w", newline="\n") as out_file:
300309
out_file.write(
301310
dsp_file_template.render(dsp_dir=dn, dsp_name=fn)
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
#include "../Source/WindowFunctions/WindowFunctions.c"

platform.txt

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,9 @@ tools_bin_path.linux={runtime.tools.STM32Tools.path}/linux
2525

2626
core_stm32_dir={build.core.path}/stm32
2727
hal_dir={build.system.path}/Drivers/{build.series}_HAL_Driver
28-
cmsis_dir={runtime.tools.CMSIS-5.9.0.path}/CMSIS
28+
cmsis_dir={runtime.tools.CMSIS-6.2.0.path}/CMSIS
29+
cmsis_dsp={runtime.tools.CMSIS_DSP-1.16.2.path}
30+
cmsis_nn={runtime.tools.CMSIS_NN-7.0.0.path}
2931
cmsis_dev_dir={build.system.path}/Drivers/CMSIS/Device/ST/{build.series}
3032
usbd_core_dir={build.system.path}/Middlewares/ST/STM32_USB_Device_Library/Core
3133
builtin_library_dir={build.core.path}/../../libraries
@@ -37,7 +39,7 @@ USBDevice_include_dir={builtin_library_dir}/USBDevice/inc
3739
# STM compile variables
3840
# ----------------------
3941
compiler.stm.extra_include="-I{build.source.path}" "-I{build.core.path}/avr" "-I{core_stm32_dir}" "-I{SrcWrapper_include_dir}" "-I{SrcWrapper_include_dir}/LL" "-I{hal_dir}/Inc" "-I{hal_dir}/Src" "-I{build.system.path}/{build.series}" "-I{USBDevice_include_dir}" "-I{usbd_core_dir}/Inc" "-I{usbd_core_dir}/Src" "-I{VirtIO_include_dir}" {build.virtio_extra_include}
40-
compiler.arm.cmsis.c.flags="-I{cmsis_dir}/Core/Include/" "-I{cmsis_dev_dir}/Include/" "-I{cmsis_dev_dir}/Source/Templates/gcc/" "-I{cmsis_dir}/DSP/Include" "-I{cmsis_dir}/DSP/PrivateInclude"
42+
compiler.arm.cmsis.c.flags="-I{cmsis_dir}/Core/Include/" "-I{cmsis_dev_dir}/Include/" "-I{cmsis_dev_dir}/Source/Templates/gcc/" "-I{cmsis_dsp}/Include" "-I{cmsis_dsp}/PrivateInclude"
4143

4244
compiler.warning_flags=-w
4345
compiler.warning_flags.none=-w

0 commit comments

Comments
 (0)