Post topics, source code that relate to the Arduino Platform

User avatar
By GTP
#78751 Hello everyone,
I'm facing a strange issue. I'm trying to flash an ESP12E, if I flash it using Arduino IDE it seems to flash it, but after a reboot doesn't work. If I take the binary produced by Arduino's compiler and flash it using nodemcu-pyflasher it works! I seem to use the same flashing parameters in both softwares: flashing mode set to DIO, flash size set to 4M and upload speed set to 115200. The only difference I see is that in Arduino I have to specify board type and I set it to "generic esp8266 module". Any idea/suggestion to make it work with Arduino IDE?
Thanks for your help
User avatar
By btidey
#78758 Have you ticked the Show verbose output during upload in Arduino preferences?

That will give more detail on how esptool is being invoked and may give more of a clue as to what is going on?

I normally use espuino as the board for esp-12 modules as they normally should support QIO flashing.

If it appears to upload correctly but doesn't run, have you tried giving it a separate second reset? Some upload methods may not be invoking the correct reset procedure.
User avatar
By GTP
#78798 Thank you for your reply. Manually resetting the board via the rst pin or power cycling it doesn't change anything. I've enabled the verbose output and here's the part about the flashing:
Code: Select all/home/giacomo/.arduino15/packages/esp8266/tools/esptool/0.4.13/esptool -vv -cd ck -cb 115200 -cp /dev/ttyUSB0 -ca 0x00000 -cf /tmp/arduino_build_121607/CaptivePortalMatematico.ino.bin
esptool v0.4.13 - (c) 2014 Ch. Klippel <ck@atelier-klippel.de>
   setting board to ck
   setting baudrate from 115200 to 115200
   setting port from /dev/ttyUSB0 to /dev/ttyUSB0
   setting address from 0x00000000 to 0x00000000
   espcomm_upload_file
   espcomm_upload_mem
opening port /dev/ttyUSB0 at 115200
   tcgetattr
   tcsetattr
   serial open
opening bootloader
resetting board
trying to connect
   espcomm_send_command: sending command header
   espcomm_send_command: sending command payload
   espcomm_send_command: receiving 2 bytes of data
warning: espcomm_send_command: wrong direction/command: 0x01 0x03, expected 0x01 0x08
trying to connect
   espcomm_send_command: sending command header
   espcomm_send_command: sending command payload
   espcomm_send_command: receiving 2 bytes of data
   espcomm_send_command: receiving 2 bytes of data
   espcomm_send_command: receiving 2 bytes of data
   espcomm_send_command: receiving 2 bytes of data
   espcomm_send_command: receiving 2 bytes of data
   espcomm_send_command: receiving 2 bytes of data
   espcomm_send_command: receiving 2 bytes of data
   espcomm_send_command: receiving 2 bytes of data
Uploading 314160 bytes from /tmp/arduino_build_121607/CaptivePortalMatematico.ino.bin to flash at 0x00000000
   erasing flash
   size: 04cb30 address: 000000
   first_sector_index: 0
   total_sector_count: 77
   head_sector_count: 16
   adjusted_sector_count: 61
   erase_size: 03d000
   espcomm_send_command: sending command header
   espcomm_send_command: sending command payload
   setting timeout 15000
   setting timeout 1000
   espcomm_send_command: receiving 2 bytes of data
   writing flash
................................................................................ [ 26% ]
................................................................................ [ 52% ]
................................................................................ [ 78% ]
...................................................................              [ 100% ]
starting app without reboot
   espcomm_send_command: sending command header
   espcomm_send_command: sending command payload
   espcomm_send_command: receiving 2 bytes of data
closing bootloader

So there's a warning but I don't know how to interpret it, maybe just a problem while connecting to the board that then recovered?
User avatar
By btidey
#78822 Don't know what the warning is.

My output is similar but with no warning plus some extra lines at the end (if you included everything.

Code: Select allD:\Utils\Arduino\hardware\espressif\esp8266/tools/esptool/esptool.exe -vv -cd ck -cb 115200 -cp COM4 -ca 0x00000 -cf C:\Users\robert\AppData\Local\Temp\arduino_build_346065/RotaryEncoderButtonDev.ino.bin
esptool v0.4.13 - (c) 2014 Ch. Klippel <ck@atelier-klippel.de>
   setting board to ck
   setting baudrate from 115200 to 115200
   setting port from COM1 to COM4
   setting address from 0x00000000 to 0x00000000
   espcomm_upload_file
   espcomm_upload_mem
   setting serial port timeouts to 1000 ms
opening bootloader
resetting board
trying to connect
   flush start
   setting serial port timeouts to 1 ms
   setting serial port timeouts to 1000 ms
   flush complete
   espcomm_send_command: sending command header
   espcomm_send_command: sending command payload
   read 0, requested 1
trying to connect
   flush start
   setting serial port timeouts to 1 ms
   setting serial port timeouts to 1000 ms
   flush complete
   espcomm_send_command: sending command header
   espcomm_send_command: sending command payload
   espcomm_send_command: receiving 2 bytes of data
   espcomm_send_command: receiving 2 bytes of data
   espcomm_send_command: receiving 2 bytes of data
   espcomm_send_command: receiving 2 bytes of data
   espcomm_send_command: receiving 2 bytes of data
   espcomm_send_command: receiving 2 bytes of data
   espcomm_send_command: receiving 2 bytes of data
   espcomm_send_command: receiving 2 bytes of data
Uploading 402416 bytes from C:\Users\robert\AppData\Local\Temp\arduino_build_346065/RotaryEncoderButtonDev.ino.bin to flash at 0x00000000
   erasing flash
   size: 0623f0 address: 000000
   first_sector_index: 0
   total_sector_count: 99
   head_sector_count: 16
   adjusted_sector_count: 83
   erase_size: 053000
   espcomm_send_command: sending command header
   espcomm_send_command: sending command payload
   setting serial port timeouts to 15000 ms
   setting serial port timeouts to 1000 ms
   espcomm_send_command: receiving 2 bytes of data
   writing flash
................................................................................ [ 20% ]
................................................................................ [ 40% ]
................................................................................ [ 61% ]
................................................................................ [ 81% ]
.........................................................................        [ 100% ]
starting app without reboot
   espcomm_send_command: sending command header
   espcomm_send_command: sending command payload
   espcomm_send_command: receiving 2 bytes of data
closing bootloader
   flush start
   setting serial port timeouts to 1 ms
   setting serial port timeouts to 1000 ms
   flush complete