Got d1-mini clones and not able to flash them

Posted on
Page
of 2
/ 2
Next
  • Hi!

    I wonder what should I do to fix this. I have got a few d1-mini clones with:

    Manufacturer: 20
    Device: 4016
    Detected flash size: 4MB
    

    Connecting with espruino --no-ble -b 115200 I get gibberish and similarly as http://forum.espruino.com/comments/14147­154/ I cannot connect properly.

    Hinted from the linked thread I tried all of the FLASH_MODEs and tried to connect to freshly flashed boards at 75600 bauds only to get the outputs below. Changing flash_freq, unplugging or anything else has no effect from what can I say.

    Anybody dealt with this?

    Thanks!
    Standa

    DOUT

    $ espruino --no-ble  "-b" "75600"
    
    Espruino Command-line Tool 0.1.31
    -----------------------------------
    
    Using first port, {"path":"/dev/tty.wchusbserialfd12240","­usb":[1,7523]}
    Connecting to '/dev/tty.wchusbserialfd12240'
    
     ets Jan  8 2013,rst cause:2, boot mode:(3,6)
    
    load 0x40100000, len 2408, room 16 
    tail 8
    chksum 0xe5
    load 0x3ffe8000, len 776, room 0 
    tail 8
    chksum 0x84
    load 0x3ffe8310, len 632, room 0 
    tail 8
    chksum 0xd8
    csum 0xd8
    
    2nd boot version : 1.6
      SPI Speed      : 80MHz
      SPI Mode       : DOUT
      SPI Flash Size & Map: 32Mbit(1024KB+1024KB)
    jump to run user1 @ 1000
    
    No result found for "process.env" - just got "ÿ"
    Unable to retrieve board information.
    Connection Error?
    Connected
    

    DIO

    $ esptool.py --port /dev/tty.wchusbserialfd12240 --baud 115200 write_flash \
    		--flash_freq 80m --flash_mode dio --flash_size 4MB-c1 \
    		0x0000 "boot_v1.6.bin" 0x1000 espruino_esp8266_user1.bin \
    		0x3FC000  esp_init_data_default.bin 0x3FE000 blank.bin
    esptool.py v2.3.1
    Connecting....
    Detecting chip type... ESP8266
    Chip is ESP8266EX
    ...
    Leaving...
    Hard resetting via RTS pin...
    
    $ espruino "-b" "75600" "--no-ble"
    
    Espruino Command-line Tool 0.1.31
    -----------------------------------
    
    Using first port, {"path":"/dev/tty.wchusbserialfd12240","­usb":[1,7523]}
    Connecting to '/dev/tty.wchusbserialfd12240'
    cònglo'ãì
                 [#xds](http://forum.espruino.com/search/­?q=%23xds)${$xóoà
     ets Jan  8 2013,rst cause:2, boot mode:(3,6)
    
    load 0x40100000, len 2408, room 16 
    tail 8
    chksum 0xe5
    load 0x3ffe8000, len 776, room 0 
    tail 8
    chksum 0x84
    load 0x3ffe8310, len 632, room 0 
    tail 8
    chksum 0xd8
    csum 0xd8
    
    2nd boot version : 1.6
      SPI Speed      : 80MHz
      SPI Mode       : DIO
      SPI Flash Size & Map: 32Mbit(1024KB+1024KB)
    jump to run user1 @ 1000
    
    No result found for "process.env" - just got "ÿ"
    Unable to retrieve board information.
    Connection Error?
    

    QIO

    $ esptool.py --port /dev/tty.wchusbserialfd12240 --baud 115200 write_flash \
    		--flash_freq 80m --flash_mode qio --flash_size 4MB-c1 \
    		0x0000 "boot_v1.6.bin" 0x1000 espruino_esp8266_user1.bin \
    		0x3FC000  esp_init_data_default.bin 0x3FE000 blank.bin
    
    $ espruino --no-ble -b 115200 "-b" "75600" "--no-ble"
    
    Espruino Command-line Tool 0.1.31
    -----------------------------------
    
    Using first port, {"path":"/dev/tty.wchusbserialfd12240","­usb":[1,7523]}
    Connecting to '/dev/tty.wchusbserialfd12240'
    
     ets Jan  8 2013,rst cause:2, boot mode:(3,6)
    
    load 0x40100000, len 2408, room 16 
    tail 8
    chksum 0xe5
    load 0x3ffe8000, len 776, room 0 
    tail 8
    chksum 0x84
    load 0x3ffe8310, len 632, room 0 
    tail 8
    chksum 0xd8
    csum 0xd8
    
    2nd boot version : 1.6
      SPI Speed      : 80MHz
      SPI Mode       : QIO
      SPI Flash Size & Map: 32Mbit(1024KB+1024KB)
    jump to run user1 @ 1000
    
  • Hi,

    Well this is all about --flash_mode because some use four and others two wires access flash.

    Check this page https://github.com/espressif/esptool/wik­i/SPI-Flash-Modes

    and try to lower the --flash_freq to 40m

    Try the 4MB file.

  • @MaBe I have tried all three of them to no change in behavior. See the outputs I posted above, they prove the different SPI Modes.

    Can you think of anything else? Is there anything to be learned from the rst cause?

  • DOUT @ 40MHz

    $ esptool.py --port /dev/tty.wchusbserialfd12240 --baud 115200 write_flash \
    		--flash_freq 40m --flash_mode dout --flash_size 4MB-c1 \
    		0x0000 "boot_v1.6.bin" 0x1000 espruino_esp8266_user1.bin \
    		0x3FC000  esp_init_data_default.bin 0x3FE000 blank.bin
    esptool.py v2.3.1
    Connecting....
    Detecting chip type... ESP8266
    Chip is ESP8266EX
    Features: WiFi
    Uploading stub...
    Running stub...
    Stub running...
    Configuring flash size...
    Flash params set to 0x0360
    Compressed 3856 bytes to 2763...
    Wrote 3856 bytes (2763 compressed) at 0x00000000 in 0.3 seconds (effective 114.2 kbit/s)...
    Hash of data verified.
    Compressed 520612 bytes to 343957...
    Wrote 520612 bytes (343957 compressed) at 0x00001000 in 30.8 seconds (effective 135.1 kbit/s)...
    Hash of data verified.
    Compressed 128 bytes to 75...
    Wrote 128 bytes (75 compressed) at 0x003fc000 in 0.0 seconds (effective 30.7 kbit/s)...
    Hash of data verified.
    Compressed 4096 bytes to 26...
    
    $ espruino  "-b" "75600" "--no-ble"
    
    Espruino Command-line Tool 0.1.31
    -----------------------------------
    
    Using first port, {"path":"/dev/tty.wchusbserialfd12240","­usb":[1,7523]}
    Connecting to '/dev/tty.wchusbserialfd12240'
    ¤ÅañÄoÑÑmօ!!¥aEqüÑUÕâ\anCNá¡ÿÛRÔaÕÁ
     ets Jan  8 2013,rst cause:2, boot mode:(3,6)
    
    load 0x40100000, len 2408, room 16 
    tail 8
    chksum 0xe5
    load 0x3ffe8000, len 776, room 0 
    tail 8
    chksum 0x84
    load 0x3ffe8310, len 632, room 0 
    tail 8
    chksum 0xd8
    csum 0xd8
    
    2nd boot version : 1.6
      SPI Speed      : 40MHz
      SPI Mode       : DOUT
      SPI Flash Size & Map: 32Mbit(1024KB+1024KB)
    jump to run user1 @ 1000
    
    
    Disconnected.
    
  • SPI Flash Size & Map: 32Mbit(1024KB+1024KB)

    Hmm, is this a 2MB board?

    Try to flash a esp8266 firmware.

  • Combined 4MB firmware, @ 80MHz (no change for 40MHz).

    $ esptool.py --port /dev/tty.wchusbserialfd12240 --baud 115200 erase_flash
    esptool.py v2.3.1
    Connecting....
    Detecting chip type... ESP8266
    Chip is ESP8266EX
    Features: WiFi
    Uploading stub...
    Running stub...
    Stub running...
    Erasing flash (this may take a while)...
    Chip erase completed successfully in 9.1s
    Hard resetting via RTS pin...
    
    $ esptool.py --port /dev/tty.wchusbserialfd12240 --baud 115200 write_flash \
    		--flash_freq 80m --flash_mode dio --flash_size 4MB-c1 \
    		0x0000 espruino_2v04_esp8266_4mb_combined_4096.­bin
    esptool.py v2.3.1
    Connecting....
    Detecting chip type... ESP8266
    Chip is ESP8266EX
    Features: WiFi
    Uploading stub...
    Running stub...
    Stub running...
    Configuring flash size...
    Flash params set to 0x026f
    Compressed 4194304 bytes to 351432...
    Wrote 4194304 bytes (351432 compressed) at 0x00000000 in 31.5 seconds (effective 1064.8 kbit/s)...
    Hash of data verified.
    
    Leaving...
    Hard resetting via RTS pin...
    
    $ espruino "-b" "75600" "--no-ble"
    
    Espruino Command-line Tool 0.1.31
    -----------------------------------
    
    Using first port, {"path":"/dev/tty.wchusbserialfd12240","­usb":[1,7523]}
    Connecting to '/dev/tty.wchusbserialfd12240'
    ;d$Ü|Ä$à|
              
               dìc|ì#
     ets Jan  8 2013,rst cause:2, boot mode:(3,6)
    
    load 0x40100000, len 2408, room 16 
    tail 8
    chksum 0xe5
    load 0x3ffe8000, len 776, room 0 
    tail 8
    chksum 0x84
    load 0x3ffe8310, len 632, room 0 
    tail 8
    chksum 0xd8
    csum 0xd8
    
    2nd boot version : 1.6
      SPI Speed      : 80MHz
      SPI Mode       : DIO
      SPI Flash Size & Map: 32Mbit(1024KB+1024KB)
    jump to run user1 @ 1000
    
    No result found for "process.env" - just got "ÿÿ"
    Unable to retrieve board information.
    
  • Hmm, is this a 2MB board?

    From the output above I believe it is 4MB:

    Wrote 4194304 bytes (351432 compressed) at 0x00000000 in 31.5 seconds (effective 1064.8 kbit/s)...
    Hash of data verified.
    

    Try to flash a esp8266 firmware.

    Tried 1MB and 2MB. Still the same issue.

  • Try to flash a esp8266 firmware.

    Here using qio (dio, dout make no difference).

    $ esptool.py --port /dev/tty.wchusbserialfd12240 --baud 115200 write_flash \
    		--flash_freq 80m --flash_mode qio --flash_size 4m \
    		0x0000 "boot_v1.6.bin" 0x1000 espruino_esp8266_user1.bin \
    		0x7C000 esp_init_data_default.bin 0x7E000 blank.bin
    WARNING: Flash size arguments in megabits like '4m' are deprecated.
    Please use the equivalent size '512KB'.
    Megabit arguments may be removed in a future release.
    esptool.py v2.3.1
    Connecting....
    Detecting chip type... ESP8266
    Chip is ESP8266EX
    Features: WiFi
    Uploading stub...
    Running stub...
    Stub running...
    Configuring flash size...
    Flash params set to 0x000f
    Compressed 3856 bytes to 2762...
    Wrote 3856 bytes (2762 compressed) at 0x00000000 in 0.3 seconds (effective 114.4 kbit/s)...
    Hash of data verified.
    Compressed 459684 bytes to 320164...
    Wrote 459684 bytes (320164 compressed) at 0x00001000 in 28.7 seconds (effective 128.1 kbit/s)...
    Hash of data verified.
    Compressed 128 bytes to 75...
    Wrote 128 bytes (75 compressed) at 0x0007c000 in 0.0 seconds (effective 31.0 kbit/s)...
    Hash of data verified.
    Compressed 4096 bytes to 26...
    Wrote 4096 bytes (26 compressed) at 0x0007e000 in 0.0 seconds (effective 1139.4 kbit/s)...
    Hash of data verified.
    
    Leaving...
    Hard resetting via RTS pin...
    
    $ espruino --no-ble  "-b" "75600"
    
    Espruino Command-line Tool 0.1.31
    -----------------------------------
    
    Using first port, {"path":"/dev/tty.wchusbserialfd12240","­usb":[1,7523]}
    Connecting to '/dev/tty.wchusbserialfd12240'
    
     ets Jan  8 2013,rst cause:2, boot mode:(3,6)
    
    load 0x40100000, len 2408, room 16 
    tail 8
    chksum 0xe5
    load 0x3ffe8000, len 776, room 0 
    tail 8
    chksum 0x84
    load 0x3ffe8310, len 632, room 0 
    tail 8
    chksum 0xd8
    csum 0xd8
    
    2nd boot version : 1.6
      SPI Speed      : 80MHz
      SPI Mode       : QIO
      SPI Flash Size & Map: 4Mbit(256KB+256KB)
    jump to run user1 @ 1000
    
  • Wow, what a unfriendly clone!

    Do you another untouched board? If yes connect via serial and press reset to figure out how it was flashed.

    ?nd boot version : 1.?
      SPI Speed      : ?
      SPI Mode       : ?
      SPI Flash Size & Map: ?
    jump to run user1 @ 1000
    
    

    Use this information to tame it .

    Start with erase_flash and than with write_flash.

  • set terminal to 74880-8-N-1 and you get something like this (ESP01S with 1MB flash)


    1 Attachment

    • Bildschirmfoto 2020-03-29 um 11.03.30.jpg
  • Untouched board experiments.

    Connecting to the 76800-8-N-1 i get (raw mode). I don't get any SPI Mode nor info etc.

    <8A><E6><80><98><80><E6><80><98><80><F8>­<98><FE><9E>`fx<E6><98><1E>ff<00><98><E0­>f~<1E><06>~<FE><9E><E6><9E><0D><0A>
     ets Jan  8 2013,rst cause:2, boot mode:(3,6)<0D><0A>
    <0D><0A>
    load 0x40100000, len 29796, room 16 <0D><0A>
    tail 4<0D><0A>
    chksum 0xf7<0D><0A>
    load 0x3ffe8000, len 2268, room 4 <0D><0A>
    tail 8<0D><0A>
    chksum 0x5d<0D><0A>
    load 0x3ffe88dc, len 8, room 0 <0D><0A>
    tail 8<0D><0A>
    chksum 0x60<0D><0A>
    csum 0x60<0D><0A>
    <C8><EB><B9><B9><1B>P<A3>)<A9><E4>(rr <0D><0A>
    S<80><80><00><00><80><00><80><80><00><00­><80><00><00><00><80><80><80><80><00><00­><80><80><80><00><80><80><80>...
     ets Jan  8 2013,rst cause:2, boot mode:(3,6)<0D><0A>
    <0D><0A>
    load 0x40100000, len 29796, room 16 <0D><0A>
    tail 4<0D><0A>
    chksum 0xf7<0D><0A>
    load 0x3ffe8000, len 2268, room 4 <0D><0A>
    tail 8<0D><0A>
    chksum 0x5d<0D><0A>
    load 0x3ffe88dc, len 8, room 0 <0D><0A>
    tail 8<0D><0A>
    chksum 0x60<0D><0A>
    csum 0x60<0D><0A>
    <C8><EB><B9>3<1B>P<8B>r+<E4>P<8D>nN<F8><­0D><0A>
    S<80><80><00><00><80><00><80><80><00><00­><80><00><00><00><80><80><80><80><00><00­><80><80><80><00><80><80><80>...
    

    Connecting to via 9600-8-N-1 I get functional interactive NodeMCU lua firmware (see below).

    NodeMCU custom build by frightanic.com
    	branch: master
    	commit: c8037568571edb5c568c2f8231e4f8ce0683b883­
    	SSL: false
    	modules: cjson,file,gpio,net,node,pwm,tmr,uart,wi­fi
     build 	built on: 2016-03-14 02:10
     powered by Lua 5.1.4 on SDK 1.4.0
    lua: cannot open init.lua
    > 
    
  • perhaps interesting to share that I get the following in the IDE using WebSerial @115200. But gets stuck with Serial connected. Receiving data.... Flashed with DIO.

    ÙYma¹:¼ !aT¾Ð¿°)VRõýÿ@yM!'wr$d<$à<$äc|äÛ{#cóo'$'gãìbplr$sl8û'àl#oã|ÄcÄóonîlÄÇl n'$`g{oÛl`pònà;ÄÜãàcgã|ìÇbòn'çl`gd`osÛnl8û'à;ãàì$#oã|ÄÇÄ#û'oïd`n'$`g{oÃl`sÛgd`{lÄÄ'ÄóonßâÄ;o'dcÇ$ìÛdäÛ$dls$ìd$$gâ`ìlÄØoàgäollàcä$$8#cx#;#pÀÇc$lÛ'gÄâod|$d`{lãìoä;û'<äldl$`cÛß|{l'àgãl Äãsddþ
     ____                 _
    |  __|___ ___ ___ _ _|_|___ ___
    |  __|_ -| . |  _| | | |   | . |
    |____|___|  _|_| |___|_|_|_|___|
             |_| espruino.com
     2v04 (c) 2019 G.Williams
    Espruino is Open Source. Our work is supported
    only by sales of official boards and donations:
    http://espruino.com/Donate
    Flash map 4MB:1024/1024, manuf 0x20 chip 0x4016
    > 
    

    From the cmd line

    $ espruino --no-ble "-b" "75600"
    
    Espruino Command-line Tool 0.1.31
    -----------------------------------
    
    Using first port, {"path":"/dev/tty.wchusbserialfd12240","­usb":[1,7523]}
    Connecting to '/dev/tty.wchusbserialfd12240'
    zàä!!S%ö¿¦I¬&3-ÿBµÕ4ý=·
     ets Jan  8 2013,rst cause:2, boot mode:(3,6)
    
    load 0x40100000, len 2408, room 16 
    tail 8
    chksum 0xe5
    load 0x3ffe8000, len 776, room 0 
    tail 8
    chksum 0x84
    load 0x3ffe8310, len 632, room 0 
    tail 8
    chksum 0xd8
    csum 0xd8
    
    2nd boot version : 1.6
      SPI Speed      : 80MHz
      SPI Mode       : DIO
      SPI Flash Size & Map: 32Mbit(1024KB+1024KB)
    jump to run user1 @ 1000
    
    
    Disconnected.
    

    And when on 115200 it just gives garbage and sometimes the /dev/tty.wchusbserialfd12240 disappears for a while. Sometimes till I unplug/plug again.

  • #11, what happens when you press reset, I had to press a couple of times until I got the info

  • NodeMCU custom build by frightanic.com

    branch: master
    commit: c8037568571edb5c568c2f8231e4f8ce0683b883­
    SSL: false
    modules: cjson,file,gpio,net,node,pwm,tmr,uart,wi­fi
    

    Any info about flash setting for NodeMCU?

  • Connecting to the 76800-8-N-1 i get (raw mode)

    try 74880

  • 74880

    The 'SerialTools.app' I used didn't have that baud selection.

    When using this screen /dev/tty.wchusbserialfd12240 74880 I got the same (with multiple reset presses). Never saw anything else. No info on the flash settings.

    > �En���H2�x, $����| <��4b:���
    
    NodeMCU custom build by frightanic.com
            branch: master
            commit: c8037568571edb5c568c2f8231e4f8ce0683b883­
            SSL: false
            modules: cjson,file,gpio,net,node,pwm,tmr,uart,wi­fi
     build  built on: 2016-03-14 02:10
     powered by Lua 5.1.4 on SDK 1.4.0
    lua: cannot open init.lua
    > �O�$<�"`�D>l|l$�@>`ddt��,�����
    
    NodeMCU custom build by frightanic.com
            branch: master
            commit: c8037568571edb5c568c2f8231e4f8ce0683b883­
            SSL: false
            modules: cjson,file,gpio,net,node,pwm,tmr,uart,wi­fi
     build  built on: 2016-03-14 02:10
     powered by Lua 5.1.4 on SDK 1.4.0
    lua: cannot open init.lua
    > 2$l��"$�|�4�>e�8�x�H<��< :�ۈ�
    
    NodeMCU custom build by frightanic.com
            branch: master
            commit: c8037568571edb5c568c2f8231e4f8ce0683b883­
            SSL: false
            modules: cjson,file,gpio,net,node,pwm,tmr,uart,wi­fi
     build  built on: 2016-03-14 02:10
     powered by Lua 5.1.4 on SDK 1.4.0
    lua: cannot open init.lua
    
  • It’s the garbage you have to make visible.

    On Mac OS X I use CoolTerm.

  • Wow, check the baud rate

    https://nodemcu.readthedocs.io/en/master­/flash/

    and flasher source code

  • The following makes it work

    esptool.py --port /dev/tty.wchusbserialfd12240  write_flash -fs 4MB-c1 -fm dio 0x0 espruino_2v04_esp8266_4mb_combined_4096.­bin
    

    As I suspected in the http://forum.espruino.com/comments/15179­132 it meant that the firmware was actually fine. Just connecting to it has to have the XON/XOFF flow control turned off. I did not even realize something like this was even added and turned on by-default.

    So the following allows me to connect:

    espruino --config SERIAL_FLOW_CONTROL=false --no-ble -b 115200
    

    Thanks for all your hints @MaBe

  • This separate files doesn't seem to work properly in my case. Both with previous flash erasure. What could be the reasons for that?

    esptool.py --port /dev/tty.wchusbserialfd12240  write_flash -fs 4MB-c1 -fm dio 0x0000 boot_v1.6.bin 0x1000 espruino_esp8266_user1.bin 0x3FC000 esp_init_data_default.bin 0x3FE000 blank.bin
    

    Both of the flash command lines result in (when connecting on 74880-8-N-1)

    Jan  8 2013,rst cause:2, boot mode:(3,6)
    
    load 0x40100000, len 2408, room 16 
    tail 8
    chksum 0xe5
    load 0x3ffe8000, len 776, room 0 
    tail 8
    chksum 0x84
    load 0x3ffe8310, len 632, room 0 
    tail 8
    chksum 0xd8
    csum 0xd8
    
    2nd boot version : 1.6
      SPI Speed      : 40MHz
      SPI Mode       : DIO
      SPI Flash Size & Map: 32Mbit(1024KB+1024KB)
    jump to run user1 @ 1000
    
    rf cal sector: 1019
    freq trace enable 0
    
  • Great job, thanks for sharing the solution!

    Can you please share the link where you got those boards from.

  • It is still not usable completely...

    I get less garbage with 80MHz SPI Speed. But the serial connection drops after a while for no apparent reason... It behaves similarly with 20MHz.

    wifi.connect() makes it disconnect and not possible to connect anymore.

    It almost looks like some kind of thermal watchdog resetting after a while. It is fairly warm when I touch it in just a few seconds of plugging in.

  • The Tasmota MQTT firmware works without any issues on the same board with the following flash command

    esptool.py --port /dev/tty.wchusbserialfd12240  write_flash -fs 1MB -fm dout 0x0 tasmota.bin
    

    So it looks like it's not the board part itself.

  • @opichals can you please share which make entry you used to get this board running Espruino?

  • It's from here
    https://www.aliexpress.com/item/32662942­091.html?spm=a2g0s.9042311.0.0.5e184c4dZ­PSXYs

    But the boards I got don't seem to be WAVGAT nor AI Thinker modules.

  • Post a reply
    • Bold
    • Italics
    • Link
    • Image
    • List
    • Quote
    • code
    • Preview
About

Got d1-mini clones and not able to flash them

Posted by Avatar for opichals @opichals

Actions