https://github.com/espressif/esptool/wi ... l-Protocol
I am comparing the theory (as written up in the doc) against what is written to the console with esptool --trace enabled and also by using a logic analyzer to examine the actual UART data written.
During initial communication with the ESP32, I see the following sequence of commands:
- 0x08 - SYNC
- 0x0A - READ_REG
- 0x05 - MEM_BEGIN
- 0x07 - MEM_END
- Total size - 3104 bytes
- Number of packets - 1
- Data size in one packet - 6144 bytes
- Memory address 0x4009 0000
The next command I see is MEM_END. The header seems to shows that the MEM_END command will be approx 3120 bytes (including headers). What is giving me pause here is that by reading the Github document, MEM_END feels like it should just be a marker with a flag indicating whether or not we should execute code and the entry point. This would be a payload of 8 bytes. In the MEM_END column of the document, the parameter is described as "Two 32-bit words: execute flag, entry point address". The actual observed data is (as noted) some 3120 bytes. I would have anticipated that the command following MEM_BEGIN would have been 0x08 - MEM_DATA with the actual data payload and not an over-sized MEM_END as I seem to be seeing.