====== 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 [[https://github.com/meshtastic/firmware/tree/master/variants/xiao_ble|Meshtastic XIAO BLE variant]]. Here's what I had to do. ===== Prepare Debian Environment ===== - Install [[https://www.microsoft.com/store/productId/9MSVKQC78PK6|Debian from the Microsoft Store]] - Open and set up user - sudo apt-get install git python3-venv - 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 ===== - git clone https://github.com/meshtastic/firmware.git meshtastic-firmware && cd meshtastic-firmware - Optional: check out a tagged release\\ git checkout tags/v2.3.8.d490a33 - ./variants/xiao_ble/xiao_ble.sh ===== Build the Firmware ===== - pio run -e xiao_ble - ./bin/uf2conv.py .pio/build/xiao_ble/firmware.hex -c -o firmware.uf2 -f 0xADA52840 - cp firmware.uf2 /mnt/c/Users/YOUR_WINDOWS_USERNAME/Desktop/ ===== Upload the Firmware ===== - 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 - Copy firmware.uf2 from your desktop to the USB drive