From 4a5bc67299074d29de489e85aab3ff64f3c36d05 Mon Sep 17 00:00:00 2001 From: Matthew Kennedy Date: Tue, 13 Feb 2024 17:31:43 -0800 Subject: [PATCH] improve developer guide a little --- firmware/DEVELOPER.md | 60 +++++++++++++++++++++++++++++ firmware/readme.md | 40 ------------------- firmware/setup_linux_environment.sh | 13 +++++-- 3 files changed, 69 insertions(+), 44 deletions(-) create mode 100644 firmware/DEVELOPER.md delete mode 100644 firmware/readme.md diff --git a/firmware/DEVELOPER.md b/firmware/DEVELOPER.md new file mode 100644 index 0000000000..9844ce8bd4 --- /dev/null +++ b/firmware/DEVELOPER.md @@ -0,0 +1,60 @@ +See also [../unit_tests](../unit_tests) + +This directory contains the source code for the RusEFI firmware. + +The ideal is that typical end users should be able to use pre-built +firmware. They should not need to modify or even rebuild from the +source code for basic use, but building from the source code provides +the opportunity for optimization, supporting unexpected engine +configurations, and specialized enhancements. + + +TL;DR + +``make PROJECT_BOARD=microrusefi PROJECT_CPU=ARCH_STM32F4`` + +# Environment + +Building from source code requires this firmware, and a platform that +supports 'make' based builds. The correct compiler is now included for +both 64-bit Linux (Intel/AMD) and macOS (64-bit Intel and ARM) platforms. + +Linux and MacOS systems should have the software development tools, +primarily 'make', pre-installed or readily installed. MS-Windows +requires selecting and installing a Unix-compatible system environment. + +## Setup Instructions + +## Editor/IDE + +The supported IDE is [Visual Studio Code](https://code.visualstudio.com/). +Others will work, but if you need help from the maintainers, you might not +get much if you're using something else. + +### Linux + +1. Make sure you have the latest version of git installed: `sudo apt install git` +1. Clone the repo. `git clone https://github.com//fome-fw.git` +1. Install additional dependencies: `cd fome-fw/firmware && ./setup_linux_environment.sh` +1. Open vscode: `code fome-fw/` + +### macOS + +macOS setup is largely the same as Linux, except the setup script will not work. +On recent versions of macOS, simply attempting to run `make` from the terminal +will prompt installation of Xcode command line developer tools, which is the only +prerequisite. Then, do steps 2 and 4 from the Linux setup instructions above. + +### Windows + +While technically possible to build on Windows, the preferred method is to first install +the [Windows Subsystem for Linux (WSL)](), then follow the [instructions for Linux](#linux) +above. + +## Note + +Note that the developers are volunteers, with varied motivations. +These motivations often include using leading-edge language and build +system concepts, requiring recent versions of tools. Should you +encounter build problems, review the latest version of this document. +If you're still having trouble, reach out on Discord in the #firmware channel. diff --git a/firmware/readme.md b/firmware/readme.md deleted file mode 100644 index 36b4cd1d22..0000000000 --- a/firmware/readme.md +++ /dev/null @@ -1,40 +0,0 @@ - -[Doxygen](https://rusefi.com/docs/html/) - -[Q&A on source code](https://rusefi.com/forum/viewtopic.php?f=5&t=10) - -See also [../unit_tests](../unit_tests) - -This directory contains the source code for the RusEFI firmware. - -The ideal is that typical end users should be able to use pre-built -firmware. They should not need to modify or even rebuild from the -source code for basic use, but building from the source code provides -the opportunity for optimization, supporting unexpected engine -configurations, and specialized enhancements. - - -TL;DR - -``make PROJECT_BOARD=microrusefi PROJECT_CPU=ARCH_STM32F4`` - -# Environment - -Rebuilding from source code requires this firmware, a modern C/C++ -compiler for embedded ARM systems, and a platform that supports 'make' -based builds. - -See setup_linux_environment.sh - -While many compilers have the potential to work, we suggest using the -official ARM version of GCC available at launchpad.net. - -Linux and MacOS systems should have the software development tools, -primarily 'make', pre-installed or readily installed. MS-Windows -requires selecting and installing a Unix-compatible system environment. - -Note that the developers are volunteers, with varied motivations. -These motivations often include using leading-edge language and build -system concepts, requiring recent versions of tools. Should you -encounter build problems, review the latest version of this document. - diff --git a/firmware/setup_linux_environment.sh b/firmware/setup_linux_environment.sh index 060dbaded1..56801401eb 100755 --- a/firmware/setup_linux_environment.sh +++ b/firmware/setup_linux_environment.sh @@ -1,11 +1,16 @@ #!/usr/bin/env bash # -# it's totally possible to develop on Windows. Also WSL is amazing! -# TL,DR: use gcc 9.3 +# This script configures your Linux machine (probably just Debian/Ubuntu-based machine, really) +# for FOME firmware development and compilation. # -# by the way to uninstall package with old compiler version you might use -# sudo apt remove binutils-arm-none-eabi gcc-arm-none-eabi libnewlib-arm-none-eabi +# This script will also work on a Windows Subsystem for Linux installation on top of a Windows PC. +# +# Purposes for dependencies: +# - `gcc`, `gdb`, `gcc-multilib`, `g++-multilib`: Native compilers for your PC, used for unit tests and simulator. +# - `make`: GNU Make, build tool that orchestrates the correct build steps. +# - `openjdk-8-jdk-headless`: Java compiler for FOME console and code generation tools. +# - `mtools`, `zip`, `xxd`: Used to generate the on-ECU filesystem that stores the matching ini file. # # This script will download and install all dependencies require to develop rusEFI on Linux.