Skip to content

Commit 740519f

Browse files
authored
fix(aot): fix running aot images on u585 (project-ocre#203)
- enable ocre's aot config in prj.conf - enable fpu and disable fpu in board's config - add documentation for aot image creation Signed-off-by: Krisztian Szilvasi <34309983+kr-t@users.noreply.github.com>
1 parent 1465d09 commit 740519f

3 files changed

Lines changed: 23 additions & 0 deletions

File tree

docs/boards/zephyr/b_u585i_iot02a.md

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,24 @@ west build -p always -b b_u585i_iot02a --shield enc28j60 src/samples/supervisor/
103103

104104
Replace `enc28j60` with `wiznet_w5500` if WIZnet W5500 ethernet shield is used.
105105

106+
### AoT
107+
108+
For building AoT files use [wamrc](https://github.com/bytecodealliance/wasm-micro-runtime/tree/main/wamr-compiler) with following configuration:
109+
110+
```bash
111+
wamrc --cpu=cortex-m33 --target=thumbv8m.main --target-abi=eabihf -o hello-world.aot hello-world.wasm
112+
```
113+
114+
Make sure to build wamrc in the wasm-micro-runtime submodule, not a separate clone, in order to match the versions.
115+
116+
Since we use here hard-float ABI, make sure you enable FPU in boards' config. Additionally, MPU has to be disabled (or configured), since it might affect running AoT images from external memory. Furthermore, AoT config from Ocre has to be enabled. Hence, the necessary configuration shall include:
117+
118+
```
119+
CONFIG_ARM_MPU=n
120+
CONFIG_FPU=y
121+
CONFIG_OCRE_WAMR_AOT=y
122+
```
123+
106124
## Flashing
107125

108126
### First Flash (with Preloaded Images)

src/samples/supervisor/zephyr/boards/b_u585i_iot02a.conf

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,10 @@
33
#
44
# SPDX-License-Identifier: Apache-2.0
55

6+
# Memory and MPU Configuration
7+
CONFIG_ARM_MPU=n
8+
CONFIG_FPU=y
9+
610
CONFIG_STM32_MEMMAP=y
711
CONFIG_OCRE_MERGE_HEX=y
812

src/samples/supervisor/zephyr/prj.conf

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,3 +46,4 @@ CONFIG_SHELL_GETOPT=y
4646
CONFIG_DEBUG=y
4747
CONFIG_LOG_MODE_IMMEDIATE=y
4848
CONFIG_OCRE_FILESYSTEM=y
49+
CONFIG_OCRE_WAMR_AOT=y

0 commit comments

Comments
 (0)