Flashing Espruino fails, bootoader LED not pulsating

Posted on
  • Hy, I received my 2 Espruinos yesterday. After firing on of them up, I realized that it still had a slightly old firmware on it with that regression bug where some characters after each function have to be inserted to make it work.

    Now i tried to upgrade the 2 espruinos (via the chrome IDE as explained in the guide), it worked like a charm for the first device.
    When i tried to do it with the second one, i realized that the bootloader LED wasn't pulsating as described (and as my first device did). Instead the blue & red (LED1&3) are both lighting up very bright and staying that way until i press the reset button again. I first thought this had sth to do with my windows laptop. The device also isn't recognized as a serial device anymore when it is in this state.

    Now i tried it on my linux laptop with the same result. Here is the syslog output i get (first doing a normal reset and then the btn+reset reset for the bootloader)

    # reset espruino normally
    Jan 30 19:48:18 paulbook3 kernel: [ 1028.760404] usb 2-1.2: new full-speed USB device number 37 using ehci-pci
    Jan 30 19:48:18 paulbook3 kernel: [ 1028.855671] usb 2-1.2: New USB device found, idVendor=0483, idProduct=5740
    Jan 30 19:48:18 paulbook3 kernel: [ 1028.855687] usb 2-1.2: New USB device strings: Mfr=1, Product=2, SerialNumber=3
    Jan 30 19:48:18 paulbook3 kernel: [ 1028.855696] usb 2-1.2: Product: STM32 Virtual COM Port  
    Jan 30 19:48:18 paulbook3 kernel: [ 1028.855704] usb 2-1.2: Manufacturer: STMicroelectronics
    Jan 30 19:48:18 paulbook3 kernel: [ 1028.855712] usb 2-1.2: SerialNumber: 48E074533330
    Jan 30 19:48:18 paulbook3 kernel: [ 1028.857526] cdc_acm 2-1.2:1.0: This device cannot do calls on its own. It is not a modem.
    Jan 30 19:48:18 paulbook3 kernel: [ 1028.857635] cdc_acm 2-1.2:1.0: ttyACM0: USB ACM device
    Jan 30 19:48:18 paulbook3 mtp-probe: checking bus 2, device 37: "/sys/devices/pci0000:00/0000:00:1d.0/us­b2/2-1/2-1.2"
    Jan 30 19:48:18 paulbook3 mtp-probe: bus: 2, device: 37 was not an MTP device
    
    # try to put device into bootloader mode
    Jan 30 19:48:22 paulbook3 kernel: [ 1033.426277] usb 2-1.2: USB disconnect, device number 37
    Jan 30 19:48:23 paulbook3 kernel: [ 1033.626612] usb 2-1.2: new full-speed USB device number 38 using ehci-pci
    Jan 30 19:48:23 paulbook3 kernel: [ 1033.698622] usb 2-1.2: device descriptor read/64, error -32
    Jan 30 19:48:23 paulbook3 kernel: [ 1033.874694] usb 2-1.2: device descriptor read/64, error -32
    Jan 30 19:48:23 paulbook3 kernel: [ 1034.050810] usb 2-1.2: new full-speed USB device number 39 using ehci-pci
    Jan 30 19:48:23 paulbook3 kernel: [ 1034.122837] usb 2-1.2: device descriptor read/64, error -32
    Jan 30 19:48:23 paulbook3 kernel: [ 1034.298915] usb 2-1.2: device descriptor read/64, error -32
    Jan 30 19:48:24 paulbook3 kernel: [ 1034.474971] usb 2-1.2: new full-speed USB device number 40 using ehci-pci
    Jan 30 19:48:24 paulbook3 whoopsie[1076]: online
    Jan 30 19:48:24 paulbook3 kernel: [ 1034.883016] usb 2-1.2: device not accepting address 40, error -32
    Jan 30 19:48:24 paulbook3 kernel: [ 1034.955220] usb 2-1.2: new full-speed USB device number 41 using ehci-pci
    Jan 30 19:48:24 paulbook3 kernel: [ 1035.363240] usb 2-1.2: device not accepting address 41, error -32
    Jan 30 19:48:24 paulbook3 kernel: [ 1035.363408] hub 2-1:1.0: unable to enumerate USB device on port 2
    Jan 30 19:48:25 paulbook3 whoopsie[1076]: online
    

    Is this a known problem? How can I update that second device?

  • That's odd.. Bright blue + red means it's trying to establish a USB connection.

    I've only come across one other issue of this - and that was today.

    So (as the log would suggest) it works ok out of bootloader mode? The crazy thing here is that the USB code is exactly the same for the bootloader and the main Espruino - it's compiled from the same source code.

    Have you tried unplugging Espruino, and then plugging it in with BTN1 held down? Also maybe just try holding reset down for maybe 5 seconds (with BTN1 held down too). It could be that the OS doesn't like it disappearing from view and then reappearing a fraction of a second later.

  • I tried your suggestions (holding the reset button longer or plugging i in with btn1 pressed). However I always see the same behaviour (blue and red light lighting up).

    I also tried again with the other (working) board, there it always works and the bootloader is able to connect withing a fraction of a second (led changes to pulsating blue).

    Changing back to the windows machine and trying the same things didn't show any difference.

    The problem-device currently has V1.43 the other one that i managed to update V1.47 and i just upgraded it to V1.48.

    Are there any other things i can try to update my second board (and yes you assumed correctly that the "normal" mode is working fine on the board, both on linux and windows.

    In Windows, when trying to connect the device in bootloader mode, this window pops up: http://prntscr.com/2o1get

  • I wonder whether the USB bootloader is corrupt. The firmware should have been verified, but I wonder whether Seeed decided to leave off that step because it took too long :(

    Can you try running the following code:

    var crc = 0; for (var i=0x08000000;i<0x08002800;i+=4) crc = (crc<<1)^(crc>>63)^peek32(i); console.log(crc);

    And let me know what the result is? I get 2628236757068185765 here.

  • Hi,

    Just received my 2 Espruinos today. Tried flashing as per procedure outlined on Linux using the Chrome app. Everything goes fine like 'Erasing' -> 'Writing Flash and then I get an 'Error flashing' error.

    Kindly advise.

  • @user6376, How far through "writing" did you get? Was it immediate, or did the progress bar manage to move forwards a bit?

    Please can you try again on a different USB port?

    This time you won't be able to do the first steps to get the URL, so copy and paste http://www.espruino.com/binaries/espruin­o_1v48_espruino_1r3.bin into the text box and skip straight to the step where you press RST while holding down BTN.

  • i also get 2628236757068185765 so that seems fine

  • I have now tried the device on 2 Linux machines, a Windows 7 and a Windows 8 machines, I get the same symptoms everywhere.
    I guess that means that one of my boards has a hardware problem, or is there any other explanation?

  • Holy cow... :D

    I just flashed the device that was making problems. I found a way to put it into bootloader mode (get the pulsating blue led). The trick is: pressing the BTN1 button hard.
    This is totally reproducable on my board, if i press BTN1 normally (i hear the click sound and it obviously does something because after releasing RST the red & blue LEDs light up).
    But I press BTN1 hard (to a point where i see the PCB slightly bending already - just barely visible, not total brute-force) and then press & release RST it goes into the bootloader mode just fine (red & blue LEDs go away after fraction of a second and i get to pulsating blue LED).

    Sooo... i don't really know what that means (maybe one of the BTN1 solder-connections isn't 100% ok?) but anyhow: i have now updated my second board :) that's a relief.

    Thanks for your help!

  • Hmm. That seems very strange. Could you take a look at the 5 pins that come out of the back of the USB connector and make sure that they are all properly attached?

  • The error notification is almost instantaneous. checked again as instructed but still get the same error... changed the USB port and used the link that points to http://microcosm.app/out/Rev

  • Thanks for letting me know... So just to be sure, this is pretty much what happens for you:

    • The blue LED is pulsing on the Espruino board
    • You click Write Firmware
    • Web IDE says Downloading Firmware (very quickly)
    • Web IDE says Initialised
    • Web IDE says Erasing... And red/green/blue leds start winking
    • Web IDE says Writing Flash... and the blue led on the board is still just pulsing blue
    • Finally it says Error Flashingand the blue led on the board is still just pulsing blue
  • Yes. Exactly

  • That's really weird - seems like something that happened with an older version of the Web IDE. You're definitely using the Web IDE from the Chrome store? Not an older version from somewhere else?

    What type of computer are you using? Is there any chance you could try it on a different one just to rule that out?

    I'll try and update the Web IDE today so it gives some better diagnostic information about what's going on when flashing fails...

  • Thanks. That worked. Switched to a Win7 laptop. Firmware updated. Running blinking-led. Was earlier running on Ubuntu 10.04 with Chrome v27

    Learning:

    1. The IDE works fine on Ununtu 10.04 with Chrome v27 except for firmware updates.
    2. For firmware updates switch to a Windows7 machine.

    One request regarding the latest firmware - would help if it shows the red led 'on' when connected properly as was the case with the earlier firmware. Confirms that the USB connector is plugged in properly.

    Thanks once again.

  • Hi,

    Great! Thanks for the update!

    I'd actually just assumed that everyone would be running with chrome v31 (generally it auto-updates) - I guess you're running Chromium? Any chance you could try installing normal Chrome on Ubuntu (https://www.google.com/intl/en/chrome/br­owser/) and see if that fixes it, then I can update the documentation.

    I guess it makes more sense to update the Web IDE to check your Chrome version...

    For the LED - you should get a brief blink of the red LED when it powers up? I suppose a nice thing to do might be to pre-program the firmware with a flashing LED example...

  • Another update

    Firmware update works on Ubuntu 12.04 Chrome v32. The emphasis is on using Chrome version >31.

  • Great - thanks! I've just updated the Web IDE so that it does a test for the chrome version. I'll try and push it out to everyone today.

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

Flashing Espruino fails, bootoader LED not pulsating

Posted by Avatar for NoUsername @NoUsername

Actions