I am working in a factory setting where I want to keep in each device a secret token unique to each device as part of flashing the device with my custom micropython build.
My idea for doing this is:
1. Build a fat32 partition using the following commands on the host:
Code: Select all
dd if=/dev/zero of=fat.fs bs=1024 count=2048
mkfs.vfat fat.fs
3. Perform regular flash of micropython via esptool.py with an extra write_flash to the offset (0x200000) defined in the partitions.csv with the image
As far as I understand the code in inisetup which is called by _boot.py will create a vfat partition if it fails to mount the vfs partition on first boot.
Will this work? is there an easier solution?