I've been investigating for several weeks and I'm pulling my hears out!!
Hope you'll be able to help me ...
I have an ESP12E that I'm flashing using the Esptool from Arduino Ide:
Here is the command line I can find in the logs:
...\tools\esptool\0.4.8/esptool.exe -vv -cd nodemcu -cb 115200 -cp COM6 -ca 0x00000 -cf E:\__tmp\buildd89e9f5c82f49f82ee604e073232f83b.tmp/test.ino.bin
The problem I have is quite tricky to explain since it seems to be completely crazy!
Suppose I have a simple code that is working after boot, if I just add a new variable or remove a line somewhere it can just not boot correctly after flashing.
As I considered it could be a flashing issue, I tried to just build my BIN file using Arduino IDE and flash it using an external flasher (esptool.py) and it appears that it was better sometimes.
However I still have cases where I add a line in the code and it does not boot up after flashing.
To investigate a bit further, I replaced option -vv with option -vvv for esptool.exe (called from Aduino IDE) to get extra logs from flashing process and I discovered something interesting:
It seems that each time I don't encounter any problem, I have the following ending for flashing:
espcomm_send_command: response 0x20120707
. espcomm_send_command: sending command header
espcomm_send_command: sending command payload
espcomm_send_command: receiving 2 bytes of data
espcomm_send_command: received 2 bytes:
0x00
0x00
espcomm_send_command: response 0x20120707
. espcomm_send_command: sending command header
espcomm_send_command: sending command payload
espcomm_send_command: receiving 2 bytes of data
espcomm_send_command: received 2 bytes:
0x00
0x00
espcomm_send_command: response 0x20120707
.
starting app without reboot
espcomm_send_command: sending command header
espcomm_send_command: sending command payload
espcomm_send_command: receiving 2 bytes of data
espcomm_send_command: received 2 bytes:
0x01
0x06
espcomm_send_command: response 0x20120707
closing bootloader
flush start
setting serial port timeouts to 1 ms
flushed 0 bytes
setting serial port timeouts to 1000 ms
flush complete
But when the ESP does not boot correctly, I find many "0x00 0X07" in the received 2 bytes from the "espcomm_send_command" as shown above:
espcomm_send_command: response 0x20120707
. espcomm_send_command: sending command header
espcomm_send_command: sending command payload
espcomm_send_command: receiving 2 bytes of data
espcomm_send_command: received 2 bytes:
0x00
0x07
espcomm_send_command: response 0x20120707
. espcomm_send_command: sending command header
espcomm_send_command: sending command payload
espcomm_send_command: receiving 2 bytes of data
espcomm_send_command: received 2 bytes:
0x00
0x07
espcomm_send_command: response 0x20120707
.
starting app without reboot
espcomm_send_command: sending command header
espcomm_send_command: sending command payload
espcomm_send_command: receiving 2 bytes of data
espcomm_send_command: received 2 bytes:
0x01
0x06
espcomm_send_command: response 0x20120707
closing bootloader
flush start
setting serial port timeouts to 1 ms
flushed 0 bytes
setting serial port timeouts to 1000 ms
flush complete
What do those received bytes mean?
Can they be due to flashing errors?
The only thing that changes between flashings that work and those that don't is the binary file itself!
I tried to change baud rate but it does not change anything as it is binary linked.
Hope so much that someone could help!
thanks