Thanks!
i'm getting errors though. instead of failing occasionally, for me, it will occasionally work, but fail most of time.
i added some debug output and usually get this:
Code: Select all
Connecting...
connected on attempt 0
Erasing flash...
Erase size 1400 num_blocks 5 offset 0
(1431642119, '\x00\xa9')
Traceback (most recent call last):
File "/root/bin/esptool32", line 603, in <module>
esp.flash_begin(blocks*esp.ESP_FLASH_BLOCK, address)
File "/root/bin/esptool32", line 231, in flash_begin
raise Exception('Failed to enter Flash download mode')
Exception: Failed to enter Flash download mode
that 0xa9 is the problem, it expects 0 there. success looks like this:
Code: Select all
Connecting...
connected on attempt 0
Erasing flash...
Erase size 1400 num_blocks 5 offset 0
(538052359, '\x00\x00')
Wrote 5120 bytes at 0x00000000 in 0.6 seconds (74.2 kbit/s)...
Leaving...
Erase size 0 num_blocks 0 offset 0
(538052359, '\x00\x00')
pretty strange. does 0xa9 mean anything or is it garbage? does seem to always be a9 though.
"val" bytes vary on failures, but are always 538052359 on success.
update:
i'm flashing boot.bin from the SDK at address 0:
Code: Select all
esptool32 --port /dev/ttyUSB3 write_flash 0 fw_rojer/bin/boot.bin
(i called this new esptool.py esptool32).
the command it sends to bootloader is:
Code: Select all
'\xc0\x00\x02\x10\x00\x00\x00\x00\x00\x00\x14\x00\x00\x05\x00\x00\x00\x00\x04\x00\x00\x00\x00\x00\x00\xc0'
and the response it gets back is:
Code: Select all
'\xc0\x01\x02\x02\x00\x07\x12UU\x00\xa9\xc0'
the dword "\x07UU\x00" varies - sometimes i get "U" (0x55), " "(0x20) or 0x00, the rest of the response stays the same.
update2:
i have a second module, so i soldered and tried it. result is the same - can't flash reliably, flash_begin fails.
but in this module second byte in the response instead of 0xa9 alternates between 0xde and 0xfe