flashing issue with wemos d1 mini pro (esp8266 board)

All ESP8266 boards running MicroPython.
Official boards are the Adafruit Huzzah and Feather boards.
Target audience: MicroPython users with an ESP8266 board.
Post Reply
katesfb
Posts: 20
Joined: Sun Dec 18, 2016 8:09 pm

flashing issue with wemos d1 mini pro (esp8266 board)

Post by katesfb » Tue Sep 04, 2018 10:50 pm

Hi,
I am having a problem flashing the esp8266 in the Wemos d1 mini pro. This is what i have done;

First erase flash:

Code: Select all

~/Dev/esptool $ python3 esptool.py --port /dev/ttyUSB0  erase_flash
esptool.py v2.5.1-dev
Serial port /dev/ttyUSB0
Connecting....
Detecting chip type... ESP8266
Chip is ESP8266EX
Features: WiFi
MAC: 2c:3a:e8:1f:62:81
Uploading stub...
Running stub...
Stub running...
Erasing flash (this may take a while)...

A fatal error occurred: Timed out waiting for packet content
Have a crack at flashing new firmware anyway:

Code: Select all

~/Dev/esptool $ python3 esptool.py --port /dev/ttyUSB0 --baud 115200 write_flash --flash_size=detect 0 esp8266-20180511-v1.9.4.bin
esptool.py v2.5.1-dev
Serial port /dev/ttyUSB0
Connecting....
Detecting chip type... ESP8266
Chip is ESP8266EX
Features: WiFi
MAC: 2c:3a:e8:1f:62:81
Uploading stub...
Running stub...
Stub running...
Configuring flash size...
Warning: Could not auto-detect Flash size (FlashID=0xffffff, SizeID=0xff), defaulting to 4MB
Flash params set to 0x0040
Compressed 604872 bytes to 394893...

A fatal error occurred: Timed out waiting for packet content.
Any ideas what has gone wrong here?

Any help is much appreciated.

Cheers.

User avatar
mcauser
Posts: 326
Joined: Mon Jun 15, 2015 8:03 am

Re: flashing issue with wemos d1 mini pro (esp8266 board)

Post by mcauser » Fri Sep 28, 2018 3:25 am

On my machine (Macbook Pro), the D1 mini pro shows up on these ports:
* /dev/tty.wchusbserial1410
* /dev/tty.wchusbserial1420

The latest D1 mini pro uses the CH304G usb-serial chip. Previous versions were using the CP210x chip and were accessible via:
* /dev/tty.SLAB_USBtoUART
Same as the now retired LOLIN32 boards.

All of the latest Wemos ES8266/ESP32 boards are now using the same CH304G chip.
If you haven't got the driver installed, there's a link in the wiki: https://wiki.wemos.cc/downloads

Look for your device with "ls /dev/tty*"

When calling erase_flash, you need to provide the baud "--baud 115200", like you were with write_flash.
For some reason, I believe driver related, I'm unable to use anything higher than 115200 with CH304G chips.
I can go up to 460800 using boards with the CP210x chip.

Try something simple, like getting the chip id (adjust port to match yours):

Code: Select all

esptool.py --port /dev/tty.wchusbserial1410 -b 115200 chip_id
Here's how I last uploaded precompiled firmware on the now retired D1 mini pro:

Code: Select all

wget http://micropython.org/resources/firmware/esp8266-20160808-v1.8.2-118-g3e5534c.bin
esptool.py -p /dev/tty.SLAB_USBtoUART -b 115200 erase_flash
esptool.py -p /dev/tty.SLAB_USBtoUART -b 115200 write_flash -fm dio -fs 32m 0 esp8266-20160808-v1.8.2-118-g3e5534c.bin
The D1 mini Pro has 16MB flash, so to make full use, you'll need the esp init data bin from esp-open-sdk
You'll need to build. Details in the readme.
Grab the esp_init_data_default.bin file eg. esp-open-sdk/ESP8266_NONOS_SDK-2.1.0-18-g61248df/bin/esp_init_data_default.bin.
Then upload both your firmware + esp init data bin:

Code: Select all

esptool.py -p /dev/tty.wchusbserial1420 -b 115200 write_flash -fm dio -fs 16MB 0 esp8266-20180511-v1.9.4.bin 0xffc000 esp_init_data_default.bin

Post Reply