Skip to content

Commit fc870c1

Browse files
authored
Merge pull request #2999 from madeline-underwood/nxp2
Nxp2 reviewed
2 parents 2495d9d + ee0e347 commit fc870c1

8 files changed

Lines changed: 87 additions & 40 deletions

File tree

content/learning-paths/embedded-and-microcontrollers/observing-ethos-u-on-nxp/1-overview.md

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,13 @@
11
---
2-
title: Overview
2+
title: Understand ExecuTorch deployment on NXP with Ethos-U
33
weight: 2
44

55
### FIXED, DO NOT MODIFY
66
layout: learningpathall
77
---
88

9+
## Before you begin
10+
911
This Learning Path assumes your FRDM i.MX 93 board is already set up and you can transfer files between your host machine and the board.
1012

1113
If you still need to set up Linux, serial console access, and file transfer, follow the Learning Path [Linux on an NXP FRDM i.MX 93 board](/learning-paths/embedded-and-microcontrollers/linux-nxp-board/) before continuing.
@@ -19,11 +21,11 @@ The FRDM i.MX 93 platform combines:
1921

2022
This Learning Path focuses on a concrete milestone: successful bring-up of an ExecuTorch `executor_runner` firmware on Cortex-M33 on this NXP platform.
2123

22-
You keep the Linux side intentionally simple. Linux loads and starts the Cortex-M33 firmware through RemoteProc, and you stage a compiled ExecuTorch `.pte` model so the firmware can run it.
24+
This example keeps the Linux side intentionally simple. Linux loads and starts the Cortex-M33 firmware through RemoteProc, and you stage a compiled ExecuTorch `.pte` model so the firmware can run it.
2325

2426
## What you’ll build and validate
2527

26-
By the end of this Learning Path, you have:
28+
By the end of this Learning Path, you'll have:
2729

2830
- A `.pte` model artifact compiled for `ethos-u65-256`
2931
- A Cortex-M33 `executor_runner` firmware image built against prebuilt ExecuTorch libraries

content/learning-paths/embedded-and-microcontrollers/observing-ethos-u-on-nxp/10-deploy-executorchrunner-nxp-board.md

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@ weight: 11
66
layout: learningpathall
77
---
88

9+
## Deployment overview
10+
911
This section is where the heterogeneous system comes together.
1012
Linux on the application cores manages the lifecycle of Cortex-M33 through RemoteProc, and your Cortex-M33 firmware brings up ExecuTorch and the Ethos-U65 delegate.
1113

@@ -22,7 +24,7 @@ Before deploying, verify the following on your FRDM-IMX93 board:
2224
/dev/ethosu0
2325
```
2426

25-
If `/dev/ethosu0` does not exist, the NPU is not powered and the firmware will hang at NPU initialization.
27+
If `/dev/ethosu0` doesn't exist, the NPU isn't powered and the firmware will hang at NPU initialization.
2628

2729
2. **DDR memory is reserved for the CM33.** The NXP BSP reserves two DDR regions by default:
2830

@@ -120,10 +122,10 @@ The key indicators of a successful inference run:
120122
| `bus_status_error 0x0` | No AXI bus errors during NPU memory access |
121123
| `numel=1000` | MobileNet V2 output: 1000 ImageNet classification scores (one per class) |
122124

123-
The model runs with uninitialized input data, so the output scores do not correspond to a real image classification. To get meaningful predictions, feed a real 224x224 RGB image as input.
125+
The model runs with uninitialized input data, so the output scores don't correspond to a real image classification. To get meaningful predictions, feed a real 224x224 RGB image as input.
124126

125127
{{% notice Note %}}
126-
If the trace buffer shows `Program identifier '' != expected 'ET12'`, the `.pte` model was not loaded into DDR at `0xC0000000`. Reload the model using the steps above.
128+
If the trace buffer shows `Program identifier '' != expected 'ET12'`, the `.pte` model wasn't loaded into DDR at `0xC0000000`. Reload the model using the steps above.
127129
{{% /notice %}}
128130

129131
## Re-run inference
@@ -138,7 +140,7 @@ sleep 15
138140
cat /sys/kernel/debug/remoteproc/remoteproc0/trace0
139141
```
140142

