Skip to content

Conversation

@wallento
Copy link
Contributor

@wallento wallento commented Dec 30, 2021

Various fixes and beautifications coordinated with @1c3t3a
Fixes 2 of the 3 all remaining issues from #892

Fix an incorrect type usage.
The stack base address is only available when tracing is on. Thus add
an sdkconfig that has tracing on.
@wallento
Copy link
Contributor Author

Amended after clang-format patch

@wallento
Copy link
Contributor Author

Amended after memory allocation fix

@wallento wallento marked this pull request as draft December 31, 2021 13:00
@wallento
Copy link
Contributor Author

Put into draft mode, further fixes necessary (stack overflow on esp32c3 now too)

AoT requires mmap() memory to have EXEC protection. Call the proper
capability-based malloc in esp-idf to allocate memory in that case.
The memory protection seems to interfere with capability-based
malloc. Turn it off for now and reiterate later.
@wallento wallento force-pushed the esp-idf-fixes branch 2 times, most recently from 6aeccfa to 2beb48d Compare December 31, 2021 13:44
Generalize the build for different targets, esp32 and esp32c3 for now.
Increase the main pthread stack size to avoid stack overflow.
@wallento wallento marked this pull request as ready for review December 31, 2021 13:49
@wallento
Copy link
Contributor Author

Okay, looks better now, both targets run fine

@wallento
Copy link
Contributor Author

wallento commented Jan 1, 2022

Added build scripts to include with esp-idf to use wamr as an ESP-IDF component! Not sure if that is the right place where I put it..

This is the build-script to use wasm-micro-runtime as an ESP-IDF
component in ESP-IDF projects. With this file it is only necessary to
add the component dir and then use the component in an ESP-IDF project.
Reorganize the product-mini demo of ESP-IDF to actually use the
ESP-IDF component infrastructure. This also serves as example then, so
remove that duplicate code.

Fine-tuning to run both the interpreter and the AoT, and use esp-idf logging.
The xtensa compiler occasionally emits a sequence of byte-access loads
and stores for memcpy. This crashes the chip because its illegal to do
that on IRAM. Instead access the word. Seems to not occur for the
8-byte variant.
When malloc was not successful, also don't start writing to the fields
relative to it and instead return.
Fix the naming of the feature check definitions to the standard naming.
Properly handle NULL argument and return of realloc.
@wallento
Copy link
Contributor Author

wallento commented Jan 4, 2022

Amended with review feedback, thanks!

@wenyongh wenyongh merged commit 78414b6 into bytecodealliance:main Jan 5, 2022
vickiegpt pushed a commit to vickiegpt/wamr-aot-gc-checkpoint-restore that referenced this pull request May 27, 2024
Various fixes and beautifications coordinated with @1c3t3a,
fixes 2 of the 3 all remaining issues from bytecodealliance#892:
- enable to os_mmap executable memory
- fix os_malloc/os_realloc/os_free issues
- implement os_thread_get_stack_boundary
- add build scripts to include with esp-idf to use wamr as
  an ESP-IDF component
- update sample and document
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants