iTranslated by AI
Developed a Tool to Help TinyGo Identify FAT Volumes on macOS Sequoia
Introduction
When using TinyGo on macOS Sequoia (15.0+), you may encounter an issue where tinygo flash reports that it "cannot find the board's FAT volume."
I previously wrote an article summarizing the cause of this issue:
To help address this problem, I have created a small CLI tool called tinygo-flash-helper.
Why this issue occurs (Changes in Sequoia)
In macOS Sequoia, the handling of /Volumes and the output specifications of diskutil have changed, causing TinyGo's findFATMounts to stop functioning correctly.
The main causes are as follows:
- The number of symbolic links in
/Volumeshas increased, causingdiskutil infoto fail. - The key names in
diskutilhave changed (e.g., "File System Personality" → "Type (Bundle)"). - FAT might be reported as "MSDOS" instead of "FAT".
As a result, mounting for RP2040 and SAMD-based UF2 boards becomes invisible to tinygo flash.
What tinygo-flash-helper does
This tool does not modify TinyGo itself; instead, it provides "assistance to run the current version of TinyGo on Sequoia."
Specifically, it provides the following functions:
1. Listing FAT volumes
tinygo-flash-helper list
Internally, it performs the following:
- Excludes symbolic links using
Lstat. - Determines the FS type by checking multiple
diskutilkeys (FAT / MSDOS). - Lists all discoverable volume names.
This is also useful for confirming if the board is recognized as "NO NAME" instead of "RPI-RP2".
2. Adding volume names to TinyGo target JSON
If the volume name of an RP2040-based board appears as "NO NAME" on Sequoia, TinyGo may fail to recognize it.
You can correct the target file with the following command:
tinygo-flash-helper add-volume -volume "NO NAME"
tinygo-flash-helper add-volume -target xiao-rp2040 -volume “NO NAME”
This makes it easier for tinygo flash to work on Sequoia.
(It adds "volumes": ["RPI-RP2", "NO NAME"] to the TinyGo target JSON.)
Installation
go install github.com/senoue/tinygo-flash-helper@latest
Alternatively, clone and build:
git clone https://github.com/senoue/tinygo-flash-helper.git
cd tinygo-flash-helper
go build
Supported Environments
- macOS Sonoma / Sequoia
- TinyGo 0.39.0+
- Go 1.23+
- FAT/UF2 based boards (RP2040, SAMD21/51, nRF52, etc.)
The beauty of being able to create such tools easily with Go
While tinygo-flash-helper is a very small CLI, Go allows you to easily implement:
- File attribute checks (
os.Lstat) - External command execution (
exec.Command) - JSON read/write
- Cross-platform builds
all using only the standard library. The fact that you can quickly build "tools that immediately assist with field issues" is a great point. Creating your own improvement tools for the TinyGo ecosystem is one of the joys of using Go.
Conclusion
Although tinygo-flash-helper is strictly a "helper tool for using TinyGo on Sequoia," I hope it proves useful to those struggling with issues related to FAT volumes.
PRs and improvement suggestions are welcome!
Discussion