分区表
idf.py partition-table
in win10
_____ erase region , use it to erase otadata
esptool --chip esp32c3 --port COM3 erase_region 0xd000 0x2000
ubuntu
_____ 烧录文件到分区
esptool.py --chip esp32c3 -p /dev/ttyACM0 -b 460800 --before default_reset --after hard_reset --chip esp32c3 write_flash --flash_mode dio --flash_size detect --flash_freq 80m 0x610000 nvsFile.bin
_____ 烧录多个文件
esptool.py esp32c3 -p /dev/ttyACM0 -b 460800 --before=default_reset --after=hard_reset write_flash --flash_mode qio --flash_freq 80m --flash_size 16MB 0x0 bootloader/bootloader.bin 0x10000 esp32.bin 0x8000 partition_table/partition-table.bin 0x9000 ota_data_initial.bin
_____ 生成 nvs 文件
goto folder \esp-idf\v4.4.7\esp-idf\components\nvs_flash\nvs_partition_generator
python nvs_partition_gen.py generate forNvs.csv out.bin 0x300000
# Sample csv file
key,type,encoding,value
dummyNamespace,namespace,,
dummyU8Key,data,u8,127
dummyI8Key,data,i8,-128
dummyU16Key,data,u16,32768
dummyU32Key,data,u32,4294967295
dummyI32Key,data,i32,-2147483648
dummyStringKey,data,string,"Lorem ipsum dolor sit amet, consectetur adipiscing elit.
Fusce quis risus justo.
Suspendisse egestas in nisi sit amet auctor.
Pellentesque rhoncus dictum sodales.
In justo erat, viverra at interdum eget, interdum vel dui."
dummyHex2BinKey,data,hex2bin,010203abcdef
dummyBase64Key,data,base64,MTIzYWJj
hexFileKey,file,hex2bin,testdata/sample.hex
base64FileKey,file,base64,testdata/sample.base64
stringFileKey,file,string,testdata/sample.txt
blobFileAKey,file,binary,testdata/sample_blob.bin
_____ 生成 spiffs image
python spiffsgen.py <image_size> <base_dir> <output_file>
eg, python spiffsgen.py 0x2000 ./folder hello.bin