micro:bit firmware install problem on Linux

Issue #265 resolved
Francisco Pedro created an issue

I just got to know MicroBlocks and I have to congratulate you for this fantastic app. I’m a school teacher and thinking to use your app in our activities. Usually I use linux (debian 11) and I’ve got everything working with esp32 and microbit. Only with the microbit I had some problems connecting to the board in desktop app - microbit never showed up on the firmware option.

Using browser app I could find microbit board but was not able to update the firmware - never show the option to save to microbit. Eventually I returned to desktop app and “miraculously” the board updated immediately but still not showing in the option to update firmware.

Comments (8)

  1. John Maloney repo owner

    Hi, Francisco.

    I'm glad you like MicroBlocks. :-)

    The desktop app and web app work slightly differently when it comes to firmware installs.

    The desktop app looks at the file system (not possible from the web app for security reasons) and only offers the "micro:bit" option if it sees a USB drive named MICROBIT. The fix is to plug in the micro:bit before attempting to install firmware on it and wait until the drive has mounted.

    You should be able to install firmware on the micro:bit from the web app as well. Again, the micro:bit must be plugged in. After selecting update firmware on board and selecting "micro:bit" from the menu, the browser will open a file save dialog. You need to select the micro:bit USB drive (MICROBIT) as the destination for the firmware file.

    Alternatively, you might select some other folder on your computer as the destination. MicroBlocks will save a file named firmware.hex. You can then copy that file onto the MICROBIT USB drive. That option can be useful if you need to update the MicroBlocks firmware on all the micro:bits for your classroom.

    Let me know if you continue to have problems.

  2. Francisco Pedro reporter

    Hello John

    Thirst of all thank you for your detailed answer.

    This is a minor problem for me since we use esp32. Nevertheless when starting google-chrome from terminal, when I try to save the update of the firmware to the board (microbit) save-file dialog doesn’t show up and in the terminal I get the following - ERROR:select_file_dialog_linux_portal.cc(716)] Portal returned error: org.freedesktop.portal.Error.InvalidArgument: invalid filter: name is empty.

    In the desktop app I can not find a way that the board shows up in the “select board type”. But as I said it works anyway.

    I will try Monday on another computer to find out if it is a problem related with my machine or OS configuration.

  3. John Maloney repo owner

    Thanks for reporting these additional details. Very helpful.

    It sounds as though there may be two separate problems that only occur when running on Linux -- and perhaps even specific to Debian. (I test MicroBlocks with Ubuntu.)

    I'll see if I can reproduce and fix these problems. Meanwhile, a workaround is to download the micro:bit hex file from:

    https://microblocks.fun/downloads/pilot/vm/vm_microbit-universal.hex (latest pilot version)

    or

    https://microblocks.fun/downloads/latest/vm/vm_microbit-universal.hex (stable release)

    and copy that file to the MICROBIT drive. The universal file works with either micro:bit v1 or v2.

    Does the MICROBIT drive mount when you plug in a MICROBIT? Is it writable? If not, that would be a Debian issue that probably has a simple solution.

  4. John Maloney repo owner

    I've found a problem testing micro:bit firmware install from Chrome Ubuntu 18:04, and it may be related.

    There are two symptoms. First, when the download dialog appears it does not have the file extension .hex as it does when saving from Chrome on Mac OS and, I think, on Windows. If you proceed, the save operation appears to never finish but the micro:bit starts showing a sad face with the 504 error code (which means that the firmware install failed). If you add the .hex extension it appears to succeed but a few seconds later the sad face error appears.

    I am pretty sure this is a Linux Chrome bug since the process works on other platforms.

    The workaround is to save the firmware file to a folder on your drive. Make sure it has the extension.hex. Then drag and drop that file onto the MICROBIT drive.

    I don't have a Debian installation to test against so let me know if this work-around works for you you.

  5. John Maloney repo owner

    This appears to be a problem with the hex file installation process on some versions of Linux; see https://support.microbit.org/support/tickets/53784. If so, we'll have to wait for micro:bit to fix the problem.

    Unfortunately, manually dropping the .hex file onto the MICROBIT drive may also fail. If that happens, you could use a non-Linux computer (Mac, Windows, Chromebook) to install the MicroBlocks firmware. Once the firmware is installed, the board can be used with the problematic Linux computer.

  6. Log in to comment