• Here is a set of instructions for anyone who wishes to flash the ESP8266 on their Espruino WiFi to a newer firmware.

    Undertake at your own risk, this involves some fiddly soldering, weird commands, strange cables, and other dark magic. Here be dragons.

    First, solder two cables to the ESP8266 chip underneath your Espruino WiFi. See the attached image.

    Next, take your 3v3 FTDI cable and connect the ESP8266 TX to FTDI RXD, and ESP8266 RX to FTDI TXD. Then connect GND on FTDI to the Espruino WiFi GND (-) pin.

    Download the ESP8266 NONOS SDK V2.0.0 20160810 firmware from https://espressif.com/en/support/downloa­d/sdks-demos. I know the V2.1.0 firmware is released, but it does not support the version of ESP8266 that you have.

    Unzip the firmware to your local machine. The files you want are inside ESP8266_NONOS_SDK/bin.

    Install esptool.py version 1.3 to your machine, this is dependant on your OS, so its up to you to get this done.

    Once installed, you need to edit the python file with your text editor. Find it, and then look for the following lines:

    ESP_RAM_BLOCK
    ESP_FLASH_BLOCK

    Make sure they look like this:

        ESP_RAM_BLOCK   = 0x80
        ESP_FLASH_BLOCK = 0x80
    

    If you can't find these blocks, you probably don't have version 1.3, go back and try again.

    Open a new terminal window and navigate to the directory with the new firmware. Remember to be in the directory ESP8266_NONOS_SDK/bin so you can see esp_init_data_default.bin, blank.bin, and a directory called at. Ignore at_sdio directory.

    Plug in your FTDI cable to your computer and work out what device it is. For me on OS X it was: /dev/cu.usbserial-FT97O28F but this is very likely to be different for you.

    Next, connect your Espruino WiFi USB, then open your Espruino IDE. On the left side, paste and run:

    digitalWrite(A14,0); // power off
    digitalWrite(A13,0); // boot mode
    digitalWrite(A14,1); // power on
    digitalRead(A2);
    digitalRead(A3);
    

    Now for the magic command:

    esptool.py -p /dev/cu.usbserial-FT97O28F -b 115200 write_flash 0x00000 at/noboot/eagle.flash.bin 0x10000 at/noboot/eagle.irom0text.bin 0x7c000 esp_init_data_default.bin 0x78000 blank.bin 0x7a000 blank.bin 0x7e000 blank.bin
    

    replace /dev/cu.usbserial-FT97O28F with the relevant FTDI device path for you, but everything else should stay the same.

    The output should look like this:

    esptool.py v1.3
    Connecting.....
    Auto-detected Flash size: 32m
    Running Cesanta flasher stub...
    0
    Flash params set to 0x0040
    Wrote 45056 bytes at 0x0 in 3.9 seconds (91.6 kbit/s)...
    Wrote 372736 bytes at 0x10000 in 32.3 seconds (92.2 kbit/s)...
    Wrote 4096 bytes at 0x7c000 in 0.4 seconds (85.5 kbit/s)...
    Wrote 4096 bytes at 0x78000 in 0.4 seconds (85.4 kbit/s)...
    Wrote 4096 bytes at 0x7a000 in 0.4 seconds (85.4 kbit/s)...
    Wrote 4096 bytes at 0x7e000 in 0.4 seconds (85.4 kbit/s)...
    Leaving...
    

    Unplug your FTDI cable, restart your Espruino WiFi.

    Currently I'm not sure how to verify it is working in an easy way (you can connect directly to the ESP8266 using FTDI and issue AT+GMR). This code on Espruino should work, but I just see 'ready' as the output. Maybe @Gordon could shed some light.

    E.on('init', function() {
      setTimeout(function() {
        digitalWrite(A14, 0);
    
        Serial2.setup(115200, { rx: A3, tx : A2, cts: A15 });
        const at = require('AT').connect(Serial2);
    
        at.cmd('AT+RST\r\n', 10000, function(data) {
          at.cmd('AT+GMR\r\n', 10000, function(data) {
                console.log(data);
          });
        });
    
        digitalWrite(A13, 1);
        digitalWrite(A14, 1);
      }, 1000);
    });
    

    It would be great if someone else could test these steps, especially @Gordon, and it would be really-really great if the next version of Espruino WiFi has ESP8266 pins broken out somewhere :D


    1 Attachment

    • 004e1d95989e3c373b99ed7bdf172f2d2d20588e.jpg
About

Avatar for dave_irvine @dave_irvine started