update docs surrounding compilation (#504)

This commit is contained in:
David Holdeman 2024-03-08 18:07:20 -06:00 committed by GitHub
parent a7d9b2278c
commit e8645f1928
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 87 additions and 62 deletions

View File

@ -44,20 +44,24 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
bundle-name:
- brainboard
- brainboard-debug
meta-info:
- meta-info-brainboard.env
- meta-info-brainboard-debug.env
steps:
call-workflow-passing-data:
uses: rusefi/rusefi/.github/workflows/custom-board-build.yaml@master
secrets: inherit
permissions:
contents: write
with:
bundle-name: ${{matrix.bundle-name}}
- uses: ./ext/rusefi/.github/workflows/custom-board-build
with:
meta-info: ${{matrix.meta-info}}
MY_REPO_PAT: ${{secrets.MY_REPO_PAT}}
RUSEFI_ONLINE_FTP_USER: ${{secrets.RUSEFI_ONLINE_FTP_USER}}
RUSEFI_ONLINE_FTP_PASS: ${{secrets.RUSEFI_ONLINE_FTP_PASS}}
RUSEFI_FTP_SERVER: ${{secrets.RUSEFI_FTP_SERVER}}
RUSEFI_SSH_SERVER: ${{secrets.RUSEFI_SSH_SERVER}}
RUSEFI_SSH_USER: ${{secrets.RUSEFI_SSH_USER}}
RUSEFI_SSH_PASS: ${{secrets.RUSEFI_SSH_PASS}}
ADDITIONAL_ENV: ${{secrets.ADDITIONAL_ENV}}
```
If you want to have several different boards in the same repo, you should put them in different sub-directories, then pass a `board-dir` to the workflow.
If you want to have several different boards in the same repo, you should put them in different sub-directories, so they can have their own board.mk, board_configuration.cpp, and prepend.txt.
There is also a `rusefi-dir` option you can use if you want to put your rusefi submodule somewhere other than `ext/rusefi`.
There is also a `rusefi-dir` option you can use if you want to put your rusefi submodule somewhere other than `ext/rusefi`. You will also need to change the path in the `uses:` field.

View File

@ -6,29 +6,45 @@ Download the latest ARM GCC from ARM itself: [ARM GCC toolchain](https://develop
These can be extracted under your home directory; just add the `bin` directory to your path.
TODO: You probably need to install additional packages but I don't remember what they are.
There is also a script that you can run to install the above and also other prerequisites for Ubuntu or Debian:
```shell
./setup_linux_environment.sh
```
Then to compile the firmware,
```shell
cd firmware
make PROJECT_BOARD=nucleo_h743 PROJECT_CPU=ARCH_STM32H7 -j4
./firmware/bin/compile.sh
```
Edit according to your environment.
It will give you a list of boards to choose from.
You can also pass it the path to a meta-info file to build for that board instead of being prompted:
```shell
./firmware/bin/compile.sh config/boards/microrusefi/meta-info-mre_f4.env
```
You can also pass it `-b` as the first parameter to build bundle .zip files.
```shell
./firmware/bin/compile.sh -b config/boards/microrusefi/meta-info-mre_f4.env
```
The .zip bundles will be located at ./artifacts.
To compile the simulator,
```shell
cd simulator
./compile.sh
make -j$(nproc)
```
To compile the unit tests,
```shell
cd unit_tests
make -j4
make -j$(nproc)
```
## Working with STM32 Dev/Nucleo boards

View File

@ -1,34 +1,34 @@
# How to build the rusEFI firmware from the source files
## The following process is a step-by-step guide to creating the build environment in windows 10+ using Windows Shell for Linux
## 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,
1. Install WSL
Run the following in an elevated powershell
```shell
Enable-WindowsOptionalFeature -Online -FeatureName Microsoft-Windows-Subsystem-Linux
```
```shell
Enable-WindowsOptionalFeature -Online -FeatureName Microsoft-Windows-Subsystem-Linux
```
2. Download linux
Download the appx for linux 2004 from here:
[WSL Install Manual](https://docs.microsoft.com/en-us/windows/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
```
```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.
3. install linux
```shell
PS C:\Windows\system32> cd c:/Ubuntu
PS C:\Ubuntu> Add-AppxPackage Ubuntu_2004.2020.424.0_x64.appx
```
```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
@ -36,40 +36,40 @@ The best way to build the rusEFI firmware is using a set of tools that run best
4. check WSL default install
In powershell type:
```shell
wslconfig /l
```
```shell
wslconfig /l
```
Make sure the ubuntu 2004 is marked as default.
5. get git
```shell
sudo apt-get install git
```
```shell
sudo apt-get install git
```
6. clone git
```shell
git clone <https://github.com/YOUR-REPOSITORY/rusefi.git>
```
```shell
git clone <https://github.com/YOUR-REPOSITORY/rusefi.git>
```
7. Run setup script
```shell
cd /home/owner/rusefi/firmware
sh setup_linux_environment.sh
```
```shell
cd /home/owner/rusefi/firmware
sh setup_linux_environment.sh
```
8. 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
9. Install VScode in linux
```shell
cd /home/owner/rusefi
code .
```
```shell
cd /home/owner/rusefi
code .
```
10. 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.
@ -79,19 +79,19 @@ The best way to build the rusEFI firmware is using a set of tools that run best
12. reboot ubuntu from the start menu and run make
```shell
cd /home/owner/rusefi/firmware
make
```
```shell
cd /home/owner/rusefi/firmware
make -j$(nproc)
```
This should build the firmware
This should build the firmware for the F407 Discovery board
13. If successful then reopen VScode in ubuntu
```shell
cd /home/owner/rusefi
code .
```
```shell
cd /home/owner/rusefi
code .
```
14. Run the built tool for the specific board in VScode
Ctrl-Shift-B and select the chosen board, this should build the firmware.
@ -103,12 +103,17 @@ The best way to build the rusEFI firmware is using a set of tools that run best
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
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
Less fancy toolchain without WSL works as well <https://rusefi.com/forum/viewtopic.php?f=5&t=9>
A less fancy toolchain without WSL works as well.
There is [a forum thread](https://rusefi.com/forum/viewtopic.php?f=5&t=9) on building the firmware, but be aware that it contains some out-of-date information.
## Linux
See [Developing on Linux](Developing-On-Linux)

View File

@ -93,7 +93,7 @@ rusEFI has a virtual option. This runs same code with same RTOS in Windows, Linu
### Compile firmware
You can compile the firmware, making changes and submitting bug fixes. See [HOWTO Contribute to Firmware](HOWTO-contribute-to-firmware)
You can compile the firmware, making changes and submitting bug fixes. See [HOW TO Build Firmware From Source](HOW-TO-Build-Firmware-From-Source)
### Experiment with java based dev console, TunerStudio, etc