Table of Contents

Building Meshtastic Firmware on Windows Subsystem for Linux (WSL)

I needed to build Meshtastic firmware on WSL in order to produce binary UF2 firmware for the Meshtastic XIAO BLE variant.

Here's what I had to do.

Prepare Debian Environment

  1. Open and set up user
  2. sudo apt-get install git python3-venv
  3. curl -fsSL -o get-platformio.py https://raw.githubusercontent.com/platformio/platformio-core-installer/master/get-platformio.py 
    python3 get-platformio.py

Prepare Meshtastic Firmware Build Environment

  1. git clone https://github.com/meshtastic/firmware.git meshtastic-firmware && cd meshtastic-firmware
  2. Optional: check out a tagged release
    git checkout tags/v2.3.8.d490a33
  3. git submodule init
  4. git submodule update

Build the Firmware

  1. pio run -e xiao_ble
  2. cp firmware.uf2 /mnt/c/Users/YOUR_WINDOWS_USERNAME/Desktop/

Upload the Firmware

  1. Connect the XIAO BLE to the computer USB and double tap the reset button, the red LED will breathe and a USB drive “XIAO-BOOT” will be mounted
  2. Copy firmware.uf2 from your desktop to the USB drive