From 5438b967aa70adf1f850ec874b958e7c64fc8101 Mon Sep 17 00:00:00 2001 From: Joachim Krech <8290187+jkrech@users.noreply.github.com> Date: Mon, 5 Oct 2026 08:50:03 +0200 Subject: [PATCH 1/5] Update cmsis-executorch.csolution.yml Make CMSIS-Toolbox 2.15.0 the minimum version As a result remove the misc flags for CLANG Make debug adapter work for FVP on Windows and Linux out of the box. --- cmsis-executorch.csolution.yml | 18 ++++-------------- 1 file changed, 4 insertions(+), 14 deletions(-) diff --git a/cmsis-executorch.csolution.yml b/cmsis-executorch.csolution.yml index 8f034c95..46ff2172 100644 --- a/cmsis-executorch.csolution.yml +++ b/cmsis-executorch.csolution.yml @@ -12,7 +12,7 @@ # create_ai_layer.py reads the NPU and Vela settings from it, exports the model # from PyTorch in the project's venv and writes the AI layer. solution: - created-for: CMSIS-Toolbox@2.14.1 + created-for: CMSIS-Toolbox@2.15.0 cdefault: compiler: AC6 @@ -45,22 +45,12 @@ solution: # not started from a `vcpkg activate` shell, line-buffers the # model's stdout so the debug adapter sees the "Listening" banner, # and on macOS runs the model in Docker (Arm ships no macOS build). - # On Windows point this straight at FVP_Corstone_SSE-320.exe. - model: ${workspaceFolder}/.vscode/fvp.sh + # model: ${workspaceFolder}/.vscode/fvp.sh + # On Windows and Linux point this straight at FVP_Corstone_SSE-320. + model: FVP_Corstone_SSE-320 config-file: board/Corstone-320/fvp_config.txt args: "--simlimit 60" - misc: - # CMSIS-Toolbox 2.14.1 passes -mfpu=fpv5-sp-d16 to Clang for the Cortex-M85, - # a single-precision FPU on a core with a double-precision one and MVE; - # LLVM crashes on some kernels with that combination. The later option - # wins, so name the M85's FPU explicitly (newer toolboxes leave it to -mcpu). - - for-compiler: CLANG - C-CPP: - - -mfpu=fp-armv8-fullfp16-d16 - ASM: - - -mfpu=fp-armv8-fullfp16-d16 - build-types: - type: Debug debug: on From 4f44052c2d833c161d4ad1b7f4a1ecb8693b539c Mon Sep 17 00:00:00 2001 From: Joachim Krech <8290187+jkrech@users.noreply.github.com> Date: Mon, 5 Oct 2026 08:54:31 +0200 Subject: [PATCH 2/5] Rename launch.json to launch.json.mac macOS user need to remove the .mac extension --- .vscode/{launch.json => launch.json.mac} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename .vscode/{launch.json => launch.json.mac} (100%) diff --git a/.vscode/launch.json b/.vscode/launch.json.mac similarity index 100% rename from .vscode/launch.json rename to .vscode/launch.json.mac From 73e57e3148ccb3b894874e1a92787a6a5dd7554b Mon Sep 17 00:00:00 2001 From: Joachim Krech <8290187+jkrech@users.noreply.github.com> Date: Mon, 5 Oct 2026 09:22:09 +0200 Subject: [PATCH 3/5] Update vcpkg-configuration.json use CMSIS-Toolbox 2.15.0 --- vcpkg-configuration.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/vcpkg-configuration.json b/vcpkg-configuration.json index 68cb2129..e6c91be3 100644 --- a/vcpkg-configuration.json +++ b/vcpkg-configuration.json @@ -7,7 +7,7 @@ } ], "requires": { - "arm:tools/open-cmsis-pack/cmsis-toolbox": "2.14.1", + "arm:tools/open-cmsis-pack/cmsis-toolbox": "2.15.1", "arm:compilers/arm/arm-none-eabi-gcc": "14.3.1", "arm:compilers/arm/llvm-embedded": "22.1.0", "arm:tools/kitware/cmake": "4.2.1", From 233bf14e24a534bf58de4b12d65b7f04ab798eae Mon Sep 17 00:00:00 2001 From: Joachim Krech <8290187+jkrech@users.noreply.github.com> Date: Mon, 5 Oct 2026 09:26:15 +0200 Subject: [PATCH 4/5] Update vcpkg-configuration.json --- vcpkg-configuration.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/vcpkg-configuration.json b/vcpkg-configuration.json index e6c91be3..e9340040 100644 --- a/vcpkg-configuration.json +++ b/vcpkg-configuration.json @@ -7,7 +7,7 @@ } ], "requires": { - "arm:tools/open-cmsis-pack/cmsis-toolbox": "2.15.1", + "arm:tools/open-cmsis-pack/cmsis-toolbox": "2.15.0", "arm:compilers/arm/arm-none-eabi-gcc": "14.3.1", "arm:compilers/arm/llvm-embedded": "22.1.0", "arm:tools/kitware/cmake": "4.2.1", From fd6675b132062e38cf39e2b6bf8e023c0f4e662d Mon Sep 17 00:00:00 2001 From: Matthias Hertel <11649409+MatthiasHertel80@users.noreply.github.com> Date: Tue, 6 Oct 2026 12:42:00 +0200 Subject: [PATCH 5/5] Document the macOS FVP route now that the model is run directly With `model: FVP_Corstone_SSE-320` the extension generates launch.json on Windows and Linux, so .gitignore keeps launch.json.mac instead of launch.json (the regenerated file showed up as untracked). The README, the csolution, fvp.sh, launch.json.mac and mlops-flow.md now describe fvp.sh plus launch.json.mac as the macOS setup rather than the default, and the README asks for CMSIS-Toolbox 2.15.0. --- .gitignore | 11 ++++++----- .vscode/fvp.sh | 13 +++++++------ .vscode/launch.json.mac | 4 ++++ README.md | 22 +++++++++++----------- cmsis-executorch.csolution.yml | 10 ++++------ documentation/mlops-flow.md | 2 +- 6 files changed, 33 insertions(+), 29 deletions(-) diff --git a/.gitignore b/.gitignore index 0a0cfc37..b978bff9 100644 --- a/.gitignore +++ b/.gitignore @@ -74,12 +74,13 @@ tmp/ fvp_stdout.log # Editor config. The CMSIS Solution extension regenerates tasks.json, -# settings.json and cmsis.json; only the FVP run/debug wiring is kept: the -# model shim + its Dockerfile, and launch.json, whose Arm-FVP launch config is -# "manual" (see the comment in it). The leading negation overrides a global -# excludes file that ignores every .vscode directory. +# settings.json, cmsis.json and launch.json; only the macOS FVP wiring is kept: +# the model shim + its Dockerfile, and launch.json.mac, an Arm-FVP launch +# config that waits for the model in Docker (see the comment in it). The +# leading negation overrides a global excludes file that ignores every .vscode +# directory. !.vscode/ .vscode/* !.vscode/fvp.sh !.vscode/fvp.Dockerfile -!.vscode/launch.json +!.vscode/launch.json.mac diff --git a/.vscode/fvp.sh b/.vscode/fvp.sh index a10d35f8..918d6608 100755 --- a/.vscode/fvp.sh +++ b/.vscode/fvp.sh @@ -1,8 +1,9 @@ #!/usr/bin/env bash -# Stand-in for the FVP_Corstone_SSE-320 executable, referenced from the -# `debugger: model:` node of the SSE-320-U85 target-set. The CMSIS Solution -# extension runs it both as the "CMSIS Run" task and as the gdbtarget debug -# server, in the latter case with +# Stand-in for the FVP_Corstone_SSE-320 executable on macOS, where the +# `debugger: model:` node of the SSE-320-U85 target-set points at it (see the +# README). The CMSIS Solution extension runs it both as the "CMSIS Run" task +# and as the gdbtarget debug server (.vscode/launch.json.mac), in the latter +# case with # # -D --plugin $AVH_FVP_PLUGINS/GDBServer.so -C GDBServer.port=3333 \ # -f board/Corstone-320/fvp_config.txt --simlimit 60 -a .hex @@ -15,8 +16,8 @@ # * runs the model in Docker on macOS, where Arm publishes no FVP build, with # the GDB port forwarded to the host so arm-none-eabi-gdb can reach it. # -# On Linux it just execs the real model. On Windows, where the extension cannot -# run a bash script, point the csolution's `model:` at FVP_Corstone_SSE-320.exe. +# On Linux it just execs the real model. Windows and Linux need no shim: the +# csolution's `model:` names FVP_Corstone_SSE-320 directly. set -euo pipefail MODEL="${FVP_MODEL:-FVP_Corstone_SSE-320}" diff --git a/.vscode/launch.json.mac b/.vscode/launch.json.mac index 5aa8d67f..03b36379 100644 --- a/.vscode/launch.json.mac +++ b/.vscode/launch.json.mac @@ -2,6 +2,10 @@ "version": "0.2.0", "configurations": [ { + // macOS only: copy this file to .vscode/launch.json after pointing + // the csolution's `debugger: model:` at .vscode/fvp.sh. On Windows + // and Linux the extension generates a working launch.json itself. + // // Generated by the CMSIS Solution extension from its Arm-FVP adapter // template, then switched to "manual" because two "target" fields // differ from the generated ones and would be lost on regeneration: diff --git a/README.md b/README.md index 22bcc473..54bcdf6d 100644 --- a/README.md +++ b/README.md @@ -4,7 +4,7 @@ This example shows how to deploy and run an [ExecuTorch](https://github.com/pytorch/executorch) model on an Arm Ethos-U NPU. The pack [`PyTorch::ExecuTorch`](https://www.keil.arm.com/packs/executorch-pytorch/) provides the source code components to build the ExecuTorch runtime, required operators, and Ethos-U backend. -The build process uses the [CMSIS-Toolbox 2.14.1](https://open-cmsis-pack.github.io/cmsis-toolbox/) or higher. +The build process uses the [CMSIS-Toolbox 2.15.0](https://open-cmsis-pack.github.io/cmsis-toolbox/) or higher. This example application targets the Arm Corstone-320 reference platform with an Ethos-U85 NPU. It demonstrates the same overall workflow used for other @@ -59,11 +59,12 @@ The example can be built and run entirely in Keil Studio for VS Code. changing the model or the target. 5. Use the CMSIS action buttons to build the application, then select **Run** or **Debug**. Keil Studio starts the Corstone-320 FVP automatically. On macOS, - where Arm ships no FVP build, `.vscode/fvp.sh` runs the model in Docker: - Docker Desktop must be running, and the first Run or Debug builds the - container image (about 100 MB download). On Windows, set `model:` in the - csolution's target-set back to `FVP_Corstone_SSE-320` (the shim is a bash - script). + where Arm ships no FVP build, run the model in Docker instead: set `model:` + in the csolution's target-set to `${workspaceFolder}/.vscode/fvp.sh` and + copy `.vscode/launch.json.mac` to `.vscode/launch.json` (its debug + configuration waits for the model to come up in the container). Docker + Desktop must be running, and the first Run or Debug builds the container + image (about 100 MB download). A successful run prints the Ethos-U configuration, output logits, and a pass result: @@ -152,14 +153,13 @@ out/cmsis-executorch/SSE-320-U85/Debug/cmsis-executorch.axf #### 4. Run on the FVP ```bash -.vscode/fvp.sh \ +FVP_Corstone_SSE-320 \ -f board/Corstone-320/fvp_config.txt --simlimit 60 \ -a out/cmsis-executorch/SSE-320-U85/Debug/cmsis-executorch.axf ``` -`.vscode/fvp.sh` is the model command the Run and Debug buttons use too; on -Linux and Windows `FVP_Corstone_SSE-320` can be called directly with the same -arguments. +This is the model command the Run and Debug buttons use too. On macOS, call +`.vscode/fvp.sh` with the same arguments; it runs the model in Docker. ## How model generation works @@ -238,7 +238,7 @@ together. More information is available in | `ai_layer/` | Generated: component selection and the embedded model data | | `setup_venv.py` (`.sh` / `.bat`) | Creates the Python environment for the export | | `.vscode.d/tasks.json` | The VS Code tasks (venv setup, Create AI layer) merged by the CMSIS Solution extension | -| `.vscode/fvp.sh`, `.vscode/fvp.Dockerfile` | The FVP model command used by Run and Debug; runs the model in Docker on macOS | +| `.vscode/fvp.sh`, `.vscode/fvp.Dockerfile`, `.vscode/launch.json.mac` | macOS only: runs the FVP in Docker, and the debug configuration that waits for it | | `board/Corstone-320/` | Corstone-320 platform support and FVP configuration | | `src/app_main.cpp` | Loads the model, runs inference, and prints the result; pool sizes overridable with `APP_METHOD_POOL_SIZE`, `APP_TEMP_POOL_SIZE`, `APP_POOL_SECTION` | | `src/arm_embedded_module.*` | `EmbeddedModule`: ExecuTorch's `Module` class without the POSIX file loading (BSD-3-Clause, `src/LICENSE-ExecuTorch`) | diff --git a/cmsis-executorch.csolution.yml b/cmsis-executorch.csolution.yml index 46ff2172..89a55385 100644 --- a/cmsis-executorch.csolution.yml +++ b/cmsis-executorch.csolution.yml @@ -41,12 +41,10 @@ solution: debugger: name: Arm-FVP # The model is its own GDB server (plugins/GDBServer.so, MDK FVP - # models 11.32.23+). fvp.sh resolves that plugin when VS Code was - # not started from a `vcpkg activate` shell, line-buffers the - # model's stdout so the debug adapter sees the "Listening" banner, - # and on macOS runs the model in Docker (Arm ships no macOS build). - # model: ${workspaceFolder}/.vscode/fvp.sh - # On Windows and Linux point this straight at FVP_Corstone_SSE-320. + # models 11.32.23+). On Windows and Linux the FVP from vcpkg runs + # as it is. On macOS, where Arm ships no FVP build, set this to + # ${workspaceFolder}/.vscode/fvp.sh, which runs the model in + # Docker, and copy .vscode/launch.json.mac to .vscode/launch.json. model: FVP_Corstone_SSE-320 config-file: board/Corstone-320/fvp_config.txt args: "--simlimit 60" diff --git a/documentation/mlops-flow.md b/documentation/mlops-flow.md index a8cd8739..dd46e9a3 100644 --- a/documentation/mlops-flow.md +++ b/documentation/mlops-flow.md @@ -61,7 +61,7 @@ cbuild-mlops: output: - file: out/cmsis-executorch/SSE-320-U85/Debug/cmsis-executorch.axf type: elf - model: ${workspaceFolder}/.vscode/fvp.sh + model: FVP_Corstone_SSE-320 config-file: board/Corstone-320/fvp_config.txt ```