tinygo-org / tinygo

Go compiler for small places. Microcontrollers, WebAssembly (WASM/WASI), and command-line tools. Based on LLVM.
https://tinygo.org
Other
14.73k stars 859 forks source link

Support UF2 drives with space in their name on Linux #4232

Closed mateusznowakdev closed 1 month ago

mateusznowakdev commented 2 months ago

I've updated the factory bootloader on one of my Seeed Studio XIAOs to the latest version provided by Adafruit. Their bootloader uses different name for UF2 device, "Seeed XIAO", instead of "Arduino".

Unfortunately, after the update tinygo flash was no longer able to detect the device, even if the board configuration was correct. It looks like the entry in /proc/mounts file uses \040 instead of a `, and thefindFATMounts` function can't handle such a case:

/dev/sda /media/matt/Seeed\040XIAO vfat ...... 0 0
error: failed to flash /tmp/tinygo2815790133/main.uf2: unable to locate any volume: [Arduino,Seeed XIAO]

This PR fixes the issue on Linux. I've tested it on my PC (Debian 12) against dev branch, with both original bootloader and the updated one.

sago35 commented 2 months ago

Could you please provide the bootloader you've tried? update) Have you used the following Bootloader?

https://github.com/adafruit/uf2-samdx1/releases/tag/v3.16.0

mateusznowakdev commented 2 months ago

I've tried both 3.16 (the version you've linked), and the 3.14 (https://github.com/adafruit/uf2-samdx1/releases/tag/v3.14.0). Both versions use "Seeed XIAO" as the device name.