Skip to content

Conversation

UncleGrumpy
Copy link
Collaborator

Changes include automatic detection of the beam application partition (default main.avm) to prevent overwriting the wrong flash sectors. This prevents overwriting Elixir library modules for Elixir supported builds, and assures that the application will be written to the same address that AtomVM will load and run. When flashing to a device with a custom partition table the app_partition parameter should be supplied if the app partition is not named main.avm.

Other changes include:

  • Device port is now auto discovered instead of hard coded
  • Improved error reporting
  • Stacktraces are only displayed in diagnostic mode
  • Dialyzer warnings for atomvm_rebar3_plugin esp32_flash provider fixed

Changes error reporting for the esp32_flash task to include stack trace when rebar3 is executed
with DIAGNOSTIC=1 or DEBUG=1.

Signed-off-by: Winford <[email protected]>
@UncleGrumpy UncleGrumpy marked this pull request as draft July 29, 2025 02:22
@UncleGrumpy UncleGrumpy force-pushed the detect_esp32_offset branch 3 times, most recently from 5685f2a to 91a5fc9 Compare August 2, 2025 05:59
@UncleGrumpy UncleGrumpy marked this pull request as ready for review August 2, 2025 06:00
The `offset` for the beam application partition is now read from the partition table on the attached
esp32 device. When a custom partition table is used that does not use `main.avm` for the beam app
partition name the `app_partition` parameter should be used to specify the application partition
to be flashed. Valid application partition sub-types (the type is `data`) are `phy` or `0xAA`.

If the `offset` parameter is specified it will be used to verify that the offset address of the
application partition matched the expected value. This may be used to prevent flashing to a
standard build of AtomMV for application that require a custom partition table.

The `port` that the ESP32 is attached to is now auto discovered by default. When more than one
ESP32 device is plugged into USB the port should be specified to control which device is flashed.

Error reporting has been improved with descriptive error messages.

Dialyzer warnings for the esp32_flash task have been fixed when analyzing atomvm_rebar3_plugin.

Signed-off-by: Winford <[email protected]>
@UncleGrumpy UncleGrumpy force-pushed the detect_esp32_offset branch from 91a5fc9 to 783d3ad Compare August 2, 2025 08:14
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.

1 participant