esptool possible to autoselect "--encrypted" flag
Posted: Thu May 27, 2021 4:33 am
I am trying to create a batch file that will always program my esp32 correctly regardless if the flash is currently encrypted. The only difference between these 2 firmwares is one requires the "-u" flag, while the other I use "--encrypted" with esptool.py
For example, my CLI for
Unencrypted:
Encrypted:
The reason is I want to be able to use the same script for writing firmware to my device the first time and then consecutive times also.
The only way I know of atm is to do an esp efuse read, interpret the data myself, then run the appropriate cli option. Is there any shortcut to this process? Perhaps its already been implemented in esptool?
Cheers,
Ryan.
For example, my CLI for
Unencrypted:
Code: Select all
@%ESP_TOOL% --chip esp32 --port %COMPORT% --baud 460800 --before default_reset --after hard_reset write_flash -u --flash_mode dio --flash_freq 40m --flash_size 4MB [b]<...firmware paths/locations>[/b]
Code: Select all
@%ESP_TOOL% --chip esp32 --port %COMPORT% --baud 460800 --before default_reset --after hard_reset write_flash --encrypt --flash_mode dio --flash_freq 40m --flash_size 4MB [b]<...firmware paths/locations>[/b]
The only way I know of atm is to do an esp efuse read, interpret the data myself, then run the appropriate cli option. Is there any shortcut to this process? Perhaps its already been implemented in esptool?
Cheers,
Ryan.