141-
The trace buffer resets at the start of each firmware load, so you always see fresh output.
143+
The trace buffer resets at the start of each firmware load, so you'll always see fresh output.
142144

143145
## What you've accomplished and what's next
144146

content/learning-paths/embedded-and-microcontrollers/observing-ethos-u-on-nxp/2-boot-nxp.md

Lines changed: 16 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -7,15 +7,14 @@ weight: 3
77
# Do not modify these elements
88
layout: "learningpathall"
99
---
10+
## Connect to the board
1011

1112
This section walks through powering on the board and establishing a serial console connection. If your board is already running Linux and you can log in, skip ahead to the next section.
1213

13-
## Connect to the board
14-
1514
You need a serial terminal to see the boot console and log in.
1615

1716
{{% notice macOS %}}
18-
On macOS as your host, you will need the following set up before getting started:
17+
On macOS as your host, you'll need the following set up before getting started:
1918

2019
- Install the [Silicon Labs USB-to-UART driver](https://www.silabs.com/developer-tools/usb-to-uart-bridge-vcp-drivers?tab=downloads)
2120
- Install [picocom](https://github.com/npat-efault/picocom)
@@ -24,9 +23,9 @@ On macOS as your host, you will need the following set up before getting started
2423
```
2524
{{% /notice %}}
2625

27-
1. Connect the board's "DEBUG" USB-C connector to your host machine.
26+
Connect the board's **DEBUG** USB-C connector to your host machine.
2827

29-
2. Find the board's serial device:
28+
Find the board's serial device:
3029

3130
```bash { output_lines = "2-5" }
3231
ls /dev/tty.*
@@ -38,7 +37,7 @@ On macOS as your host, you will need the following set up before getting started
3837

3938
The exact device names vary per board. Look for entries containing `usbmodem`.
4039

41-
3. Open a serial connection using the first `usbmodem` device:
40+
Open a serial connection using the first `usbmodem` device:
4241

4342
```bash { output_lines = "2-4" }
4443
sudo picocom -b 115200 /dev/tty.usbmodem<SERIAL_ID_1>
@@ -47,9 +46,9 @@ On macOS as your host, you will need the following set up before getting started
4746
Terminal ready
4847
```
4948

50-
4. Connect the board's "POWER" USB-C connector to your host machine. You should see a red and a white LED on the board.
49+
Connect the board's **POWER** USB-C connector to your host machine. You should see a red and a white LED on the board.
5150

52-
5. Wait for the boot log to scroll past in the picocom window. When it finishes, you see a login prompt:
51+
Wait for the boot log to scroll past in the picocom window. When it finishes, you'll see a login prompt:
5352

5453
```output
5554
NXP i.MX Release Distro 6.6-scarthgap imx93frdm ttyLP0
@@ -61,10 +60,18 @@ On macOS as your host, you will need the following set up before getting started
6160
If you miss the login prompt, hold the board's power button for two seconds to power off, then press it again to reboot.
6261
{{% /notice %}}
6362

64-
## [Optional] Run the built-in NXP demos
63+
## Run the built-in NXP demos (optional)
6564

6665
Connect the board to a monitor via HDMI and plug a mouse into the board's USB-A port. NXP includes several ML demos that run out of the box.
6766

6867
![NXP board built-in ML demos alt-text#center](./nxp-board-built-in-ml-demos.png "NXP board built-in ML demos")
6968

69+
## What you've learned and what's next
70+
71+
In this section you've:
72+
73+
- Connected to the board via serial console
74+
- Booted the NXP FRDM i.MX 93 board and confirmed Linux is running
75+
- Verified you can access the login prompt
76+
7077
With the board running and Linux accessible, the next step is setting up the build environment for ExecuTorch.

content/learning-paths/embedded-and-microcontrollers/observing-ethos-u-on-nxp/4-environment-setup.md

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
---
22
# User change
3-
title: "Environment setup"
3+
title: "Set up the ExecuTorch build environment"
44

55
weight: 5 # 1 is first, 2 is second, etc.
66

77
# Do not modify these elements
88
layout: "learningpathall"
99
---
1010

11-
## For macOS: Build ExecuTorch in a Docker container
11+
## For macOS: build ExecuTorch in a Docker container
1212

1313
On macOS, it’s easiest to build ExecuTorch in an Ubuntu container. This keeps your toolchain consistent with the rest of the Learning Path and avoids gaps in macOS-native cross-compilers (for example, the Arm GNU Toolchain doesn’t provide an “AArch64 GNU/Linux target” for macOS).
1414

@@ -133,4 +133,12 @@ The `EthosUCompileSpec` parameters used in this guide:
133133
| `memory_mode` | `Shared_Sram` | Uses shared SRAM memory mode |
134134
{{% /notice %}}
135135

136+
## What you've learned and what's next
137+
138+
In this section you've:
139+
140+
- Set up an Ubuntu 24.04 Docker container for building ExecuTorch (macOS users)
141+
- Installed required dependencies and created a Python virtual environment
142+
- Cloned the ExecuTorch repository and checked out the correct version
143+
136144
With your build environment configured and the ExecuTorch source checked out, the next step is building and installing the ExecuTorch package.

content/learning-paths/embedded-and-microcontrollers/observing-ethos-u-on-nxp/6-build-executorch.md

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,15 @@
11
---
22
# User change
3-
title: "Build ExecuTorch"
3+
title: "Build and install ExecuTorch"
44

55
weight: 7 # 1 is first, 2 is second, etc.
66

77
# Do not modify these elements
88
layout: "learningpathall"
99
---
1010

11+
## Overview
12+
1113
With the ExecuTorch source checked out and your virtual environment active, you can now build ExecuTorch and set up the Arm toolchain for Ethos-U cross-compilation.
1214

1315
For a full tutorial on building ExecuTorch, see the Learning Path [Introduction to TinyML on Arm using PyTorch and ExecuTorch](/learning-paths/embedded-and-microcontrollers/introduction-to-tinyml-on-arm/).
@@ -72,4 +74,12 @@ git submodule update --init --recursive
7274
```
7375
{{% /notice %}}
7476

77+
## What you've learned and what's next
78+
79+
In this section you've:
80+
81+
- Installed the ExecuTorch package and verified its availability
82+
- Set up the Arm toolchain with Ethos-U support
83+
- Configured the environment for cross-compiling to Ethos-U65
84+
7585
With ExecuTorch installed and the Arm toolchain configured, you can now compile `.pte` model files targeting the Ethos-U65 NPU.

content/learning-paths/embedded-and-microcontrollers/observing-ethos-u-on-nxp/7-build-executorch-pte.md

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,16 @@
11
---
22
# User change
3-
title: "Build the ExecuTorch .pte"
3+
title: "Build ExecuTorch models for Ethos-U65"
44

55
weight: 8 # 1 is first, 2 is second, etc.
66

77
# Do not modify these elements
88
layout: "learningpathall"
99
---
1010

11-
On the FRDM i.MX 93, you deploy ExecuTorch as two cooperating artifacts:
11+
## ExecuTorch deployment components
12+
13+
On the FRDM i.MX93, you deploy ExecuTorch as two cooperating artifacts:
1214

1315
|Component|Role in Deployment|What It Contains|Why It's Required|
1416
|---------|------------------|----------------|-----------------|
@@ -266,5 +268,13 @@ For the commands above:
266268
- Replace `<SD_CARD_NAME>` with the mounted volume name.
267269
{{% /notice %}}
268270
269-
With both `.pte` files staged on the SD card, you can now build the Cortex-M33 `executor_runner` firmware that will load and execute them.
271+
## What you've learned and what's next
272+
273+
In this section you've:
274+
275+
- Compiled a simple add model to verify the Ethos-U65 toolchain setup
276+
- Built a MobileNet V2 `.pte` file with 100% NPU operator coverage
277+
- Staged the models on your SD card for deployment
278+
279+
With both `.pte` files ready, you can now build the Cortex-M33 `executor_runner` firmware that will load and execute them.
270280

content/learning-paths/embedded-and-microcontrollers/observing-ethos-u-on-nxp/9-build-executorch-runner-for-cm33.md

Lines changed: 17 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,16 @@
11
---
2-
title: Build the executor_runner firmware
2+
title: Build Cortex-M33 firmware for ExecuTorch
33
weight: 10
4-
5-
### FIXED, DO NOT MODIFY
4+
# FIXED, DO NOT MODIFY
65
layout: learningpathall
76
---
8-
You build the Cortex-M33 `executor_runner` firmware on your host machine, then deploy it to the FRDM i.MX 93 board.
97

10-
This is the core milestone of the Learning Path.
8+
## ExecuTorch deployment components
9+
10+
In this section, you build the Cortex-M33 `executor_runner` firmware. You then deploy it to the FRDM i.MX 93 board.
11+
12+
This is a key milestone. You're proving you can control the real-time ML runtime for Ethos-U65 workloads.
13+
1114
On i.MX 93, Linux runs on the application cores, but the real-time ML runtime that talks to Ethos-U65 runs as **firmware on Cortex-M33**.
1215
When you can build and boot your own `executor_runner`, you've proven that the microcontroller side of the system is under your control and ready to host ML workloads.
1316

@@ -243,4 +246,13 @@ The quantized operator kernels are not linked. Verify that `CMakeLists.txt` link
243246

244247
{{% /notice %}}
245248

249+
## What you've learned and what's next
250+
251+
In this section you've:
252+
253+
- Set up MCUXpresso for VS Code with the SDK and Arm toolchain
254+
- Cloned the executor_runner project with prebuilt ExecuTorch libraries
255+
- Applied critical SDK patches for GOT initialization and NPU logging
256+
- Built the Cortex-M33 firmware and verified it fits within memory constraints
257+
246258
With the firmware binary built and its memory usage verified, you're ready to deploy it to the FRDM i.MX 93 and run your first inference.

content/learning-paths/embedded-and-microcontrollers/observing-ethos-u-on-nxp/_index.md

Lines changed: 9 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,20 @@
11
---
22
title: Deploy ExecuTorch firmware on NXP FRDM i.MX 93 for Ethos-U65 acceleration
33

4-
draft: true
5-
cascade:
6-
draft: true
7-
84
minutes_to_complete: 120
95

10-
who_is_this_for: This is an introductory topic for developers and data scientists new to Tiny Machine Learning (TinyML), who want to observe ExecuTorch performance on a physical device.
6+
who_is_this_for: This is an introductory topic for developers and data scientists new to TinyML who want to observe ExecuTorch performance on a physical device.
117

128
learning_objectives:
13-
- Bring up a custom ExecuTorch `executor_runner` firmware on the FRDM i.MX 93 Cortex-M33 using Linux RemoteProc.
14-
- Compile an ExecuTorch `.pte` model for Ethos-U65 and run inference with NPU acceleration.
15-
- Understand how heterogeneous Arm systems split responsibilities across application cores, microcontrollers, and NPUs.
9+
- Bring up a custom ExecuTorch `executor_runner` firmware on the FRDM i.MX 93 Cortex-M33 using Linux RemoteProc
10+
- Compile an ExecuTorch `.pte` model for Ethos-U65 and run inference with NPU acceleration
11+
- Understand how heterogeneous Arm systems split responsibilities across application cores, microcontrollers, and NPUs
1612
prerequisites:
17-
- An NXP [FRDM i.MX 93](https://www.nxp.com/design/design-center/development-boards-and-designs/frdm-i-mx-93-development-board:FRDM-IMX93) development board.
18-
- A USB Mini-B to USB Type-A cable, or a USB Mini-B to USB Type-C cable.
19-
- Completion of [Linux on an NXP FRDM i.MX 93 board](/learning-paths/embedded-and-microcontrollers/linux-nxp-board/) (Linux setup, login access, and file transfer).
20-
- Basic knowledge of Machine Learning concepts.
21-
- A host computer to compile ExecuTorch libraries.
13+
- An NXP [FRDM i.MX 93](https://www.nxp.com/design/design-center/development-boards-and-designs/frdm-i-mx-93-development-board:FRDM-IMX93) development board
14+
- A USB Mini-B to USB Type-A cable, or a USB Mini-B to USB Type-C cable
15+
- Completion of [Use Linux on an NXP FRDM i.MX 93 board](/learning-paths/embedded-and-microcontrollers/linux-nxp-board/) (Linux setup, login access, and file transfer)
16+
- Basic knowledge of Machine Learning concepts
17+
- A host computer to compile ExecuTorch libraries
2218

2319
author:
2420
- Waheed Brown

0 commit comments

Comments
 (0)