diff --git a/.github/workflows/esp32-mkimage.yaml b/.github/workflows/esp32-mkimage.yaml index 8a638c2a5..79ecebe3a 100644 --- a/.github/workflows/esp32-mkimage.yaml +++ b/.github/workflows/esp32-mkimage.yaml @@ -123,12 +123,6 @@ jobs: idf.py reconfigure idf.py build - - name: "Create a ${{ matrix.soc }} image" - working-directory: ./src/platforms/esp32/build - run: | - ./mkimage.sh - ls -l *.img - - name: "Upload ${{ matrix.soc }} artifacts" uses: actions/upload-artifact@v3 with: diff --git a/CHANGELOG.md b/CHANGELOG.md index cb3422cca..927e8f7ad 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,6 +11,11 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Fix bug (with code compiled with OTP-21) with binary pattern matching: the fix introduced with `02411048` was not completely right, and it was converting match context to bogus binaries. +### Changed + +- ESP32 builds now assemble the complet image automatically if `esp32boot.avm` is found from a previous generic_unix build. +- ESP32 cmake build options are now also exposed in `idf.py menuconfig`. + ## [0.6.2] - 25-05-2024 ### Added diff --git a/src/platforms/esp32/CMakeLists.txt b/src/platforms/esp32/CMakeLists.txt index 55407bc33..1fbd77ff7 100644 --- a/src/platforms/esp32/CMakeLists.txt +++ b/src/platforms/esp32/CMakeLists.txt @@ -62,3 +62,20 @@ option(AVM_VERBOSE_ABORT "Print module and line number on VM abort" OFF) option(AVM_CREATE_STACKTRACES "Create stacktraces" ON) add_subdirectory(tools) + +add_custom_command( + OUTPUT atomvm-${IDF_TARGET}.img + DEPENDS gen_project_binary bootloader + COMMENT "Assembling complete image" + COMMAND ${CMAKE_BINARY_DIR}/mkimage.sh + COMMAND echo && cmake -E cmake_echo_color --yellow "ATTENTION: Ignore the following output and use: \"./build/flashimage.sh\" to flash the complete AtomVM image, including libraries." + VERBATIM + USES_TERMINAL) + +if (EXISTS ${CMAKE_SOURCE_DIR}/../../../build/libs/esp32boot/esp32boot.avm) + add_custom_target(atomvm_image ALL DEPENDS atomvm-${IDF_TARGET}.img) +endif() + + +set_property(DIRECTORY "${BUILD_DIR}" APPEND PROPERTY + ADDITIONAL_CLEAN_FILES atomvm-${IDF_TARGET}.img) diff --git a/src/platforms/esp32/main/Kconfig.projbuild b/src/platforms/esp32/main/Kconfig.projbuild index e0cd7bfce..eed640bb4 100755 --- a/src/platforms/esp32/main/Kconfig.projbuild +++ b/src/platforms/esp32/main/Kconfig.projbuild @@ -26,4 +26,22 @@ menu "AtomVM configuration" help Reboot the ESP32 device if the start/0 entrypoint does not return the `ok` atom. + config AVM_CREATE_STACKTRACES + bool "Create BEAM stack traces." + default y + help + Create stacktraces for AtomVM application debugging, when an application crashes a stacktrace will be emitted. + + config AVM_VERBOSE_ABORT + bool "Verbose error when a VM abort occurs." + default n + help + Print the C module and line number when a VM abort occurs. + + config ENABLE_REALLOC_GC + bool "Enable experimental optimized realloc garbage collection." + default n + help + Enable experimental optimized garbage collection mode that makes use of C realloc instead of copying data. + endmenu