-
Notifications
You must be signed in to change notification settings - Fork 834
Arm backend: Add Zephyr Cortex-M STM Nucleo n657x0_q example #17371
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Arm backend: Add Zephyr Cortex-M STM Nucleo n657x0_q example #17371
Conversation
Moves the Ethos-U driver config to Corstone FVPs board files. This enable smoother building different targets that will enable or not enable the Ethos-U drivers/backend depending on board. This makes it possible to build the example both for Ethos-U and Cortex-M only targets without change. Signed-off-by: Zingo Andersen <Zingo.Andersen@arm.com> Change-Id: I9a7092b3480b479111249f4d101c6f787e3923ed
🔗 Helpful Links🧪 See artifacts and rendered test results at hud.pytorch.org/pr/pytorch/executorch/17371
Note: Links to docs will display an error until the docs builds have been completed. ❌ 9 New Failures, 2 Pending, 14 Unrelated FailuresAs of commit 494784d with merge base 05da1af ( NEW FAILURES - The following jobs have failed:
FLAKY - The following jobs failed but were likely due to flakiness present on trunk:
BROKEN TRUNK - The following jobs failed but were present on the merge base:👉 Rebase onto the `viable/strict` branch to avoid these failures
This comment was automatically generated by Dr. CI and updates every 15 minutes. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR adds support for building and running ExecuTorch models on the STM Nucleo n657x0_q board, making the example compatible with both Ethos-U and Cortex-M only targets. The changes refactor the Ethos-U driver configuration from the main project configuration into board-specific files, allowing seamless building across different target platforms.
Changes:
- Added documentation for building and running models on STM Nucleo n657x0_q board
- Moved Ethos-U driver configuration to board-specific files for Corstone FVPs
- Fixed type casting issues for size_t and Error types to ensure proper printf formatting
Reviewed changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| zephyr/README.md | Added comprehensive instructions for STM Nucleo n657x0_q board setup and usage |
| zephyr/CMakeLists.txt | Added CMSIS-NN local path detection and disabled AOT quantized kernels to fix RTTI build issues |
| examples/arm/zephyr/src/arm_executor_runner.cpp | Added explicit type casts for size_t and Error types to fix printf format warnings |
| examples/arm/zephyr/prj.conf | Moved Ethos-U configuration to board-specific files and reduced default memory pool sizes |
| examples/arm/zephyr/boards/mps4_corstone320_fvp.conf | Created board-specific configuration enabling Ethos-U for Corstone 320 |
| examples/arm/zephyr/boards/mps3_corstone300_fvp.conf | Created board-specific configuration enabling Ethos-U for Corstone 300 |
| examples/arm/zephyr/CMakeLists.txt | Removed explicit CONF_FILE setting to allow board-specific configurations |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| west build -b nucleo_n657x0_q modules/lib/executorch/examples/arm/zephyr -- -DET_PTE_FILE_PATH=add_m55.pte | ||
| west flash | ||
| ``` | ||
| This will run the simple add model on your hardware one and print the output on the serial consol. |
Copilot
AI
Feb 11, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Corrected spelling of 'consol' to 'console'.
| This will run the simple add model on your hardware one and print the output on the serial consol. | |
| This will run the simple add model on your hardware one and print the output on the serial console. |
|
|
||
| # Add model specific configs | ||
|
|
||
| # Setup memory requirements to scale with the compiled model/network. |
Copilot
AI
Feb 11, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The memory pool sizes have been dramatically reduced from 262144 and 1572864 bytes to 2000 bytes each. The comment states these should 'scale with the compiled model/network', but 2000 bytes seems insufficient for most models. Consider documenting that these are minimal defaults that should be adjusted per model, or provide guidance on sizing these values.
| # Setup memory requirements to scale with the compiled model/network. | |
| # Setup memory requirements to scale with the compiled model/network. | |
| # NOTE: The values below are minimal defaults chosen for this example only. | |
| # Most non-trivial models will require significantly larger pools. You should | |
| # increase these to match the memory requirements of your compiled model/network | |
| # (for example, based on profiling or tool-reported memory usage), and leave | |
| # additional headroom to avoid allocation failures at runtime. |
Summary
Add information in the zephyr readme on how to build and run
a model on STM Nucleo n657x0_q board.
Moves the Ethos-U driver config to Corstone FVPs board files.
This enable smoother building different targets that will enable
or not enable the Ethos-U drivers/backend depending on board.
This makes it possible to build the example both for Ethos-U
and Cortex-M only targets without change.
cc @freddan80 @per @oscarandersson8218 @digantdesai