Avatar for daw

daw

Member since Oct 2017 • Last active Dec 2017
  • 1 conversations
  • 11 comments

Semi-retired software engineer who can't remember how he found out about Espruino.

Maybe the motivation I need to finally learn Javascript. ;-)

Most recent activity

  • in Pico / Wifi / Original Espruino
    Avatar for daw

    Well now I am starting to think that my official/known-to-work board is no longer working.

    I just re-tried the following code that I had used earlier to determine the esp8266 firmware version on my EspruinoWiFi:

    var serial = Serial2;
    var pins = { rx: A3, tx : A2 };
    function test(baud) {
      serial.removeAllListeners();
      var l="";
      serial.on('data', function(d) {l+=d;});
      serial.setup(baud, pins);
      serial.write("AT+GMR\r\n");
      setTimeout(function(){console.log(JSON.s­tringify(l));},800);
    }
    //digitalWrite(B9,1); // enable on Pico Shim V2
    digitalWrite(A14,1); // enable on EspruinoWiFi
    setTimeout(function() { test(9600); }, 2000);
    setTimeout(function() { test(115200); }, 3000);
    setTimeout(function() { test(57600); }, 4000);
    setTimeout(function() { console.log("Done!"); }, 5000);
    

    It used to return the response to AT+GMR as expected but now is just appears to be returning the output of the AT+RST command?????!!!!!

    As well, the blue LED on the EspruinoWiFi and the ESP-12 module are continuously blinking on and off after issuing the code as well until the board is unplugged and plugged back in.

    "" "\r\n ets Jan 8 2013,rst cause:1, boot mode:(3,7)\r\n\r\nload
    0x40100000, len 1396, room 16 \r\ntail 4\r\nchksum 0x89\r\nload
    0x3ffe8000, len 776, room 4 \r\ntail 4\r\nchksum 0xe8\r\nload
    0x3ffe8308, len 540, room 4 \r\ntail 8\r\nchksum 0xc0\r\ncsum
    0xc0\r\n\r\n2nd boot version : 1.4(b1)\r\n SPI Speed : 40MHz\r\n
    SPI Mode : DIO\r\n SPI Flash Size & Map:
    8Mbit(512KB+512KB)\r\njump to run user1 @ 1000\r\n\r\n" "" Done!

    I am at a loss, but at least I can still blink LEDs. :)

    Update

    It's looking like this EspruinoWiFi is definitely broken. The two test programs (1. get esp8266 firmware version and 2. Get hello.txt webpage) that I have tried from the documentation pages have failed.

    I soldered a flashed ESP-12 module onto the clone EspruinoWiFi that I build and I was pleased to see that the same two samples work on it! :)

    I am guessing that I may have corrupted the esp8266 firmware on the EspruinoWiFi board that I purchased.

    I am going to remove the WiFi module from the board and put it into my programming jig in the morning if unless there are other suggestions on things to try first before then.

    This stuff makes desoldering multi-leaded components a breeze. :D

    http://www.chipquik.com/store/product_in­fo.php?products_id=210001

  • in Pico / Wifi / Original Espruino
    Avatar for daw

    Still fighting with this.

    I tried the following code in an attempt to communicate directly with the onboard ESP-12 module but it just resets in it continuously resetting and spewing out the boot up messages.

    Serial2.setup(115200, { rx: A3, tx : A2 });
    Serial2.on('data', function(d) { USB.write(d); });
    USB.on('data', function(d) { Serial2.write(d); });
    Serial1.setConsole();
    

    What am I missing?

  • in Pico / Wifi / Original Espruino
    Avatar for daw

    Yup, that was it. :(

    So now flash_id is working but read_flash is not...

    C:\Work\Development\ESP8266\esptool-1.3>­esptool.py -p COM5 -b 115200 read_flash 0 1024 test.bin
    esptool.py v1.3
    Connecting...
    Running Cesanta flasher stub...

    A fatal error occurred: Invalid head of packet ('\x13')

    I have changed the sizes in the script to the following as directed, but it appears that this is for writing the flash, not reading:

    # Maximum block sized for RAM and Flash writes, respectively.
    ESP_RAM_BLOCK   = 0x80
    ESP_FLASH_BLOCK = 0x80
    

    I really don't want to try write flash on this board since I don't want to screw up the only good one that I have. :)

    I'll get the ESP module soldered onto my "clone" and see where that leads me.

    Thanks again for your help.

  • in Pico / Wifi / Original Espruino
    Avatar for daw

    Oh, crap. Maybe the missing new-line at the end of the last line of pasted code?

  • in Pico / Wifi / Original Espruino
    Avatar for daw

    Well that is interesting.

    I executed the code as before but this time, before clicking the disconnect button, I pressed the enter key in the console window and saw it respond with

    -> Serial1

    I was then able to run esptool and saw:

    C:\Work\Development\ESP8266\esptool-1.3>­esptool.py -p COM5 -b 115200 flash_id
    esptool.py v1.3
    Connecting...
    Manufacturer: e0
    Device: 4016

    Terrific, it works!!!!

    So what foolish mistake did I make? ;-)

  • in Pico / Wifi / Original Espruino
    Avatar for daw

    Using a logic probe, I have verified that I see activity on RX/TX of the ESP when I am running a "normal" WiFi application but no apparent activity on those pins when trying to communicate with the ESP via the STM32 with the ESP in bootloader mode.

  • in Pico / Wifi / Original Espruino
    Avatar for daw

    Strange, I just noticed that the first time I tried this it said

    boot mode:(1,7)

    now I can only seem to get

    boot mode:(1,0)

    not sure if what that means or if it is relevant

  • in Pico / Wifi / Original Espruino
    Avatar for daw

    Exactly. :)

    I am pretty confident that the ESP is going into boot mode, though.

    I tweaked the code slightly setting the Serial2 baud rate to 74880 and now when I run it I see this in the console window:

    digitalWrite(A14,0); // power off
    =undefined
    digitalWrite(A13,0); // boot mode
    =undefined
    =undefined
    Serial2.setup(74880, { rx: A3, tx : A2 });
    =undefined
    Serial2.on('data', function(d) { USB.write(d); });
    =undefined
    =undefined
    Serial1.setConsole();
    ets Jan 8 2013,rst cause:1, boot mode:(1,0)
    Disconnected

  • in Pico / Wifi / Original Espruino
    Avatar for daw

    Hello Gordon, thank you for your reply.

    My apologies, but I think my previous post was not entirely clear and complete based on a couple of things in your reply. (I have not modified the boot loader and A15 should already be tied low per your design)

    The board I am attempting to build is essentially an exact copy of the official EspruinoWiFi built from the Eagle files you have made available and running the latest version of Espruino software updated via the IDE.

    Now, onto my issues attempting to flash the ESP-12 module through the EspruinoWiFi board.

    I had read the following instructions and forum post in an attempt to see if it would work on the EspruinoWiFi board:

    http://www.espruino.com/ESP8266#use-espr­uino

    and

    http://forum.espruino.com/conversations/­308773/#comment13792058

    In the linked forum post, the user soldered wires to RX/TX on the onboard ESP module and I would prefer to avoid that if possible.

    I am actually running the code shown in my previous post on the officially purchased board as a “proof of concept”. Board is connected to the IDE, code shown is pasted into the left side of the IDE and certainly seems to execute as written, disconnect button on IDE is pressed, and then I issue the following command on my PC:

    esptool.py -p COM7 -b 115200 flash_id

    My thinking is that if the non-destructive flash_id command works, then the write_flash command should also work.

    I hope am making some sense.

    Thanks again.

    Dale

    p.s. I finally managed to get the AT firmware flashed onto my leadless, unmounted ESP-12S module so none of the above is any way a show stopper.

Actions