1.) Determined the max size of the FAT file system by using info from flashbdev.py and some esp module calls:
Code: Select all
esp.flash_user_start() = 1048576 # Exactly 0x100000. This is what esp.flash_user_start() returns when irom0_0_seg = 0xF7000
esp.flash_size() = 4194304
SEC_SIZE = 4096
RESERVED_SECS = 1
START_SEC = 257
blocks = 762
SEC_SIZE * blocks = 3121152 # Exactly 0x2FA000. This is the max FAT file system size
Code: Select all
dd if=/dev/zero of=fat.fs count=762 bs=4096
Code: Select all
mkfs.fat fat.fs
mkfs.vfat fat.fs
mkfs.fat -F 12 -R 1 -S 4096 fat.fs
mkfs.vfat -F 12 -R 1 -S 4096 fat.fs
Code: Select all
sudo mount fat.fs micropython_fat_fs
sudo cp boot.py micropython_fat_fs
sudo cp favicon_package/favicon.ico micropython_fat_fs
sudo umount micropython_fat_fs
Code: Select all
text data bss dec hex filename
990572 1084 68544 1060200 102d68 build/firmware.elf
Create build/firmware-combined.bin
esptool.py v2.6
Creating image for ESP8266...
('flash ', 32944)
('padding ', 3920)
('irom0text', 958752)
('total ', 995616)
('md5 ', 'c1c4a736e051a9bda72e7538fdc29968')
Code: Select all
sudo esptool.py --port /dev/ttyUSB0 --baud 921600 write_flash --erase-all 0x0 "build/firmware-combined.bin" 0x100000 ~/Desktop/fat.fs
Not sure what is causing the failure. I think all the sizes are correct. Maybe I have something wrong with the exact formatting of the file system? There are a lot of FAT options to choose from