• Could use some help on this device. I can flash this fine with a 512m image, but with a few errors writing from the IDE at Espruino boot: Flash map exception, manuf 0xef chip 0x4018

    and

    save(): >save()
    =undefined
    Erasing Flash.....
    Writing.................
    ERROR: Too big to save to flash (14448 vs 12284 bytes)
    Deleting command history and trying again...
    Erasing Flash.....
    Writing..........
    Compressed 27200 bytes to 7482
    Checking...
    

    Specs for the device claim 16M bytes(128M bit) Flash...but I am not sure how to take advantage of that with esptool.py and the fragmented binary image files.

    0xffc000 should be the place where init data is stored in 16MB map.

    ./esptool.py --chip esp8266 --port /dev/ttyUSB0 write_flash -ff 20m -fm dio -fs detect 0x0000 espruino_1v95_esp8266/boot_v1.6.bin 0x1000 espruino_1v95_esp8266/espruino_esp8266_user1.bin 0xffc000 espruino_1v95_esp8266/esp_init_data_default.bin
    

    causes the device to just spew gibberish out of the serial console.

    Flashing the combined 4MB image espruino_1v95_esp8266_4mb_combined_4096.bin does not work. Only espruino_1v95_esp8266_combined_512.bin does, but this doesn't allow the amount of code I'm developing as per above.

  • esptool.py --port COM3 --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

    This command works for me for flashing 1v95 on clone D1 mini's

  • Can you confirm flash size? D1 Mini Pro is a 16MB device, the D1 Mini is 4MB. I ended up just purchasing two units of the D1 Mini, hoping it'll be an interim solution until the 16MB version is supported.

  • Hi @user85573,

    can you please share output of esptool.py --port /dev/ttyUSB0 --baud 115200 flash_id as 16MB is missing on my list of ids.

    W25Q40BV ( 4 Mega Bits / 512K Byte ) = ID 4013h
    W25Q80BV ( 8 Mega Bits / 1 Mega Byte ) = ID 4014h
    W25Q16BV ( 16 Mega Bits / 2 Mega Bytes ) = ID 4015h
    W25Q32BV ( 32 Mega Bits / 4 Mega Bytes ) = ID 4016h
    W25Q64CV ( 64 Mega bits / 8 Mega Bytes ) = ID 4017h

    Edit:
    Ups missed than on your post manuf 0xef chip 0x4018

    so it is

    W25Q128FV ( 128 Mega bits / 16 Mega Bytes ) = ID 4018h

  • Only espruino_1v95_esp8266_combined_512.bin does,

    start with esptool.py --port /dev/ttyUSB0 --baud 115200 erase_flash and then follow
    conversations http://forum.espruino.com/comments/14055829/

  • Thanks for your help! Keep in mind that wifi.save() is different than save(). save() is for saving your current code to flash so that onInit() will run on next boot. So that thread doesn't seem relevant for my case, but I will try to flash the 4MB "distributed" binaries instead of the 512K ones and report back.

    I think that what's happening here is that the 1v95 binaries are built for 512K and 4MB models. No matter where you flash the components, the runtime code doesn't point to the right memory addresses. Guess I'll have to wait until a 16MB combined binary is available.

  • A 4mb build has more save pages

    16 versus 3

  • Agreed, it's just that when I flashed espruino_1v95_esp8266_4mb_combined_4096.­bin, I believe I got serial gibberish.

    But success!

    ./esptool.py --port /dev/ttyUSB0 --baud 115200 write_flash --flash_freq 80m --flash_mode qio --flash_size 4MB-c1 0x0000 espruino_1v95_esp8266_4mb/boot_v1.6.bin 0x1000 espruino_1v95_esp8266_4mb/espruino_esp8266_user1.bin 0x3FC000 espruino_1v95_esp8266_4mb/esp_init_data_default.bin 0x3FE000 espruino_1v95_esp8266_4mb/blank.bin
    

    On boot: Flash map 4MB:1024/1024, manuf 0xef chip 0x4018 and able to save() and reboot without serial gibberish.

    In fact, it also works with just 4MB (not 4MB-c1) size: Flash map 4MB:512/512, manuf 0xef chip 0x4018.

    and with ./esptool.py write_flash --flash_size 4MB-c1 0x0000 espruino_1v95_esp8266_4mb_combined_4096.bin

    The takeaway seems to be, don't let esptool.py guess the chip size @ 16MB and don't specify 16MB.

  • In fact, it also works with just 4MB (not 4MB-c1) size:

    IME, it appears to work, but when you do wifi.save(), it no longer boots and you have to reflash.

  • Ah ok, will test and report back on 4MB-c1 vs 4MB and wifi.save().

  • Sure enough, with the 512/512 map, wifi.save() makes the device unbootable, spewing guts out on serial. Use 4MB-c1, even with the combined image.

  • Thanks for you test and feedback.

    Does is reconnect to the AP after require('ESP8266').reboot() ?

  • It does not...I've just been including Wifi in onInit().

  • there are now some updates on the ESP8266 page - check section Build Content

  • Just to recap:

    steps you did to get a stable Espruino:

    • erase flash

    • flash files from dir espruino_1v95_esp8266_4mb with flash_size 4mb-c1

    Wifi stuff:

    Wifi.connect(SSID, {password:SSIDPASS}, function(err){
      if (err === null){
        console.log('Connected to AP');
        Wifi.stopAP();
        Wifi.setConfig({powersave : 'none'});
        Wifi.save();
      } else {
        console.log('connetion error',err);
      }
    });
    
    

    I am interested in output of console.log('connetion error',err);

  • Yes, the summary is accurate. That code doesn't work for me, even with tweaking. I'll need more time.

  • Just confirming that I was also able to correctly flash the d1 mini pro using 1v96 using the 4mb-c1 option too.

  • Thanks for sharing

  • For anybody else interested in getting the d1 mini pro up and running with Espruino, I've written a guide here: https://github.com/andrewwakeling/espruino-d1-mini-pro

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

[SOLVED] Flashing WeMos D1 Mini Pro (16MB) with Espruino

Posted by Avatar for user85573 @user85573

Actions