Speeding up/automating programming of devices
Posted: Tue Aug 13, 2024 8:52 am
Hello,
We are currently in the process of scaling up the manufacturing of our product containing an ESP32-C6 module. The first step after assembly is to program the devices, which consists of the following steps executed in a .bat file;
We have been managing okay at small volumes ourselves, but I think this is going to get a lot more challenging when moving this process to an external manufacturing partner; It's a fairly slow and cumbersome process due to the number of steps, waiting for the flash to encrypt, and having to select a unique ID binary.
I was wondering if anyone had any advice or experience in streamlining or automating this process for a manufacturer to handle - as I mentioned we currently just runs these steps out of a windows .bat file, which can be a bit temperamental (no checks for errors) and slow.
We are currently in the process of scaling up the manufacturing of our product containing an ESP32-C6 module. The first step after assembly is to program the devices, which consists of the following steps executed in a .bat file;
Code: Select all
# Erase device
esptool.py -p COM15 -b 921600 --before default_reset --after no_reset --chip esp32c6 erase_flash --force
# Burn key to block0
espefuse.py --port COM15 burn_key BLOCK_KEY0 device_flash_encrypt.bin XTS_AES_128_KEY
# Flash encrypted bootloader necessary binaries
esptool.py --chip esp32c6 -p COM15 -b 921600 --before=default_reset write_flash --flash_mode dio --flash_freq 80m --flash_size 8MB 0x0 ./build/bootloader/bootloader.bin 0x100000 ./build/application.bin 0xe000 ./build/partition_table/partition-table.bin 0xfd000 ./build/ota_data_initial.bin
# Wait for ~30 seconds for the binaries to encrypt on the device
TIMEOUT /T 30 /NOBREAK
# Store standard NVS encryption key
esptool.py -p COM15 --before=default_reset --after no_reset write_flash --encrypt 0xFC000 std_nvs_key.bin
# Await NVS file ID
set /p "nvsnum=Enter nvs file number: "
# Flash the pre-generated, encrypted, unique device keys/ID binary
esptool.py -p COM15 write_flash 0xF000 ./100-b1/bin/nvs_enc_-%nvsnum%.bin
# Rename the file with the device batch# so it can't be used again
set /p "bNum=Enter device batch number: "
ren .\100-b1\bin\nvs_enc_-%nvsnum%.bin nvs_enc_-%nvsnum%.bin-USED_%bNum%
I was wondering if anyone had any advice or experience in streamlining or automating this process for a manufacturer to handle - as I mentioned we currently just runs these steps out of a windows .bat file, which can be a bit temperamental (no checks for errors) and slow.