You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Adds the esp32boot library flavor (determined from partition table) to the idf.py flash job,
allowing developers to simply skip running mkimage.sh and flashimage.sh from the build directory
to flash all of the necessary partitions for a complete install to their device.
Signed-off-by: Winford <[email protected]>
Copy file name to clipboardExpand all lines: doc/src/build-instructions.md
+34-16Lines changed: 34 additions & 16 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -207,7 +207,10 @@ Tests for the following libraries are supported:
207
207
208
208
Building AtomVM for ESP32 must be done on either a Linux or MacOS build machine.
209
209
210
-
In order to build a complete AtomVM image for ESP32, you will also need to build AtomVM for the Generic UNIX platform (typically, the same build machine you are suing to build AtomVM for ESP32).
210
+
In order to build a complete AtomVM image for ESP32, you will also need to build AtomVM for the Generic UNIX platform (typically, the same build machine you are suing to build AtomVM for ESP32). This is expected to
211
+
be done before building an ESP32 port, since the BEAM libraries packed into the esp32boot.avm (or
212
+
elixir_esp32boot.avm for Elixir supported builds) are created at the same time as the atomvmlib.avm
213
+
libraries as part of the generic UNIX build.
211
214
212
215
### ESP32 Build Requirements
213
216
@@ -272,19 +275,34 @@ You can now build AtomVM using the build command:
272
275
$ idf.py build
273
276
```
274
277
275
-
This command, once completed, will create the Espressif bootloader, partition table, and AtomVM binary. The last line of the output should read something like the following:
278
+
This command, once completed, will create the Espressif bootloader, partition table, and AtomVM binary. The last line of the output should read something like the following example:
276
279
277
-
Project build complete. To flash, run this command:
At this point, you can run `idf.py flash` to upload the 3 binaries up to your ESP32 device, and in some development scenarios, this is a preferable shortcut.
291
+
```{important}
292
+
When using the `@flash_args` method be sure to execute from
However, first, we will build a single binary image file containing all of the above 3 binaries, as well as the AtomVM core libraries. See [Building a Release Image](#building-a-release-image), below. But first, it is helpful to understand a bit about how the AtomVM partitioning scheme works, on the ESP32.
296
+
At this point, you can run `idf.py flash` and have a complete working image. In some development
297
+
scenarios is may be helpful to use `idf.py app-flash` (to only flash a new AtomVM binary to the
298
+
`factory` partition) to avoid re-flashing the entire image if no changes were made to the Erlang or
299
+
Elixir libraries, and the partition table has not been altered. If you have made changes to the
300
+
sdkconfig file (using `idf.py menuconfig` or by other means) it may be necessary to also update the
301
+
bootloader using `idf.py bootlader-flash`. As with most other `idf.py` commands these may be
302
+
combined (for example: `idf.py bootlader-flash app-flash`). For more information about these
303
+
partitions and the flash partitions layout see [Flash Layout](#flash-layout) below.
304
+
305
+
To build a single binary image file see [Building a Release Image](#building-a-release-image), below.
288
306
289
307
### Running tests for ESP32
290
308
@@ -417,18 +435,18 @@ The flash layout is roughly as follows (not to scale):
417
435
| partition table | 3KB |
418
436
+-----------------+ |
419
437
| | |
420
-
| NVS | 24KB |
438
+
| nvs | 24KB |
421
439
| | |
422
440
+-----------------+ |
423
441
| PHY_INIT | 4KB |
424
442
+-----------------+ | AtomVM
425
443
| | | binary
426
444
| | | image
427
-
| | |
428
445
| AtomVM | |
429
-
| Virtual | 1.75MB |
430
-
| Machine | |
446
+
| Virtual | |
447
+
| Machine | 1.75MB |
431
448
| | |
449
+
| (factory) | |
432
450
| | |
433
451
+-----------------+ |
434
452
| boot.avm | 256-512KB v
@@ -474,7 +492,7 @@ and `boot.avm` partitions.
474
492
475
493
### Building a Release Image
476
494
477
-
The `<atomvm-source-tree-root>/tools/release/esp32` directory contains the `mkimage.sh` script that can be used to create a single AtomVM image file, which can be distributed as a release, allowing application developers to develop AtomVM applications without having to build AtomVM from scratch.
495
+
The `<atomvm-source-tree-root>/src/platforms/esp32/build` directory contains the `mkimage.sh` script that can be used to create a single AtomVM image file, which can be distributed as a release, allowing application developers to develop AtomVM applications without having to build AtomVM from scratch.
478
496
479
497
```{attention}
480
498
Before running the `mkimage.sh` script, you must have a complete build of both the esp32 project, as well as a full
0 commit comments