Building firmware 1.4.0+ from source
-
This tutorial explains the setup required to build the firmware from the GitHub source repository https://github.com/sg-wireless/sg-sdk
In this tutorial, I am using Windows 11 with Ubuntu 24.04 installed via WSL (Windows Subsystem for Linux). You can also use Ubuntu 24.04 or MacOS directly.
Step1: Install necessary packages via apt
sudo apt-get install git wget flex bison gperf python3 python3-pip python3-setuptools cmake ninja-build ccache libffi-dev libssl-dev dfu-util libusb-1.0-0 python3-venv python3-toml python3-serialStep2: Clone the SG Wireless Open Source SDK
git clone https://github.com/sg-wireless/sg-sdk.gitNote: If you previously cloned the repository, you can just fetch the latest version. When updating from 1.3.0 to 1.4.0+, it is recommended to deinit and re-init the submodules:
git remote update git submodule deinit --all -f git pullStep3: Build the firmware
cd sg-sdk && ./fw_builder.sh --board SGW3501-F1-StarterKit buildNote: You can copy/rename the defaults.sdk.example to file defaults.sdk to define build defaults such as board type and port.
Step4: Flashing the firmware
If you are using Ubuntu Linux natively on your PC, you can simply connect the Starter Kit and run:
./fw_builder.sh --board SGW3501-F1-StarterKit flash --port /dev/ttyUSB0Note: You can copy/rename the defaults.sdk.example to file defaults.sdk to define build defaults such as board type and port.
If you are using WSL, I suggest installing wsl-usb-gui or wsl-usb-manager

Select the entry with “Silicon Labs CP210x USB to UART Bridge (COMx)” that corresponds to the board you want to flash. In the screenshot above, I have two Starter Kits connected to my PC.
Once the device is attached to the WSL subsystem, you can flash it with the same command as above:
./fw_builder.sh --board SGW3501-F1-StarterKit flash --port /dev/ttyUSB0Note: On older versions of Ubuntu (ex: 22.04), the version of cmake installed with apt is too old. You can install a newer version by running:
sudo apt-get install python3-pip && pip3 install -U cmakePlease make sure you add the PATH where cmake is installed:
export PATH=~/.local/bin:$PATHPlease let me know if you experience any issues with building the firmware.