What values to use for "address" in esptool.py write_flash and read_flash functions?
Posted: Mon Feb 04, 2019 4:01 pm
Examples from esptool.py github https://github.com/espressif/esptool
The first will read 2MB from the flash from it's origin 0 byte and dumps the data into a file named `flash_contents.bin`.
The second does 2 writes, one starting from 0 byte of the flash and the other from 0x40000 (i.e. 262144 bytes) of the flash.
Questions:
1. For read, how does one decide how much to read? For example, if the 2MB region that was read consist of multiple files, how do I extract them from flash_contents.bin? The flash region may also have been read partially, that is one of the files is stored beyond the 2MB mark, how does one avoid such an issue?
2. For write, how does one know where to write to w/o over writing existing data in the flash? How much padding should one apply between files when writing them?
Code: Select all
esptool.py -p PORT -b 460800 read_flash 0 0x200000 flash_contents.bin
esptool.py --port COM4 write_flash 0x00000 my_app.elf-0x00000.bin 0x40000 my_app.elf-0x40000.bin
The second does 2 writes, one starting from 0 byte of the flash and the other from 0x40000 (i.e. 262144 bytes) of the flash.
Questions:
1. For read, how does one decide how much to read? For example, if the 2MB region that was read consist of multiple files, how do I extract them from flash_contents.bin? The flash region may also have been read partially, that is one of the files is stored beyond the 2MB mark, how does one avoid such an issue?
2. For write, how does one know where to write to w/o over writing existing data in the flash? How much padding should one apply between files when writing them?