• Sat 2019.10.26

    Was in the process of attempting to resolve an issue for another forum post and needed to
    flash to current version.

    Didn't want to hijack the following as I'm not flashing a Puck, but this may be related as it appears still unresolved. (three weeks now without update)

    Puck.js failed to update firmware; can't hard reset now

    fr #7 http://forum.espruino.com/comments/14936­620/

    Still get the stuck uploading green bar, but an additional error using the native app.

    Entering bootloader mode releasing button after one second and view red LED is illuminated


    First attempt using WebIDE native app   v0.70.06
    Note that the device was found blue and then connected green

    TypeError: failed to execute 'requestDevice' on 'Bluetooth' required member filters is undefined.


    Needed to close IDE, unpair device, then 'Add a Device' then pair then relaunch IDE. That worked great
    until I tried the Chrome version. Then device becomes locked and unusable.



    Second attempt using Chrome Version 77.0.3865.120 (Official Build) (64-bit)

    https://www.espruino.com/ide/#

        LOADING ...
    Found MDBT42Q, 1v99
    Connected to Web Bluetooth, MDBT42Q 5389
    Disconnected
    >
    Updating application: espruino_2v04_mdbt42q_app.bin...
    
    
    Console output
     
    No code in storage.
    serviceworker> active
    Handling URL "https://www.espruino.com/ide/"
    No navigator.serial - Web Serial not enabled
    ERROR: serial_frame: getPorts timeout, disabling
    ERROR: getURL("/serial/ports") error : Not Found
    /serial/ports doesn't exist - disabling WebSocket support
    Couldn't connect to wss://localhost:31234 - disabling websockets for this session
    >>> Connecting...
    Set Slow Write = true
    >>> Connecting to MDBT42Q 5389
    BT>  Device Name:       MDBT42Q 5389
    BT>  Device ID:         e/iYKbDcuVb1yiSIggpnaw==
    >>> Connected to BLE
    BT> Connected
    >>> Configuring BLE...
    BT> Got service
    >>> Configuring BLE....
    BT> RX characteristic:{}
    >>> Configuring BLE....
    >>> Configuring BLE.....
    BT> TX characteristic:{}
    >>> Configuring BLE.....
    Set Slow Write = false
    >>> BLE configured. Receiving data...
    Connected [object Object]
    Received a prompt after sending newline... good!
    >>> Sending...
    ---> "\u0010print(\"<\",\"<<\",JSON.stringify­(process.env),\">>\",\">\")\n"
    >>> Sent
    Got "< << {\"VERSION\":\"1v99\",\"GIT_COMMIT\":\"f­0d66ba\",\"BOARD\":\"MDBT42Q\",\"FLASH\"­:524288,\"RAM\":65536,\"SERIAL\":\"27dd3­4cc-f06cc0ad\",\"CONSOLE\":\"Bluetooth\"­,\"MODULES\":\"Flash,Storage,net,dgram,h­ttp,NetworkJS,crypto,neopixel\",\"EXPTR\­":536882348} >> >\r\n>"
    [notify_info] Found MDBT42Q, 1v99
    Loading https://www.espruino.com/json/MDBT42Q.js­on
    Board JSON loaded
    Firmware >1.43 supports faster writes over USB
    Set Slow Write = false
    FIRMWARE: Current 1v99, Available 2v04
    Device found {"portName":"MDBT42Q 5389"}
    [success] Connected to Web Bluetooth, MDBT42Q 5389
    >>> Connected to Web Bluetooth, MDBT42Q 5389
    Downloading https://www.espruino.com/binaries/esprui­no_2v04_mdbt42q.zip
    >>> Downloading binary...
    >>> Done.
    BT> Disconnected (gattserverdisconnected)
    Disconnect callback...
    WARNING: [notify_warn] Disconnected
    >>> Disconnected
    stepFlashNordicDFU:  [object Object]
    >>> Initialising...
    connected to gatt server
    found DFU service
    found 2 characteristic(s)
    [success] Updating application: espruino_2v04_mdbt42q_app.bin...
    >>> Updating application: espruino_2v04_mdbt42q_app.bin...
    >>> Updating application: espruino_2v04_mdbt42q_app.bin...
    connected to gatt server
    found DFU service
    found 2 characteristic(s)
    found packet characteristic
    found control characteristic
    enabled control notifications
    transferring init
    crc32 not found, skipping CRC check
    init packet already available, skipping transfer
    transferring firmware
    >>> Uploading...
    crc32 not found, skipping CRC check
    written 4096 bytes
    crc32 not found, skipping CRC check
    written 8192 bytes
    crc32 not found, skipping CRC check
    written 12288 bytes
    crc32 not found, skipping CRC check
    written 16384 bytes
    crc32 not found, skipping CRC check
    written 20480 bytes
    crc32 not found, skipping CRC check
    written 24576 bytes
    crc32 not found, skipping CRC check
    written 28672 bytes
    crc32 not found, skipping CRC check
    written 32768 bytes
    crc32 not found, skipping CRC check
    written 36864 bytes
    crc32 not found, skipping CRC check
    written 40960 bytes
    crc32 not found, skipping CRC check
    written 45056 bytes
    crc32 not found, skipping CRC check
    written 49152 bytes
    crc32 not found, skipping CRC check
    written 53248 bytes
    crc32 not found, skipping CRC check
    written 57344 bytes
    crc32 not found, skipping CRC check
    written 61440 bytes
    crc32 not found, skipping CRC check
    written
    

    Stalls with green progress bar at 20%

    Second attempt

    Device is not able to be paired at this point. It doesn't even appear as recognizable in the 'Add a Device' BT settings section.

    No Compatible devices found

    >>> Downloading binary...
    >>> Done.
    stepFlashNordicDFU:  [object Object]
    >>> Initialising...
    connected to gatt server
    found DFU service
    found 2 characteristic(s)
    [success] Updating application: espruino_2v04_mdbt42q_app.bin...
    >>> Updating application: espruino_2v04_mdbt42q_app.bin...
    >>> Updating application: espruino_2v04_mdbt42q_app.bin...
    connected to gatt server
    found DFU service
    found 2 characteristic(s)
    found packet characteristic
    found control characteristic
    enabled control notifications
    transferring init
    crc32 not found, skipping CRC check
    init packet already available, skipping transfer
    transferring firmware
    >>> Uploading...
    crc32 not found, skipping CRC check
    written 69632 bytes
    crc32 not found, skipping CRC check
    written 73728 bytes
    

    Closed browser and reattempted

    No chrome.serial - Chrome Serial disabled
    No chrome.sockets - Chrome Socket disabled
    serial_audio: Audio Sample rate : 48000
    serial_audio: Audio Serial Baud 9600 Bit time 5
    WebSocket relay support enabled - running in web browser
    WebSocket localhost support (EspruinoHost) enabled - running in web browser
    serial_frame: Running in a frame - enabling frame messaging
    UTF8 Library loaded successfully
    No chrome.fileSystem - Projects disabled
    No chrome.storage API - disabling Offline mode
    Initialising SettingsConsole
    Initialising Utils
    Initialising Config
    Initialising Notifications
    Initialising Status
    Initialising App
    Initialising File
    Initialising Code
    Initialising Serial
      - Initialising Serial Web Audio
      - Initialising Serial Web Bluetooth
      - Initialising Serial Web Serial
      - Initialising Serial Websocket Relay
      - Initialising Serial Websocket to EspruinoHost
      - Initialising Serial window.postMessage
    Initialising SerialWebSocketRelay
    Initialising SerialWebSocketLocal
    Initialising Terminal
    Initialising CodeWriter
    Initialising Modules
    Initialising Env
    Initialising Flasher
    Initialising EditorBlockly
    Initialising EditorJavaScript
    Initialising Send
    Initialising MenuPortSelector
    Initialising MenuSettings
    Initialising MenuFlasher
    Initialising SettingsAbout
    Initialising SettingsFlasher
    Initialising BoardJSON
    Initialising VersionChecker
    Initialising Compiler
    Initialising Assembler
    Initialising GetGitHub
    Initialising Unicode
    Initialising Minify
    Initialising Pretokenise
    Initialising SaveOnSend
    Initialising SetTime
    Initialising Tutorial
    Initialising Webcam
    Initialising FontSize
    Initialising UiMode
    Initialising URLHandler
    Initialising CodeLink
    Initialising Testing
    Initialising Notification_Sound
    Initialising Tern
    Initialising Debugger
    Initialising Tour
    Initialising SettingsProfile
    Initialising HelpLinks
    Initialising Arrows
    Initialising CoreModules
    Loaded code from storage.
    serviceworker> active
    Handling URL "https://www.espruino.com/ide/"
    No navigator.serial - Web Serial not enabled
    ERROR: serial_frame: getPorts timeout, disabling
    ERROR: getURL("/serial/ports") error : Not Found
    /serial/ports doesn't exist - disabling WebSocket support
    Couldn't connect to wss://localhost:31234 - disabling websockets for this session
    >>> Connecting...
    Set Slow Write = true
    BT> ERROR: NotFoundError: User cancelled the requestDevice() chooser.
    ERROR: [notify_error] Connection Failed.
    >>> Connection Failed.
    >>> Connecting...
    Set Slow Write = true
    BT> ERROR: NotFoundError: User cancelled the requestDevice() chooser.
    ERROR: [notify_error] Connection Failed.
    >>> Connection Failed.
    



    Windows10

    Went to provide console output for native WebIDE app, but as device is now not recognized, get the 'No ports found' error when attempting to connect.

    We have chrome.serial - not using 'serialport' module
    Noble: module couldn't be loaded, no node.js Bluetooth Low Energy  Error: No compatible USB Bluetooth 4.0 device found!
    Disable Web Bluetooth as we have Winnus instead
    serial_audio: Audio Sample rate : 48000
    serial_audio: Audio Serial Baud 9600 Bit time 5
    GET chrome.storage.sync = {"AUTO_SAVE_CODE":true,"BAUD_RATE":9600,­"BLOCKLY_EXTENSIONS":"|bluetooth|robot|"­,"BLOCKLY_LANGUAGE":"en","BLOCKLY_TO_JS"­:false,"BOARD_JSON_URL":"http://www.espr­uino.com/json","CODE":"// TestNFCvCard.js\n// Sat 2019.10.26\n\n\n\n// http://forum.espruino.com/conversations/­315526/#comment14959445\n// https://www.espruino.com/NFCTag\n\n\n\nv­ar data = new Uint8Array(16+768);\ndata.set(\"\\x00\\x­00\\xE1\\x10\\x60\\x00\\x03\\x00\\xFE\",­ 0x0A);\n//var tag = require(\"NFCTag\").create(data);\n\n\n/­/Test vCard\nvar tag = require(\"NFCvCard\").create(data);\n\n\­n\n\n\n//[eof]","COMPILATION":true,"COMP­ILATION_URL":"https://www.espruino.com/s­ervice/compiler","DISABLE_CODE_HINTS":fa­lse,"ENABLE_Testing":false,"ENV_ON_CONNE­CT":true,"FONT_SIZE":12,"MINIFICATION_De­adCode":true,"MINIFICATION_LEVEL":"","MI­NIFICATION_Literal":true,"MINIFICATION_M­angle":true,"MINIFICATION_Unreachable":t­rue,"MINIFICATION_Unused":true,"MODULE_A­S_FUNCTION":false,"MODULE_EXTENSIONS":".­min.js|.js","MODULE_MINIFICATION_LEVEL":­"ESPRIMA","MODULE_PROXY_ENABLED":false,"­MODULE_PROXY_PORT":"","MODULE_PROXY_URL"­:"","MODULE_URL":"https://www.espruino.c­om/modules","OFFLINE_DATA":"","OFFLINE_D­ATA_DOWNLOAD":"","OFFLINE_DATA_UPLOAD":"­","OFFLINE_ENABLED":false,"RESET_BEFORE_­SEND":true,"SAVE_ON_SEND":0,"SERIAL_AUDI­O":"0","SERIAL_TCPIP":"","SERIAL_THROTTL­E_SEND":false,"SET_TIME_ON_WRITE":false,­"SHOW_CODE_LINK_ICON":false,"SHOW_WEBCAM­_ICON":0,"STORE_LINE_NUMBERS":true,"Soun­d_Error":"","Sound_Info":"","Sound_Succe­ss":"","Sound_Warning":"","Speak_Error":­false,"Speak_Info":false,"Speak_Success"­:false,"Speak_Warning":false,"UI_MODE":"­Normal","WEBCAM_CONSTRAINTS":0,"projectE­ntry":"DAC3B543885408F1D2551F8C13C954F9:­EspruinoNFC"}
    Initialising SettingsConsole
    Initialising Utils
    Initialising Config
    Initialising Notifications
    Initialising Status
    Initialising App
    Initialising File
    Initialising Code
    Initialising Serial
      - Initialising Serial Chrome Serial
      - Initialising Serial Chrome Socket
      - Initialising Serial Windows Bluetooth LE
      - Initialising Serial Web Audio
      - Initialising Serial Web Bluetooth
    Initialising Terminal
    Initialising CodeWriter
    Initialising Modules
    Initialising Env
    Initialising Flasher
    Initialising EditorBlockly
    Initialising EditorJavaScript
    Initialising Send
    Initialising MenuPortSelector
    Initialising MenuSettings
    Initialising MenuFlasher
    Initialising SettingsAbout
    Initialising SettingsFlasher
    Initialising BoardJSON
    Initialising VersionChecker
    Initialising Compiler
    Initialising Assembler
    Initialising GetGitHub
    Initialising Unicode
    Initialising Minify
    Initialising SaveOnSend
    Initialising SetTime
    Initialising Tutorial
    Initialising Webcam
    Initialising FontSize
    Initialising UiMode
    Initialising URLHandler
    Initialising CodeLink
    Initialising Project
    Initialising Testing
    Initialising Notification_Sound
    Initialising Tern
    Initialising Debugger
    Initialising Tour
    Initialising SettingsProfile
    Initialising HelpLinks
    Initialising Offline
    Loaded code from storage.
    GET chrome.storage.local.OFFLINE_DATA = 0 bytes
    Web Bluetooth available, but Windows Web Bluetooth is broken in <68 - not using it
    



    Tried the five second hard reset, but still not seen

    http://www.espruino.com/MDBT42Q

    Found this for STM32

    https://www.espruino.com/Serial+Bootload­er

    Are there instructions on how to flash NRF52 using the UART?



    EDIT:

    http://www.espruino.com/MDBT42Q#serial-c­onsole


    1 Attachment

    • MDBT42Q20191027UpdateFailedChrome.jpg
  • @Robin, I'm surprised seeing you using Espruion Web IDE for updating MDBT42Q based Espruino! How could I have missed that this is now released / available... Documentation at http://www.espruino.com/Puck.js#firmware­-updates still requires you to use the same process as from the very beginning...

    The only common thing across all boards is the reset: power on with button pressed.

    That it fails is - I assume - that a different boot loader is used than the other Espruino boards (chips) do.

  • Thanks for responsding @allObjects

    'How could I have missed that this is now released / available...'

    Are you being factitious here?

    There is more confusion added as others were trying also, as the firmware is accessible in the download list with the native app. Also confusing is the native app is title Espruino WEB IDE

    Did I misunderstand this comment then? *(posts 7 thru 10)

    ref#9 http://forum.espruino.com/conversations/­338136/#14936620

  • The context makes it clear. Still same process as documented at http://www.espruino.com/Puck.js#firmware­-updates.

    There may be other native apps or chrome things available that do the DFUing - other than the above mentioned links mentions... but for sure not the Espruino Web IDE (for programming).

    That

    the firmware is accessible in the download list

    means only: this are the different builds of the firmware.

    If it talks and walks like a duck...

    That is too fuzzy... like a duck chicks actually are.

    Every A is a B, but not every B is an A. A corollary in Object-Oriented programming when it is about classes and inheritance.

  • 'but for sure not the Espruino Web IDE (for programming)'

    Then the option for performing the install for nRF devices needs to be removed . . . .

    re: 'the firmware is accessible in the download list'
    (as the WebIDE flash option self detects and enables the ability to start the flash process)

    I wont be the only one that falls into this trap!


    Just installed nRF-Connect, we'll try that first. . . .


    1 Attachment

    • MDBT42QFirmwareOption20191027.jpg
  • the install for nRF devices needs to be removed

    Not really...

    As the NOTE 'right there' - * IN BOLD AND ALL CAPS * - says:


    1 Attachment

    • espruinoFlasher.png
  • Ahhh, but I followed the instruction:

    "Normal Firmware Update"
    "Just click the button below and follow the on-screen instructions."


    re: 'Not really...'

    Why provide the trap at all? Any beginner will follow the same instruction for 'Normal' as did I.



    nRF-Connect doesn't recognize the device either.

    So, . . .

    Tried online Web Bluetooth Secure DFU from post #9 from link in post #1 above

    but don't even make it as far (32768 bytes) as @AkosLukacs did (270336) in post #10 same link

    Might be relevant 32768 == 0x8000



    From Chrome console when stalled: DOMException

    found DFU service
    web.html:140 found 2 characteristic(s)
    web.html:140 found packet characteristic
    web.html:140 found control characteristic
    web.html:140 enabled control notifications
    web.html:140 transferring init
    web.html:140 init packet already available, skipping transfer
    web.html:140 transferring firmware
    web.html:140 written 32768 bytes
    web.html:1 Uncaught (in promise) DOMException
    

    1 Attachment

    • DFU32768bytesFail20191027wConsole.jpg
  • Hi Robin,

    as @allObjects say, only „nRF-Connect“ will to the job.

    Used it many times with ios and android phones without any problems.

  • Thanks @MaBe

    Upgraded from v2.4.0 to V3.2.0 using your link. But still doesn't recognize the MDBT42Q. Tried both just powering up, the one second button release and the five second hard reset.

    I suppose a reboot of Windows10 might be the next step. Don't have iOS or a smart phone to try the android version.



    EDIT:
    Just tried on the old laptop with a BLE dongle, that hadn't lost pairing, but get the same stalled progress as in #7 image.

    And, same error 'Windows Web Bluetooth is broken in <68' when using the native WebIDE to just connect:

    Loaded code from storage.
    GET chrome.storage.local.OFFLINE_DATA = 0 bytes
    Web Bluetooth available, but Windows Web Bluetooth is broken in <68 - not using it
    >>> Connecting...
    Set Slow Write = true
    ERROR: Unable to open device (connectionInfo=undefined)
    ERROR: [notify_error] Connection Failed.
    >>> Connection Failed.
    

    1 Attachment

    • nRFConnectNoDevices20191027.jpg
  • The following was attempted using a TTL converter with Tx->Rx and Rx->Tx per:

    http://www.espruino.com/MDBT42Q#serial-c­onsole

    and connect using a Com port rather than Bluetooth.

    Used the old standby laptop with the BLE dongle with pairing still in tact.



    Tried the web launch from page link from:

    http://www.espruino.com/Download#puckjs

    http://www.espruino.com/webide

    Initialising Tour
    Initialising SettingsProfile
    Initialising HelpLinks
    Initialising Offline
    Initialising CoreModules
    No code in storage.
    GET chrome.storage.local.OFFLINE_DATA = 0 bytes
    Handling URL "http://www.espruino.com/webide"
    >>> Connecting...
    Set Slow Write = true
    Unable to open device (connectionInfo=undefined)
    ERROR: Unable to open device (connectionInfo=undefined)
    ERROR: [notify_error] Connection Failed.
    >>> Connection Failed.
    

    Back to the native WebIDE app using the TTL converter and Com port

    Initialising Tour
    Initialising SettingsProfile
    Initialising HelpLinks
    Initialising Offline
    Loaded code from storage.
    GET chrome.storage.local.OFFLINE_DATA = 0 bytes
    Web Bluetooth available, but Windows Web Bluetooth is broken in <68 - not using it
    >>> Connecting...
    Set Slow Write = true
    Unable to open device (connectionInfo=undefined)
    ERROR: Unable to open device (connectionInfo=undefined)
    ERROR: [notify_error] Connection Failed.
    >>> Connection Failed.
    



    So it appears the inability to complete the flash process (using DFU) prevents the existing corrupted (previous) flashed version from being accessible. Again tried a hard reset also. Device still unusable.

  • What you may have ended up by using STM / Espruino boot loader based firmware updater on the nrf5x / Raytec based boot loader device is a bricked BLE connectivity.

    Btw, for the com port connection to work correctly as by Espruino doc, you still need to have a working Espruino REPL on your device... And even if it (would still) work/s, you still cannot update Espruino BLE Espruino device via Espruino IDE...

    To get your device back in working BLE boot loader mode / sw update OTA, you may need to walk the path of Recover from a bricked nrf52 device . Check these links as a 'boot strap links' to all the details you need to consider:

    Take also a look at http://www.espruino.com/datasheets/nRF52­832_PS_v1.0.pdf - p. 70+. 16 Debug and trace / 16.2 16.2 CTRL-AP - Control Access Port

  • This was all explained in this thread which you were involved in, but I'll point it all out here to be totally clear:

    • It seems Web Bluetooth updates don't work for Windows, either via the browser or Native IDE - I believe they did at some point in the past, but not now.
    • Web Bluetooth updates do work on Linux, Mac, Android and Chromebook
    • Pairing in Windows has no effect. The bootloader's BLE name is 'DfuTarg' so you won't expect to see it in the normal IDE's connection options.
    • Yes, the option should be disabled in Windows - however none of the instructions for firmware updates instruct you to use the Web IDE. Everything is open source so you are willing to contribute a change for this if it bothers you. edit: I have now disabled Web Bluetooth updates for windows
    • The bootloader is fine, your board is not bricked. You just need to re-flash the firmware successfully.
    • There is no UART bootloader. You have to update via Bluetooth LE
    • By far the easiest option is to follow the instructions on http://www.espruino.com/Puck.js#firmware­-updates with an Android or iOS phone or tablet

    I understand that you don't have a smartphone. Do you have a tablet? Do you know anyone with a smartphone that you can borrow?

    I'm pretty sure this has come up previously and you did manage to update firmware on Puck or a Pixl. What did you do then?

  • @Gordon, does Web Bluetooth work running in a Linux - such as Ubuntu - as guest in virtual box vm on a windows host, such as @Robin may have?

    If so, this is really an easy setup... and the few megs/gigs such an environment requires are usually (still) available. Setting up c:/ root as shared folder gives access to all files to from within Ubuntu. Virtual box and Ubuntu are free and easy to use.

  • does Web Bluetooth work running in a Linux - such as Ubuntu - as guest in virtual box vm

    Oof. Maybe, but I wouldn't hold out high hopes. If you're going to do that I'd either:

    • Use a Raspberry Pi
    • Install Ubuntu on a USB stick (super easy), reboot into it, and use Chromium/Chrome web browser on there to do the update

    Or in the UK you can buy Android mobile phones good enough for flashing brand new for around £30, so I doubt they'd be more than $40 in the US - even less if you go second hand.

  • Mon 2019.10.28

    Thank you all for the responses.

    Will respond to individual questions later this week. Will consider options and work on over next weekend. . . .

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

Unable to flash MDBT42Q with either Native WebIDE or Chrome - board now locked and unusable

Posted by Avatar for Robin @Robin

Actions