How to build the rusEFI firmware from the source files¶
First of all, maybe do not compile locally¶
As of 2024 we are pretty addicted to GitHub Actions. Just fork repo, enable GitHub actions and push, GH will leave you all the binaries already compiled in the actions artifacts.
Step-by-step guide to creating the build environment in windows 10+ using Windows Shell for Linux¶
The best way to build the rusEFI firmware is using a set of tools that run best under linux,
-
Install WSL Run the following in an elevated powershell
shell Enable-WindowsOptionalFeature -Online -FeatureName Microsoft-Windows-Subsystem-Linux -
Download linux
Download the appx for linux 2004 from here: WSL Install Manual
Or type the following into powershell:shell cd ubuntu/ Invoke-WebRequest -Uri <https://aka.ms/wsl-ubuntu-2004> -OutFile Ubuntu.appx -UseBasicParsing
This command will download the file to the currently active directory.
-
install linux
shell PS C:\Windows\system32> cd c:/Ubuntu PS C:\Ubuntu> Add-AppxPackage Ubuntu_2004.2020.424.0_x64.appx
Open start menu and launch linux
Wait for it to complete install and ask for username and password
-
check WSL default install In powershell type:
shell wslconfig /l
Make sure the ubuntu 2004 is marked as default.
-
get git
shell sudo apt-get install git -
clone git
shell git clone <https://github.com/YOUR-REPOSITORY/rusefi.git> -
Run setup script
shell cd /home/owner/rusefi/firmware sh setup_linux_environment.sh -
install VScode in windows
Download and install as normal, is should detect WSL and ask to install the extension for it, do this and close VScode -
Install VScode in linux
shell cd /home/owner/rusefi code . -
Hit ctrl-b and run "build unit tests" Allow to run and complete, it may exit with "multiple targets" error, if so just run it a second time.
-
exit both VScode and ubunu
Click the x in VScode and type exit in ubuntu -
reboot ubuntu from the start menu and run make
shell cd /home/owner/rusefi/firmware make -j$(nproc)This should build the firmware for the F407 Discovery board
-
If successful then reopen VScode in ubuntu
shell cd /home/owner/rusefi code . -
Run the built tool for the specific board in VScode
Ctrl-Shift-B and select the chosen board, this should build the firmware. -
Note submodules are their own thing - the main repo just contains a pointer to where the submodule should be checked out
-
Zach method:
install wsl (already have ubuntu 20.04 on wsl2)
shell
sudo apt update
sudo apt install openjdk-8-jre-headless -y
curl -O <https://armkeil.blob.core.windows.net/developer/Files/downloads/gnu-rm/9-2020q2/gcc-arm-none-eabi-9-2020-q2-update-x86_64-linux.tar.bz2>
tar -xf gcc-arm-none-eabi-9-2020-q2-update-x86_64-linux.tar.bz2
Without WSL¶
A less fancy toolchain without WSL works as well. There is a forum thread on building the firmware, but be aware that it contains some out-of-date information.