esp-rs / espflash

Serial flasher utility for Espressif SoCs and modules based on esptool.py
Apache License 2.0
457 stars 111 forks source link

Support flashing partition table at custom location #458

Closed jnross closed 8 months ago

jnross commented 11 months ago

In our use of the ESP32-S3, we are enabling the secure boot option in the bootloader which increases the size of the bootloader such that it overflows into default location of the partition table at 0x8000. We've had to move our partition table to 0xA000 via the sdkconfig, but this appears to break our usage of cargo-espflash flash.

What would be the best way to support this change in the partition table location? A few ideas:

  1. Detect the partition table location via the sdkconfig or esp-idf-sys output
  2. Allow the partition table location to be explicitly specified via command-line option to cargo-espflash and espflash
  3. Add a partition type to the .csv file that allows the location and size of the partition table in flash to be define just like other partitions. (Maybe the bootloader should be added to the csv as well. We know the bootloader must be located at 0x0, but it might be useful to specify the size of the bootloader in the .csv)
jnross commented 8 months ago

Nice! Thanks for bringing this change in, @thetek42.