Conversation
The moduledocs of both flash tasks still named flash_offset, the mix.exs key they no longer read. Signed-off-by: Davide Bettio <davide@uninstall.it>
The key was renamed to esp32_flash_offset and stm32_flash_offset, and a project still setting flash_offset gets the default without a word. Signed-off-by: Davide Bettio <davide@uninstall.it>
flash_pythonx/1 selected the device when no --port was given, for this task only: install passes the port it selected. Move the selection and the check that AtomVM is installed into the task, which then knows the port before calling esptool. Signed-off-by: Davide Bettio <davide@uninstall.it>
A partition looked up by name and data type, the way AtomVM finds its boot.avm and main.avm partitions, whatever the subtype. Signed-off-by: Davide Bettio <davide@uninstall.it>
The exit status of esptool.py was dropped, so the task exited 0 after a failed write. The Pythonx path already exits 1. Signed-off-by: Davide Bettio <davide@uninstall.it>
The application was written at 0x250000 unless told otherwise, while the main.avm partition is elsewhere on older Erlang-only images and on JIT builds, and the flash offset was part of every mix.exs. Read the partition table of the board and write to its main.avm partition, as AtomVM finds it: by name and data type. esp32_flash_offset and --flash_offset pin an address and skip the read. --flash_offset now refuses anything but a hexadecimal address: 0x crashed, 0x25zz became 0x25, and 250000 was ignored. Signed-off-by: Davide Bettio <davide@uninstall.it>
The partition table gives the size of main.avm along with its offset, so an image that does not fit is reported before anything is written, with a hint at mix atomvm.esp32.expand. Signed-off-by: Davide Bettio <davide@uninstall.it>
Custom layouts and A/B partitioning put the application elsewhere than main.avm. esp32_partition in mix.exs names the partition to write to, --partition overrides it, and several names get the same image in one esptool call. A partition and an address given together are refused. Signed-off-by: Davide Bettio <davide@uninstall.it>
bettio
force-pushed
the
flash-partition
branch
from
September 18, 2026 12:57
a1ff1dd to
b54b902
Compare
Contributor
|
there is some blocker surrounding the esptool.py path using auto and multiple esp devices connected - on pythonx we pin the device, so we are sure we read from same device that we write to - the esptool.py doesn't pin the port, so in theory we could read a partition map from device A, and the write to device B.. most likely only in theory |
petermm
approved these changes
Sep 18, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
mix atomvm.esp32.flash wrote the application at 0x250000 unless told
otherwise, while the main.avm partition is elsewhere on older
Erlang-only images and on JIT builds. The task now reads the partition
table of the board and writes to its main.avm partition, as AtomVM finds
it, so no offset belongs in mix.exs any more; esp32_flash_offset and
--flash_offset still pin an address. An application bigger than its
partition is refused, with a hint at mix atomvm.esp32.expand.
Other partitions are named with esp32_partition in mix.exs or with
--partition, for custom layouts and A/B partitioning, several at once
when they all receive the same application. Both esptool paths read the
table, through Pythonx and through an external esptool.py, whose exit
status now fails the task. The moduledocs follow the keys renamed by
#35, and a mix.exs still setting flash_offset gets a warning.