So you're a Noob? Post your questions here until you graduate! Don't be shy.

User avatar
By dasfreak
#87109 New to ESP8266 from RPi's. I was flashing micropython on on a Lilon nodemcu board and it failed. Now when I restart the board, the wifi activity flashes rapidly on and off at power-on. Connecting to serial I get a screen of extended ascii output with no additional information. I've attempted to connect on Mac and Linux using both regular USB/Serial and a USB/UART adaptor connected to the GPIO pins.

Tried to rectify the error using esptool which also failed and got the following output.

Code: Select all% esptool.py --port /dev/cu.usbserial-1440 --baud 9600 --after no_reset write_flash --flash_mode qio 0x00000 /Users/gmerrall/Downloads/nodemcu-master-7-modules-2020-05-15-03-35-03-float.bin --erase-all
esptool.py v2.8
Serial port /dev/cu.usbserial-1440
Connecting........_____....._____....._____....._____....._____....._____....._____

A fatal error occurred: Failed to connect to Espressif device: Invalid head of packet (0xF0)


Have I killed it? If so no big deal but would love to learn by resolving. Any advice appreciated.
User avatar
By dasfreak
#87141 Update: Have erased the flash but unable to write new firmware. Using standard USB to serial using a micro-USB to USB-A cable. Have tried 3 cables plugged directly into my PC (not via hub) and esptool.py fails consistently.

Code: Select all% esptool.py --port /dev/ttyUSB0 --after no_reset write_flash --flash_mode dio 0x00000 ./nodemcu-master-10-modules-2020-05-16-15-39-38-float.bin         
esptool.py v2.8
Serial port /dev/ttyUSB0
Connecting.....
Detecting chip type... ESP8266
Chip is ESP8266EX
Features: WiFi
Crystal is 26MHz
MAC: 8c:aa:b5:0d:f3:c9
Uploading stub...
Running stub...
Stub running...
Configuring flash size...
Auto-detected Flash size: 4MB
Flash params set to 0x0240
Compressed 466944 bytes to 306107...
Writing at 0x00004000... (10 %)
A fatal error occurred: Failed to write compressed data to flash after seq 1 (result was C100)


What's interesting to observe is that it fails in exactly the same place each time. A different firmware image just has it fail consistently in a different place. I suspected the baud rate might be a factor but altering it to a wide range of values either causes packet times, an "invalid head of packet error", or it still fails at the same place.

Next stop is trying a USB to TTL serial cable instead. Specifically this one.
User avatar
By QuickFix
#87179 What does a terminal say (in PuTTY and the like) if you open a serial connection at 74880 Baud?
If it's something like this, the ESP itself is fine:
Code: Select all ets Jan  8 2013,rst cause:2, boot mode:(3,6)

load 0x4010f000, len 1384, room 16
tail 8
chksum 0x2d
csum 0x2d
v00000000
~ld


You don't need an external USB -> UART convertor when using a NodeMCU, not even sure if it would bite the on-board one.
It has been a long time since I've flashed firmware manually, but the flasher does, IIRC, not support automatic reset/flash-mode, so you'll have to put the board in flash mode manually before starting the flashing software:
  • Connect the board to USB (so it has power and has a connection): make a note of the used COM-port
  • Press and hold the [FLASH] button
  • Press and release the [RST] button
  • Release the [FLASH] button
  • Start the firmware flashing program, using the correct COM-port settings