You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 34608e3
Browse filesBrowse the repository at this point in the historyBrowse files
Fix Zephyr FVP memory layout and correct the tutorial (pytorch#22936)
### Summary
The Corstone-320 MobileNetV2 overlay assigns the same ISRAM origin to
XIP code and writable data, producing overlapping ELF sections and
preventing startup. Split the 4 MiB region into 512 KiB for code and 3.5
MiB for writable data, preserving the boot vectors in ITCM and the model
in DDR.
Update the tutorial and sample README to use ExecuTorch's standard FVP
environment, configure simulator options before CMake, and keep Alif and
FVP builds in separate directories. Correct the Alif dependencies and
export commands, and clarify CPU boundary operators, calibration, memory
reservations, and timing. The operator diagnostic now names the
namespaces it checks, since other CPU operators can still run.
Authored with AI assistance using OpenAI Codex.
### Test plan
Validation reused a prepared workspace with Zephyr 4.4.0, Zephyr SDK
1.0.1, and Corstone-320 FVP 11.27.25. After preparing the tutorial
workspace and exporting `mv2_u85_256.pte` for `ethos-u85-256`, the FVP
check can be repeated with:
```bash
source modules/lib/executorch/examples/arm/arm-scratch/setup_path.sh
export ARMFVP_EXTRA_FLAGS="--simlimit 10 -C mps4_board.subsystem.ethosu.num_macs=256"
west build -d build-fvp -b mps4/corstone320/fvp \
modules/lib/executorch/zephyr/samples/mv2-ethosu -- \
-DET_PTE_FILE_PATH=mv2_u85_256.pte
west build -d build-fvp -t run
```
The fresh sample build and FVP run passed, printing `MobileNetV2 Demo
Complete` and top-five class IDs `92, 21, 127, 22, 18`, matching PyTorch
for the same input. ELF inspection confirmed that code at `0x31000000`
and writable data at `0x31080000` no longer overlap. Fresh CMake
configuration also verified FVP discovery through `setup_path.sh`, the
captured MAC-count/simulation-limit options, and Zephyr's boot-vector
configuration.
CMake configuration with the U55 model on
`ensemble_e8_dk/ae822fa0e5597ls0/rtss_hp` verified the corrected
operator diagnostic. All 29 documentation shell blocks passed `bash -n`;
relative links, manifest/ATOC syntax, applicable lintrunner checks, and
`git diff --check` passed.
Alif flashing, inference, and hardware latency validation are pending.
@@ -347,7 +368,9 @@ open the serial terminal, and press reset:
347
368
picocom -b 115200 /dev/ttyACM0
348
369
```
349
370
350
-
Press the reset button on the E8 DevKit. You should see:
371
+
Press the reset button on the E8 DevKit. A representative log is shown below;
372
+
timing, model size, and scores vary with the model and software/hardware
373
+
configuration.
351
374
352
375
```
353
376
*** Booting Zephyr OS build v4.4.0 ***
@@ -392,13 +415,19 @@ Use `mv2_untrained` instead of `mv2` if you want to avoid downloading
392
415
pretrained weights. In that case the class scores are arbitrary and may all be
393
416
close to `0.0000`.
394
417
418
+
The reported inference time covers one `method->execute()` call, measured with
419
+
`k_uptime_get_32()`. Model loading, input preparation, and result reporting are
420
+
outside that interval. For hardware comparisons, record the software versions,
421
+
model, core/NPU configuration and clocks, and measurements over repeated runs.
422
+
395
423
## Troubleshooting
396
424
397
425
| Symptom | Cause | Fix |
398
426
|---------|-------|-----|
399
-
| Linker: `region 'FLASH' overflowed`|Model PTE too large for ITCM | Use the DDR overlay (FVP) or verify mramAddress (Alif)|
427
+
| Linker: `region 'FLASH' overflowed`|Code and model exceed the linked image region | Check the linker map and model placement: DDR on FVP, MRAM on Alif. Changing the ATOC address does not increase linker capacity.|
400
428
| Linker: `region 'RAM' overflowed`| Pools + model copy exceed SRAM | Set `CONFIG_ET_ARM_MODEL_PTE_DMA_ACCESSIBLE=y` to skip the SRAM copy |
401
-
| FVP hangs after "Ethos-U backend registered" | Cycle-accurate MV2 simulation is slow | Wait 10-20 min, or use Corstone-320 (faster than 300) |
429
+
| No Zephyr startup banner on FVP | Incorrect boot or memory layout | Check the ELF addresses and use the Corstone-320 sample overlay with separate regions for code and writable data. |
430
+
| FVP exits before the demo completes | Simulation limit too short, configuration mismatch, or runtime failure | Inspect the console, check the exported NPU target and MAC count, and increase `--simlimit` if needed. Reconfigure after changing FVP flags. |
402
431
| No Zephyr serial output on Alif |`SW4` still routes VCOM to SE UART | Move `SW4` to `U4` and use 115200 baud |
403
432
| No SE Tools response | Serial terminal is open, wrong `SW4` setting, or app blocks ISP | Close terminal, set `SW4=SE`, or enter hard maintenance mode |
404
433
|`app-write-mram` fails or app does not boot |`mramAddress` and link address differ | Use `0x80008000`, not `0x80200000` with `CONFIG_FLASH_LOAD_OFFSET=0x8000`|
Copy file name to clipboardExpand all lines: zephyr/samples/mv2-ethosu/CMakeLists.txt
+1-1Lines changed: 1 addition & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -92,7 +92,7 @@ else()
92
92
set(EXECUTORCH_SELECT_OPS_MODEL "")
93
93
set(_EXECUTORCH_GEN_ZEPHYR_PORTABLE_OPS OFF)
94
94
message(
95
-
"gen_oplist: No non-delegated ops were found in ${ET_PTE_FILE_PATH}; no ops added to build"
95
+
"gen_oplist: No aten:: or dim_order_ops:: operators were found in ${ET_PTE_FILE_PATH}; skipping portable operator selection. Other CPU operators may still run."
0 commit comments