exatomvm icon indicating copy to clipboard operation
exatomvm copied to clipboard

Use bootloader settings for esp32

Open UncleGrumpy opened this issue 3 years ago • 3 comments

Use bootloader settings for esp32

Changes harcoded settings to use defaults that can be set using idf.py menuconfig and read from the bootloader by esptool when flashing an esp32 device.

  • Add support for ESP32-C3, ESP32-S3, and ESP32-S2 devices.
  • Add support for custom flash modes (qio, qout, etc...)
  • Add support for custom flash speeds (26m, 80m, etc...)
  • Add support for larger flash sizes.

Signed-off-by: Winford [email protected]

UncleGrumpy avatar Nov 03 '22 05:11 UncleGrumpy

I didn't check this: do this work even out of tree (when there is no sdkconfig file)?

Yes. if no sdkconfig file exists when idf.py build is run on will be generated using the default settings, over-riding IDF default setting with settings found in sdkconfig.defaults if it exists, and then if sdkconfig.defaults.{CHIP} exists those setting would be applied to the generated sdkconfig. These changes would honor any settings changed by the user (such as selecting a faster flash mode, or a larger flash capacity) either directly using idf.py menuconfig or by changing defaults in any of the sdkconfig.defaults files.

We have been using the same setting in the atomvm_rebar3_plugin esp32_flash_provider.erl for nearly 11 months with no problems reported.

UncleGrumpy avatar Jul 12 '23 15:07 UncleGrumpy

I didn't check this: do this work even out of tree (when there is no sdkconfig file)?

This will work even if no esp-idf is installed because these settings are stored in the bootloader. A freestanding install of esptool (from distro repo, or pip install) can query these setting.

UncleGrumpy avatar Aug 15 '23 00:08 UncleGrumpy

would be great if this landed for parity/identical behaviour with the rebar3 equivalent https://github.com/atomvm/atomvm_rebar3_plugin/blob/master/src/atomvm_esp32_flash_provider.erl

petermm avatar Apr 14 '24 17:04 petermm