Skip to content

Commit 5ffba82

Browse files
committed
Have idf.py build assemble the complete ESP32 image
Rather than having the user or CI scripts run the extra ./build/mkimage.sh sript, it will be run automatically if the `esp32boot.avm` libraries are found in the `AtomVM/build/libs/esp32boot` directory from a previous generic_unix build. This includes a prominet message for the user with instruction to flash the complete image to the device. Updates the esp32-build.yaml workflow to use the updated build steps, and only create the necessary esp32 related libraries, excluding the creation of uf2 files. Signed-off-by: Winford <[email protected]>
1 parent 93308d7 commit 5ffba82

File tree

3 files changed

+21
-6
lines changed

3 files changed

+21
-6
lines changed

.github/workflows/esp32-mkimage.yaml

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -123,12 +123,6 @@ jobs:
123123
idf.py reconfigure
124124
idf.py build
125125
126-
- name: "Create a ${{ matrix.soc }} image"
127-
working-directory: ./src/platforms/esp32/build
128-
run: |
129-
./mkimage.sh
130-
ls -l *.img
131-
132126
- name: "Upload ${{ matrix.soc }} artifacts"
133127
uses: actions/upload-artifact@v3
134128
with:

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
1111
- Fix bug (with code compiled with OTP-21) with binary pattern matching: the fix introduced with
1212
`02411048` was not completely right, and it was converting match context to bogus binaries.
1313

14+
### Changed
15+
16+
- ESP32 builds now assemble the complet image automatically if `esp32boot.avm` is found from a previous generic_unix build.
17+
1418
## [0.6.2] - 25-05-2024
1519

1620
### Added

src/platforms/esp32/CMakeLists.txt

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,3 +62,20 @@ option(AVM_VERBOSE_ABORT "Print module and line number on VM abort" OFF)
6262
option(AVM_CREATE_STACKTRACES "Create stacktraces" ON)
6363

6464
add_subdirectory(tools)
65+
66+
add_custom_command(
67+
OUTPUT atomvm-${IDF_TARGET}.img
68+
DEPENDS gen_project_binary bootloader
69+
COMMENT "Assembling complete image"
70+
COMMAND ${CMAKE_BINARY_DIR}/mkimage.sh
71+
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."
72+
VERBATIM
73+
USES_TERMINAL)
74+
75+
if (EXISTS ${CMAKE_SOURCE_DIR}/../../../build/libs/esp32boot/esp32boot.avm)
76+
add_custom_target(atomvm_image ALL DEPENDS atomvm-${IDF_TARGET}.img)
77+
endif()
78+
79+
80+
set_property(DIRECTORY "${BUILD_DIR}" APPEND PROPERTY
81+
ADDITIONAL_CLEAN_FILES atomvm-${IDF_TARGET}.img)

0 commit comments

Comments
 (0)