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
I wanted to try out the AOT performance of wamr for a simple nbody benchmark that runs fine in interpreter mode on Zephyr. I am running the benchmark on a STM32WB55RG that has a cortex-m4 implementing the thumbv7 instruction set.
To compile the wasm binary file to AOT I followed the instructions to build wamrc and used the following command to compile the working benchmark (the wasm binary file) to an AOT file: ./wamrc -o nbody.c.aot --target=thumbv7 --cpu=cortex-m4 nbody.c.wasm
Then I use: xxd -i nbody.c.aot > nbody.c.aot.h to get the header file, which I can use to load the AOT file in memory which I did exactly like loading the wasm binary file:
The error seems to happen in wasm_application_execute_main(module_inst, app_argc, app_argv);
Also, if I remove everything from the benchmark code and just run return 0; from the main, this error does not happen and the program terminates successfully. However, I am not sure if the code just gets optimized away when only returning 0. As soon as I add simple math operations the error is back.
I think some pitfalls are that the STM32WB55RG has a coprocessor and a FPU.
Any idea, how to tackle this problem? Thanks for any hints!
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Hello,
I wanted to try out the AOT performance of wamr for a simple nbody benchmark that runs fine in interpreter mode on Zephyr. I am running the benchmark on a STM32WB55RG that has a cortex-m4 implementing the thumbv7 instruction set.
To compile the wasm binary file to AOT I followed the instructions to build wamrc and used the following command to compile the working benchmark (the wasm binary file) to an AOT file:
./wamrc -o nbody.c.aot --target=thumbv7 --cpu=cortex-m4 nbody.c.wasm
Then I use:
xxd -i nbody.c.aot > nbody.c.aot.h
to get the header file, which I can use to load the AOT file in memory which I did exactly like loading the wasm binary file:Then I use
west build -p always -b nucleo_wb55rg C:\dev\zephyr\simple -t ram_report
andwest flash
However after the program is started I get the following output on my serial port:
The error seems to happen in
wasm_application_execute_main(module_inst, app_argc, app_argv);
Also, if I remove everything from the benchmark code and just run
return 0;
from the main, this error does not happen and the program terminates successfully. However, I am not sure if the code just gets optimized away when only returning 0. As soon as I add simple math operations the error is back.I think some pitfalls are that the STM32WB55RG has a coprocessor and a FPU.
Any idea, how to tackle this problem? Thanks for any hints!
Beta Was this translation helpful? Give feedback.
All reactions