From 2d26465db9dd60d51e7810cce8b4c360ab33ecde Mon Sep 17 00:00:00 2001 From: Yuri D'Elia Date: Sun, 18 Dec 2022 15:09:39 +0100 Subject: [PATCH 01/10] README: Document the new build system --- README.md | 305 ++++++++++++++++++------------------------------------ 1 file changed, 103 insertions(+), 202 deletions(-) diff --git a/README.md b/README.md index f12f0d210..4d5914aef 100644 --- a/README.md +++ b/README.md @@ -6,219 +6,120 @@ The latest official builds can be downloaded from [Prusa Drivers](https://www.pr The firmware for the Original Prusa i3 printers is proudly based on [Marlin 1.0.x](https://github.com/MarlinFirmware/Marlin/) by Scott Lahteine (@thinkyhead) et al. and is distributed under the terms of the [GNU GPL 3 license](LICENSE). - -# Table of contents - - - * [Linux build](#linux) - * Windows build - * [Using Arduino](#using-arduino) - * [Using Linux subsystem](#using-linux-subsystem-under-windows-10-64-bit) - * [Using Git-bash](#using-git-bash-under-windows-10-64-bit) - * [Automated tests](#3-automated-tests) - * [Documentation](#4-documentation) - * [FAQ](#5-faq) - +This repository contains _development material only!_ # Build ## Linux +There are two ways to build Prusa-Firmware on Linux: using [CMake](#cmake) (recommended for developers) or with [PF-build](#pf-build) which is more user-friendly for casual users. -1. Clone this repository and checkout the correct branch for your desired release version. +### CMake +#### Quick-start +The workflow should be pretty straightforward for anyone with development experience. After installing git and a recent version of python 3 all you have to do is: -1. Set your printer model. - - For MK3 --> skip to step 3. - - If you have a different printer model, follow step [2.b](#2b) from Windows build -1. Install GNU AWK `sudo apt-get install gawk` -If you use mawk instead of gawk you get strange errors when multi language support is generated like: -`awk: line 2: function strtonum never defined -sed: couldn't write 4 items to stdout: Broken pipe -./lang-build.sh: 121: ./lang-build.sh: arithmetic expression: expecting EOF: "0x"awk: line 2: function strtonum never defined -sed: couldn't write 4 items to stdout: Broken pipe -tr: write error: Broken pipe -./lang-build.sh: 121: ./lang-build.sh: arithmetic expression: expecting EOF: "0x"awk: line 2: function strtonum never defined -sed: couldn't write 4 items to stdout: Broken pipe -tr: write error: Broken pipe -tr: write error -cut: write error: Broken pipeNG! - some texts not found in lang_en.txt! updating binary: - primary language ids...awk: line 2: function strtonum never defined -sed: couldn't flush stdout: Broken pipe` - -1. Run `./build.sh` - - Output hex file is at `"PrusaFirmware/lang/firmware.hex"` . In the same folder you can hex files for other languages as well. + # clone the repository + git clone https://github.com/prusa3d/Prusa-Firmware + cd Prusa-Firmware -1. Connect your printer and flash with PrusaSlicer ( Configuration --> Flash printer firmware ) or Slic3r PE. - - If you wish to flash from Arduino, follow step [2.c](#2c) from Windows build first. + # automatically setup dependencies + ./utils/bootstrap.py + + # configure and build + mkdir build + cd build + cmake .. -G Ninja -DCMAKE_TOOLCHAIN_FILE=../cmake/AvrGcc.cmake + ninja -_Notes:_ +#### Detailed CMake guide +Building with cmake requires: + +- cmake >= 3.22.5 +- ninja >= 1.10.2 (optional, but recommended) + +Python >= 3.6 is also required with the following modules: + +- pyelftools (package `python3-pyelftools`) +- polib (package `python3-polib`) +- regex (package `python3-regex`) + +Additionally `gettext` is required for translators. + +Assuming a recent Debian/Ubuntu distribution, install the dependencies globally with: + + sudo apt-get install cmake ninja python3-pyelftools python3-polib python3-regex gettext + +Prusa-Firmware depends on a pinned version of `avr-gcc` and the external `prusa3dboards` package. These can be setup using `./utils/bootstrap.py`: + + # automatically setup dependencies + ./utils/bootstrap.py + +which will download and unpack them inside the `.dependencies` directory. `./utils/bootstrap.py` will also install `cmake`, `ninja` and the required python packages if missing, although installing those through is system's package manager is usually preferred. + +You can then proceed by creating a build directory, configure for AVR and build: + + # configure + mkdir build + cd build + cmake .. -G Ninja -DCMAKE_TOOLCHAIN_FILE=../cmake/AvrGcc.cmake + + # build + ninja + +By default all variants are built. There are several ways to restrict the build for development. During configuration you can set: + +- `cmake -DFW_VARIANTS=variant`: comma-separated list of variants to build. This is the file name as present in `Firmware/variants` without the final `.h`. +- `cmake -DMAIN_LANGUAGES=languages`: comma-separated list of ISO language codes to include as main translations. +- `cmake -DCOMMUNITY_LANGUAGES=languages`: comma-separated list of ISO language codes to include as community translations. + +When building the following targets are available: + +- `ninja ALL_MULTILANG`: build all multi-language targets (default) +- `ninja ALL_ENGLISH`: build all single-language targets +- `ninja VARIANT_EN-only`: build the single-language version of `VARIANT` +- `ninja VARIANT_Multilang`: build the multi-language version of `VARIANT` +- `ninja check_lang`: build and check all language translations +- `ninja check_lang_ISO`: build and check all variants with language `ISO` +- `ninja check_lang_VARIANT`: build and check all languages for `VARIANT` +- `ninja check_lang_VARIANT_ISO`: build and check language `ISO` for `VARIANT` + + +#### Automated tests +Automated tests are built with cmake by configuring for the current host: + + # clone the repository + git clone https://github.com/prusa3d/Prusa-Firmware + cd Prusa-Firmware + + # automatically setup dependencies + ./utils/bootstrap.py + + # configure and build + mkdir build + cd build + cmake .. -G Ninja + ninja + + # run the tests + ctest + + +### PF-build +PF-build is recommended for users without development experience. Download or clone the repository, +then run PF-build and simply follow the instructions: + + cd Prusa-Firmware + ./PF-build.sh + +PF-build currently assumes a Debian/Ubuntu (or derivative) distribution. -The script downloads Arduino with our modifications and Rambo board support installed, unpacks it into folder `PF-build-env-\` on the same level, as your Prusa-Firmware folder is located, builds firmware for MK3 using that Arduino in Prusa-Firmware-build folder on the same level as Prusa-Firmware, runs secondary language support scripts. Firmware with secondary language support is generated in lang subfolder. Use firmware.hex for MK3 variant. Use `firmware_\.hex` for other printers. Don't forget to follow step [2.b](#2b) first for non-MK3 printers. ## Windows -### Using Arduino -_Note: Multi language build is not supported._ +### VSCode +TODO -#### 1. Development environment preparation +### Arduino (Legacy) +TODO -**a.** Install `"Arduino Software IDE"` from the official website `https://www.arduino.cc -> Software->Downloads` - - _It is recommended to use version `"1.8.5"`, as it is used on our build server to produce official builds._ - -**b.** Setup Arduino to use Prusa Rambo board definition - -* Open Arduino and navigate to File -> Preferences -> Settings -* To the text field `"Additional Boards Manager URLSs"` add `https://raw.githubusercontent.com/prusa3d/Arduino_Boards/master/IDE_Board_Manager/package_prusa3d_index.json` -* Open Board manager (`Tools->Board->Board manager`), and install `Prusa Research AVR Boards by Prusa Research` - -**c.** Modify compiler flags in `platform.txt` file - -* The platform.txt file can be found in Arduino installation directory, or after Arduino has been updated at: `"C:\Users\(user)\AppData\Local\Arduino15\packages\arduino\hardware\avr\(version)"` If you can locate the file in both places, file from user profile is probably used. - -* Add `"-Wl,-u,vfprintf -lprintf_flt -lm"` to `"compiler.c.elf.flags="` before existing flag "-Wl,--gc-sections" - - For example: `"compiler.c.elf.flags=-w -Os -Wl,-u,vfprintf -lprintf_flt -lm -Wl,--gc-sections"` - -_Notes:_ - - -_In the case of persistent compilation problems, check the version of the currently used C/C++ compiler (GCC) - should be at leas `4.8.1`; -If you are not sure where the file is placed (depends on how `"Arduino Software IDE"` was installed), you can use the search feature within the file system_ - -_Name collision for `"LiquidCrystal"` library known from previous versions is now obsolete (so there is no need to delete or rename original file/-s)_ - -#### 2. Source code compilation - -**a.** Clone this repository`https://github.com/prusa3d/Prusa-Firmware/` to your local drive. - -**b.** In the subdirectory `"Firmware/variants/"` select the configuration file (`.h`) corresponding to your printer model, make copy named `"Configuration_prusa.h"` (or make simple renaming) and copy it into `"Firmware/"` directory. - -**c.** In file `"Firmware/config.h"` set LANG_MODE to 0. - -**d.** Run `"Arduino IDE"`; select the file `"Firmware.ino"` from the subdirectory `"Firmware/"` at the location, where you placed the source code `File->Open` Make the desired code customizations; **all changes are on your own risk!** - -**e.** Select the target board `"Tools->Board->PrusaResearch Einsy RAMBo"` - -**f.** Run the compilation `Sketch->Verify/Compile` - -**g.** Upload the result code into the connected printer `Sketch->Upload` - -* or you can also save the output code to the file (in so called `HEX`-format) `"Firmware.ino.rambo.hex"`: `Sketch->ExportCompiledBinary` and then upload it to the printer using the program `"FirmwareUpdater"` -_note: this file is created in the directory `"Firmware/"`_ - -### Using Linux subsystem under Windows 10 64-bit -_notes: Script and instructions contributed by 3d-gussner. Use at your own risk. Script downloads Arduino executables outside of Prusa control. Report problems [there.](https://github.com/3d-gussner/Prusa-Firmware/issues) Multi language build is supported._ -- follow the Microsoft guide https://docs.microsoft.com/en-us/windows/wsl/install-win10 - You can also use the 'prepare_winbuild.ps1' powershell script with Administrator rights -- Tested versions are at this moment - - Ubuntu and Debian, other may different - - After the installation and reboot please open your Ubuntu bash and do following steps - - run command `sudo apt-get update` - - run command `sudo apt-get upgrade` - - to install zip run `sudo apt-get install zip` - - to install dos2unix run `sudo apt-get install dos2unix` - - run `dos2unix PF-build.sh` to convert the windows line endings to unix line endings - - add a few lines at the top of `~/.bashrc` by running `sudo nano ~/.bashrc` - - export OS="Linux" - export JAVA_TOOL_OPTIONS="-Djava.net.preferIPv4Stack=true" - export GPG_TTY=$(tty) - - use `CRTL-X` to close nano and confirm to write the new entries - - restart Ubuntu/Debian bash - - Now your Ubuntu/Debian subsystem is ready to use the automatic `PF-build.sh` script and compile your firmware correctly - -#### Some Tips for Ubuntu and Debian -- Linux is case sensitive so please don't forget to use capital letters where needed, like changing to a directory -- To change the path to your Prusa-Firmware location you downloaded and unzipped - - Example: You files are under `C:\Users\\Downloads\Prusa-Firmware-MK3` - - use under Ubuntu the following command `cd /mnt/c/Users//Downloads/Prusa-Firmware-MK3` - to change to the right folder -- Unix and Windows have different line endings (LF vs CRLF), use dos2unix to convert - - This should fix the `"$'\r': command not found"` error - - to install run `apt-get install dos2unix` -- If your Windows isn't in English the Paths may look different - Example in other languages - - English `/mnt/c/Users//Downloads/Prusa-Firmware-MK3` will be on a German Windows`/mnt/c/Anwender//Downloads/Prusa-Firmware-MK3` -#### Compile Prusa-firmware with Ubuntu/Debian Linux subsystem installed -- open Ubuntu bash shell -- change to your source code folder (case sensitive) -- run `./PF-build.sh` -- follow the instructions - -### Using Git-bash under Windows 10 64-bit -_notes: Script and instructions contributed by 3d-gussner. Use at your own risk. Script downloads Arduino executables outside of Prusa control. Report problems [there.](https://github.com/3d-gussner/Prusa-Firmware/issues) Multi language build is supported._ -- Download and install the 64bit Git version https://git-scm.com/download/win -- Also follow these instructions https://gist.github.com/evanwill/0207876c3243bbb6863e65ec5dc3f058 -- Download and install 7z-zip from its official website https://www.7-zip.org/ - By default, it is installed under the directory /c/Program\ Files/7-Zip in Windows 10 -- Run `Git-Bash` under Administrator privilege -- navigate to the directory /c/Program\ Files/Git/mingw64/bin -- run `ln -s /c/Program\ Files/7-Zip/7z.exe zip.exe` -- If your Windows isn't in English the Paths may look different - Example in other languages - - English `/mnt/c/Users//Downloads/Prusa-Firmware-MK3` will be on a German Windows`/mnt/c/Anwender//Downloads/Prusa-Firmware-MK3` - - English `ln -s /c/Program\ Files/7-Zip/7z.exe zip.exe` will be on a Spanish Windows `ln -s /c/Archivos\ de\ programa/7-Zip/7z.exe zip.exe` -#### Compile Prusa-firmware with Git-bash installed -- open Git-bash -- change to your source code folder -- run `bash PF-build.sh` -- follow the instructions - - -# 3. Automated tests -## Prerequisites -* c++11 compiler e.g. g++ 6.3.1 -* cmake -* build system - ninja or gnu make - -## Building -Create a folder where you want to build tests. - -Example: - -`cd ..` - -`mkdir Prusa-Firmware-test` - -Generate build scripts in target folder. - -Example: - -`cd Prusa-Firmware-test` - -`cmake -G "Eclipse CDT4 - Ninja" ../Prusa-Firmware` - -or for DEBUG build: - -`cmake -G "Eclipse CDT4 - Ninja" -DCMAKE_BUILD_TYPE=Debug ../Prusa-Firmware` - -Build it. - -Example: - -`ninja` - -## Running -`./tests` - -# 4. Documentation -run [doxygen](http://www.doxygen.nl/) in Firmware folder -or visit https://prusa3d.github.io/Prusa-Firmware-Doc for doxygen generated output - -# 5. FAQ -Q:I built firmware using Arduino and I see "?" instead of numbers in printer user interface. - -A:Step 1.c was omitted or you updated Arduino and now platform.txt located somewhere in your user profile is used. - -Q:I built firmware using Arduino and my printer now speaks "Klingon" (nonsense characters and symbols are displayed @^#$&*°;~ÿ) - -A:Step 2.c was omitted. - -Q:What environment does Prusa use to build its official firmware releases? - -A:Our production builds are 99.9% equivalent to https://github.com/prusa3d/Prusa-Firmware#linux this is also easiest way to build as only one step is needed - run a single script, which downloads patched Arduino from GitHub, builds using it, then extracts translated strings and creates language variants (for MK2x) or language hex file for external SPI flash (MK3x). But you need Linux or Linux in a virtual machine. This is also what happens when you open a pull request to our repository - all variants are built by Travis http://travis-ci.org/ (to check for compilation errors). You can see, what is happening in .travis.yml. It would be also possible to get hex built by Travis, only the deploy step is missing in .travis.yml. You can find inspiration on how to deploy hex in Travis and how to setup Travis in https://github.com/prusa3d/MM-control-01/ repository. The final hex is located in ./lang/firmware.hex - community reproduced this for Windows in https://github.com/prusa3d/Prusa-Firmware#using-linux-subsystem-under-windows-10-64-bit or https://github.com/prusa3d/Prusa-Firmware#using-git-bash-under-windows-10-64-bit . - -Q:Why are build instructions for Arduino a mess? - -Y:We are too lazy to ship a proper board definition for Arduino. We plan to switch to CMake + ninja to be inherently multiplatform, easily integrate build tools, suport more IDEs, get 10 times shorter build times and be able to update compiler whenever we want. +### PF-build with WSL +TODO From 1fd41293eee05c61da1c0d9d359e78c34113b252 Mon Sep 17 00:00:00 2001 From: Yuri D'Elia Date: Sun, 18 Dec 2022 15:37:24 +0100 Subject: [PATCH 02/10] README: Typo --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 4d5914aef..0dbbfc800 100644 --- a/README.md +++ b/README.md @@ -54,7 +54,7 @@ Prusa-Firmware depends on a pinned version of `avr-gcc` and the external `prusa3 # automatically setup dependencies ./utils/bootstrap.py -which will download and unpack them inside the `.dependencies` directory. `./utils/bootstrap.py` will also install `cmake`, `ninja` and the required python packages if missing, although installing those through is system's package manager is usually preferred. +which will download and unpack them inside the `.dependencies` directory. `./utils/bootstrap.py` will also install `cmake`, `ninja` and the required python packages if missing, although installing those through the system's package manager is usually preferred. You can then proceed by creating a build directory, configure for AVR and build: From ccd20e79addd8580c08052110832a4af14ce5d5f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gu=C3=B0ni=20M=C3=A1r=20Gilbert?= Date: Sun, 18 Dec 2022 15:46:07 +0000 Subject: [PATCH 03/10] Initial commit for Windows VScode --- README.md | 31 +++++++++++++++++++++++++++++-- 1 file changed, 29 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 0dbbfc800..082bf7882 100644 --- a/README.md +++ b/README.md @@ -115,8 +115,35 @@ PF-build currently assumes a Debian/Ubuntu (or derivative) distribution. ## Windows -### VSCode -TODO +### Visual Studio Code (VSCode) +#### Prerequisites + +* [Visual Studio Code](https://code.visualstudio.com/) +* [CMake Tools plugin](https://marketplace.visualstudio.com/items?itemName=ms-vscode.cmake-tools) +* [Python](https://www.python.org/) +* [Git Bash](https://git-scm.com/downloads) + +#### First time setup + +Start by cloning the Prusa-Firmware repository + + git clone https://github.com/prusa3d/Prusa-Firmware + +Open the `Prusa-Firmware` folder in VScode. + +Open a new terminal in VScode (Terminal→New Terminal) and run + + python .\utils\bootstrap.py + +This will download all dependencies required to build the firmware. You should see a `.dependencies` folder in the Prusa-Firmware folder. + +Reload VScode so the CMake plugin can pick up the project's CMake kit correctly. + +### Building + +To start building a firmware, click the CMake Tools plugin icon on the far left side. You will get a very large list of targets to build. Find the firmware you'd like to build (like `MK3S-EINSy10a_EN-only`)and select the small icon which shows "Build" when hovered over. + +The built .hex file can then be found in folder `Prusa-Firmware/build` ### Arduino (Legacy) TODO From edb3d2d98b8d7098bef9a5b81c7334fbf87598ac Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gu=C3=B0ni=20M=C3=A1r=20Gilbert?= Date: Sun, 18 Dec 2022 16:05:11 +0000 Subject: [PATCH 04/10] Add a bit more info about selecting a kit --- README.md | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 082bf7882..51c45855a 100644 --- a/README.md +++ b/README.md @@ -137,9 +137,14 @@ Open a new terminal in VScode (Terminal→New Terminal) and run This will download all dependencies required to build the firmware. You should see a `.dependencies` folder in the Prusa-Firmware folder. -Reload VScode so the CMake plugin can pick up the project's CMake kit correctly. +Reload VScode. If all works correctly you should see the VScode automatically configuring the CMake project for you. If this doesn't happen you likely need to set the CMake kit; This can be done in two ways: -### Building +1. Type `Ctrl+Shift+P` and search for `CMake: Select a Kit`. Select `avr-gcc`. If none appear, Scan for kits first. +2. If 1) does not work for some reason, as a last resort you can edit the CMake Tools settings. Search for "Additional Kits" and add `.vscode/cmake-kits.json` to the list. + +After updating the kit, you may need to reload VScode. + +#### Building To start building a firmware, click the CMake Tools plugin icon on the far left side. You will get a very large list of targets to build. Find the firmware you'd like to build (like `MK3S-EINSy10a_EN-only`)and select the small icon which shows "Build" when hovered over. From 192a8c83c7617c81644e4c3a48489779a05af4f0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gu=C3=B0ni=20M=C3=A1r=20Gilbert?= Date: Sun, 18 Dec 2022 16:14:39 +0000 Subject: [PATCH 05/10] Remove Arduino IDE and PF-builds for WSL --- README.md | 6 ------ 1 file changed, 6 deletions(-) diff --git a/README.md b/README.md index 51c45855a..e4cb35861 100644 --- a/README.md +++ b/README.md @@ -149,9 +149,3 @@ After updating the kit, you may need to reload VScode. To start building a firmware, click the CMake Tools plugin icon on the far left side. You will get a very large list of targets to build. Find the firmware you'd like to build (like `MK3S-EINSy10a_EN-only`)and select the small icon which shows "Build" when hovered over. The built .hex file can then be found in folder `Prusa-Firmware/build` - -### Arduino (Legacy) -TODO - -### PF-build with WSL -TODO From 764544b6dd478f8df3270cecc04274d882cccc3d Mon Sep 17 00:00:00 2001 From: Yuri D'Elia Date: Sun, 18 Dec 2022 17:44:35 +0100 Subject: [PATCH 06/10] Add some initial disclaimer when using Arduino --- README.md | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/README.md b/README.md index e4cb35861..5f9479ee1 100644 --- a/README.md +++ b/README.md @@ -149,3 +149,18 @@ After updating the kit, you may need to reload VScode. To start building a firmware, click the CMake Tools plugin icon on the far left side. You will get a very large list of targets to build. Find the firmware you'd like to build (like `MK3S-EINSy10a_EN-only`)and select the small icon which shows "Build" when hovered over. The built .hex file can then be found in folder `Prusa-Firmware/build` + + +## Arduino IDE (deprecated) + +Using Arduino IDE is still possible, but _no longer supported_. Prusa-Firmware requires a complex multi-step build process that cannot be done automatically with just the IDE. For a long time we provided instructions to use Arduino in combination with shell scripts, however starting with 3.13 the build system has been completely switched to `cmake`. + +Building with Arduino IDE results in a *limited* firmware: + +- Arduino IDE can only build a single, english-only variant at a time that you manually have to select +- The build will not be reproducible (meaning you will likely get a different binary every time you build the same sources) +- You need to download, patch and select the correct board definitions by hand + +For these reasons, you should think twice before reporting issues for a firmware built with Arduino. If you find a bug in the firmware, building and testing using CMake should be your first thought. Issues regarding Arduino builds are answered by the community and are not officially supported. + +TODO From a455ea6c8ac9e9dcf3b1b07cda90d349defd0b4f Mon Sep 17 00:00:00 2001 From: Yuri D'Elia Date: Sun, 18 Dec 2022 18:19:41 +0100 Subject: [PATCH 07/10] Add back the old Arduino instructions --- README.md | 31 ++++++++++++++++++++++++++++++- 1 file changed, 30 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 5f9479ee1..ade8a1e32 100644 --- a/README.md +++ b/README.md @@ -163,4 +163,33 @@ Building with Arduino IDE results in a *limited* firmware: For these reasons, you should think twice before reporting issues for a firmware built with Arduino. If you find a bug in the firmware, building and testing using CMake should be your first thought. Issues regarding Arduino builds are answered by the community and are not officially supported. -TODO + +### Environment preparation + +Install "Arduino Software IDE" from the official website https://www.arduino.cc -> Software -> Downloads. Version 1.8.19 or higher is required. + +Setup Arduino to install and use the Prusa board definitions: + +- Open Arduino and navigate to File -> Preferences -> Settings +- To the text field "Additional Boards Manager URLs" add `https://raw.githubusercontent.com/prusa3d/Arduino_Boards/master/IDE_Board_Manager/package_prusa3d_index.json` +- Open Board manager (Tools -> Board -> Board manager) +- Install "Prusa Research AVR Boards by Prusa Research" + + +### Source code preparation + +Clone or download this repository to your local drive. + +In the subdirectory `Firmware/variants/` select the configuration file (.h) corresponding to your printer model and manually copy it to `Firmware/Configuration_prusa.h` + +Run "Arduino IDE", then + +- Open the file `Firmware/Firmware.ino` +- Select the target board with Tools -> Board -> "PrusaResearch Einsy RAMBo" +- Open `Firmware/config.h` and change LANG_MODE to 0. + + +### Compilation and upload + +- Run the compilation Sketch -> Verify/Compile +- Upload the result code into the connected printer Sketch -> Upload From d12dfed096243285f1dc49ce2821114654196dd6 Mon Sep 17 00:00:00 2001 From: Yuri D'Elia Date: Sun, 18 Dec 2022 18:40:17 +0100 Subject: [PATCH 08/10] README: Drop outdated README_cz for now --- README_cz.md | 56 ---------------------------------------------------- 1 file changed, 56 deletions(-) delete mode 100644 README_cz.md diff --git a/README_cz.md b/README_cz.md deleted file mode 100644 index 282babdcf..000000000 --- a/README_cz.md +++ /dev/null @@ -1,56 +0,0 @@ -# 1. Příprava vývojového prostředí - - 1. nainstalujte vývojové prostředí `"Arduino Software IDE"` pro operační prostředí, které jste zvyklí používat -`https://www.arduino.cc -> Software->Downloads` -doporučujeme použít starší verzi `"1.6.9"`, kterou používáme na našem build serveru pro překlad oficiálních buildů -_pozn.: v případě přetrvávajících potíží s překladem zkontrolujte verzi aktuálně použitého překladače jazyka C/C++ (GCC) - měla by být `4.8.1`; verzi ověříte zadáním příkazu -`avr-gcc --version` -pokud si nejste jisti umístěním souboru (závisí na způsobu, jakým bylo `"Arduino Software IDE"` nainstalováno), použijte funkci vyhledání v rámci systému souborů_ -_pozn.: konflikt názvů knihoven / modulů `"LiquidCrystal"` známý v předchozích verzích již není aktuální (původní knihovnu tudíž není nutné mazat ani přejmenovat)_ - - 2. do nabídky podporovaných cílových desek Arduino přidejte desku (`UltiMachine`) `RAMBo` -`File->Preferences->Settings` -do pole `"Additional Boards Manager URLs"` -vložte adresu / text -`"https://raw.githubusercontent.com/ultimachine/ArduinoAddons/master/package_ultimachine_index.json"` -ev. je možno 'ručně upravit' položku -`"boardsmanager.additional.urls=....."` -v souboru `"preferences.txt"` (parametr umožňuje zápis seznamu adres oddělených čárkami) -_pozn.: konkrétní umístění tohoto souboru na Vašem disku lze zjistit následujícím způsobem: -`File->Preferences->Settings` (`"More preferences can be edited in file ..."`)_ -následně proveďte -`Tools->Board->BoardsManager` -ze zobrazeného seznamu vyberte položku `"RAMBo"` (pravděpodobně bude označena jako `"RepRap Arduino-compatible Mother Board (RAMBo) by UltiMachine"` -_pozn.: tuto položku zvolte pro všechny varianty desek použitých v tiskárnách `'Prusa i3 MKx'`, tzn. pro `RAMBo-mini x.y` i `EINSy x.y`_ -'kliknutím' na položku se zobrazí tlačítko pro instalaci; ve výběrovém seznamu zvolte verzi `"1.0.1"` (poslední známá verze k datu vydání tohoto dokumentu) -_(po provedení instalace je položka označena poznámkou `"INSTALLED"` a lze ji následně použít při výběru cílové desky)_ - - 3. modify platform.txt to enable float printf support: -add "-Wl,-u,vfprintf -lprintf_flt -lm" to "compiler.c.elf.flags=" before existing flag "-Wl,--gc-sections" -example: -`"compiler.c.elf.flags=-w -Os -Wl,-u,vfprintf -lprintf_flt -lm -Wl,--gc-sections"` - -# 2. Překlad zdrojoveho kódu - -do zvoleného adresáře umístěte zdrojové kódy odpovídající modelu Vaší tiskárny získané z repozitáře -`https://github.com/prusa3d/Prusa-Firmware/` -v podadresáři `"Firmware/variants/"` vyberte konfigurační soubor (`.h`) odpovídající modelu Vaší tiskárny, vytvořte kopii s názvem `"Configuration_prusa.h"` (popř. proveďte prosté přejmenování) a překopírujte do adresáře `"Firmware/"` - -spusťte vývojové prostředí `"Arduino IDE"`; v adresáři, kam jste umístili zdrojové kódy, vyberte z podadresáře `"Firmware/"` soubor `"Firmware.ino"` -`File->Open` -proveďte požadované úpravy kódu; **veškeré změny ovšem provádíte na svou vlastní odpovědnost!** - -jako cílovou desku pro překlad vyberte `"RAMBo"` -`Tools->Board->RAMBo` -_pozn.: nelze použít žádnou z variant `"Arduino Mega …"`, přestože se jedná o shodný MCU_ - -spusťte překlad -`Sketch->Verify/Compile` - -výsledný kód nahrajte do připojené tiskárny -`Sketch->Upload` - -přeložený kód můžete také nechat uložit do souboru (v tzv. `HEX`-formátu) `"Firmware.ino.rambo.hex"`: -`Sketch->ExportCompiledBinary` -a do tiskárny ho následně nahrát pomocí programu `"FirmwareUpdater"` -_pozn.: soubor je vytvořen v adresáři `"Firmware/"`_ From 4ff9324377b8aa7b4b81cf6a330c52c64c49ad70 Mon Sep 17 00:00:00 2001 From: Yuri D'Elia Date: Thu, 29 Dec 2022 12:55:57 +0100 Subject: [PATCH 09/10] README: Update target names --- README.md | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index ade8a1e32..409257ac5 100644 --- a/README.md +++ b/README.md @@ -76,8 +76,9 @@ When building the following targets are available: - `ninja ALL_MULTILANG`: build all multi-language targets (default) - `ninja ALL_ENGLISH`: build all single-language targets -- `ninja VARIANT_EN-only`: build the single-language version of `VARIANT` -- `ninja VARIANT_Multilang`: build the multi-language version of `VARIANT` +- `ninja ALL_FIRMWARE`: build all single and multi-language targets +- `ninja VARIANT_ENGLISH`: build the single-language version of `VARIANT` +- `ninja VARIANT_MULTILANG`: build the multi-language version of `VARIANT` - `ninja check_lang`: build and check all language translations - `ninja check_lang_ISO`: build and check all variants with language `ISO` - `ninja check_lang_VARIANT`: build and check all languages for `VARIANT` @@ -146,7 +147,7 @@ After updating the kit, you may need to reload VScode. #### Building -To start building a firmware, click the CMake Tools plugin icon on the far left side. You will get a very large list of targets to build. Find the firmware you'd like to build (like `MK3S-EINSy10a_EN-only`)and select the small icon which shows "Build" when hovered over. +To start building a firmware, click the CMake Tools plugin icon on the far left side. You will get a very large list of targets to build. Find the firmware you'd like to build (like `MK3S-EINSy10a_ENGLISH`)and select the small icon which shows "Build" when hovered over. The built .hex file can then be found in folder `Prusa-Firmware/build` From 4258ecef36f1b32012663b0b8728573876e5d0f1 Mon Sep 17 00:00:00 2001 From: Yuri D'Elia Date: Thu, 29 Dec 2022 12:56:16 +0100 Subject: [PATCH 10/10] README: Fix formatting --- README.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 409257ac5..95c14da86 100644 --- a/README.md +++ b/README.md @@ -147,7 +147,7 @@ After updating the kit, you may need to reload VScode. #### Building -To start building a firmware, click the CMake Tools plugin icon on the far left side. You will get a very large list of targets to build. Find the firmware you'd like to build (like `MK3S-EINSy10a_ENGLISH`)and select the small icon which shows "Build" when hovered over. +To start building a firmware, click the CMake Tools plugin icon on the far left side. You will get a very large list of targets to build. Find the firmware you'd like to build (like `MK3S-EINSy10a_ENGLISH`) and select the small icon which shows "Build" when hovered over. The built .hex file can then be found in folder `Prusa-Firmware/build` @@ -187,10 +187,10 @@ Run "Arduino IDE", then - Open the file `Firmware/Firmware.ino` - Select the target board with Tools -> Board -> "PrusaResearch Einsy RAMBo" -- Open `Firmware/config.h` and change LANG_MODE to 0. +- Open `Firmware/config.h` and change `LANG_MODE` to 0. ### Compilation and upload -- Run the compilation Sketch -> Verify/Compile -- Upload the result code into the connected printer Sketch -> Upload +- Run the compilation: Sketch -> Verify/Compile +- Upload the result code into the connected printer: Sketch -> Upload