-
Notifications
You must be signed in to change notification settings - Fork 535
Building RepRapFirmware
Important!
RepRapFirmware is built from several Github projects. You need to use compatible branches of these projects. Since RepRapFirmware v3.1.0, stable releases are tagged in github.
To build RepRapFirmware v3.1.1, use the following tags:
project | tag | notes |
---|---|---|
RepRapFirmware | 3.1.1 | |
CANlib | 3.1.0 | only needed for Duet 3 |
CoreNG | 3.1.0 | |
FreeRTOS | 3.1.0 | |
RRFLibraries | 3.1.0 | |
DuetWiFiSocketServer | master | this project must be present but you don't need to build it |
Note: CoreNG, FreeRTOS, RRFLibraries do not have v3.1.1 tags because the 3.1.0 tagged releases are the base for v3.1.1 (no changes in the dependencies, only in RepRapFirmware)
To build RepRapFirmware 3.2 from the latest development sources, use the following branches:
project | branch | notes |
---|---|---|
RepRapFirmware | v3.02-dev | |
CANlib | master | only needed for Duet 3 |
CoreNG | dev | not needed for Duet 3 Mini5+ |
CoreN2G | master | only needed for Duet 3 Mini5+ |
FreeRTOS | dev | |
RRFLibraries | dev | |
DuetWiFiSocketServer | dev | this project must be present but you don't need to build it |
To build RepRapFirmware 3.3 from the latest development sources, use the following branches:
project | branch | notes |
---|---|---|
RepRapFirmware | 3.3-dev | |
CANlib | 3.3-dev | only needed for Duet 3 |
CoreN2G | 3.3-dev | |
FreeRTOS | 3.3-dev | |
RRFLibraries | 3.3-dev | |
DuetWiFiSocketServer | dev | this project must be present but you don't need to build it |
To build RepRapFirmware 3.4.x from the latest development sources, use the following branches:
project | branch | notes |
---|---|---|
RepRapFirmware | 3.4-dev | |
CANlib | 3.4-dev | this is needed for Duet 2 as well as Duet 3 |
CoreN2G | 3.4-dev | |
FreeRTOS | 3.4-dev | |
RRFLibraries | 3.4-dev | |
DuetWiFiSocketServer | dev | this project must be present but you don't need to build it |
To build RepRapFirmware 3.5.3 from the latest development sources, use the following branches:
project | branch | notes |
---|---|---|
RepRapFirmware | 3.5-dev | |
CANlib | 3.5-dev | this is needed for Duet 2 as well as Duet 3 |
CoreN2G | 3.5-dev | |
FreeRTOS | 3.5-dev | |
RRFLibraries | 3.5-dev | |
DuetWiFiSocketServer | dev | this project must be present but you don't need to build it |
WiFiSocketServerRTOS | main | this project must be present but you don't need to build it |
** Note, only one of the last two projects listed above is actually needed in your workspace. From 2024-04-23 the second one is needed; prior to that the first one is needed. **
To build RepRapFirmware 3.6.x from the latest development sources, use the following branches:
project | branch | notes |
---|---|---|
RepRapFirmware | 3.6-dev | |
CANlib | 3.6-dev | this is needed for Duet 2 as well as Duet 3 |
CoreN2G | 3.6-dev | |
FreeRTOS | 3.5-dev | |
RRFLibraries | 3.5-dev | |
WiFiSocketServerRTOS | main | this project must be present but you don't need to build it |
LibTinyUSB | master | needed for Duet 3 Mini, 6HX and 6XD build configurations only |
Building RepRapFirmware lately requires a tool called CrcAppender
to be in
the user's PATH
as it will be called at the end of the compilating process. It
can be found as Golang source code in Tools/CrcAppender
together with
pre-compiled binaries for Windows, Linux and MacOS x86-64. For versions older than v3.6, this tool requires the .NET 6 runtime to be installed on your PC.
- Download and install the appropriate version of the gcc arm-none-eabi cross-compiler as follows:
- To build firmware version 3.6.x use version 13.2 Rel 1 from https://developer.arm.com/downloads/-/arm-gnu-toolchain-downloads
- To build firmware version 3.5.x use version 12.2 from https://developer.arm.com/downloads/-/arm-gnu-toolchain-downloads
- To build firmware version 3.4.x use version 10.3-2021.10 from https://developer.arm.com/open-source/gnu-toolchain/gnu-rm/downloads
- To build firmware version 3.3 use version 2020-q4-major from https://developer.arm.com/open-source/gnu-toolchain/gnu-rm/downloads
- To build firmware version 3.2 use version 2020-q2-update
- To build firmware version 2.03beta3 use version 2018-q4-major
- To build firmware version 2.01beta2 use version 2018-q2-update
- To build firmware version 1.20alpha3 use version 2017-q2-update
- To build firmware version 1.20alpha2 and earlier use version arm-none-eabi-4.8.3-2014q1
Using a more recent version of gcc than the ones listed may work in some cases.
-
Download and install Eclipse IDE for C/C++ Developers. It's usually OK to use the latest available stable release.
-
Download and install MSYS2. This provides versions of make.exe, rm.exe and other tools without the 8192-character command line limitation of some other versions.
-
Modify your PATH environment variable to include the
usr/bin
folder of the MSYS2 installation (e.g. C:\msys64\usr\bin), and to include the path to crc32appender.exe (see earlier note).
4a. From a command line run this command to install the make utility: pacman -S make
-
Open a command prompt and run
where rm
andwhere make
to make sure that rm and make will be fetched from that folder. -
In Eclipse create new workspace
C:/Eclipse/Firmware
. Then exit Eclipse. -
Download this github project as a zip file and unzip it into
C:/Eclipse/Firmware
. Then rename folderReprapFirmware-dev
in that folder toRepRapFirmware
. Alternately, change into the directoryC:/Eclipse/Firmware
in a Terminal and rungit clone https://github.com/Duet3D/ReprapFirmware.git -branch dev
-
Repeat the previous step for all the other github projects needed as listed in the tables above.
-
The build depends on the Eclipse workspace variable ArmGccPath being set to the directory where your arm-none-eabi-g++ compiler resides. For example
C:\Program Files (x86)\GNU Tools ARM Embedded\7 2018-q2-update\bin
on Windows (see step #1 for which compiler to use). To set it, go to Windows -> Preferences -> C/C++ -> Build -> Build Variables and click "Add..." -
The build dependencies are already set up in the project files, so the following is for information only. The build dependencies are:
- Duet 3 Mini builds depend on: CoreN2G, FreeRTOS, CANlib and RRFLibraries. They also require DuetWifiSocketServer as outlined above.
- Duet 3 MB6HC builds have the same dependencies as for Duet 3 Mini.
- Duet 2 builds have the same dependencies as Duet 3 Mini, except that older versions do not need CANlib and (depending on version) may need CoreNG instead of CoreN2G.
- Duet Maestro builds have the same dependencies as Duet 3 Mini but do not need DuetWiFiSocketServer. Older versions do not need CANlib and (depending on version) may need CoreNG instead of CoreN2G.
- Duet085 builds (also running on Duet06) depend on CoreNG and RRFLibraries. Note: Duet085 does not run RepRapFirmware 2 or later, the last official build is v1.26.
-
The required build configurations are already set up in the project file so the following is for information only. The build configurations used by each target are:
Board Project Build Configuation Duet3 Mini (Wifi and Ethernet) CoreN2G SAME5X_RTOS FreeRTOS SAME51 RRFLibraries SAME51_RTOS RepRapFirmware Duet_5LC or Duet3Mini5plus Duet3 CANlib SAME70_RTOS CoreNG or CoreN2G SAME70 or SAME70_CAN_SDHC_USB_RTOS FreeRTOS SAME70 RRFLibraries SAME70_RTOS RepRapFirmware Duet3_V06 or Duet3 Duet2 (DuetWifi and Duet Ethernet) CoreNG or CoreN2G SAM4E8E or SAM4E_SDHC_USB_RTOS FreeRTOS SAM4E RRFLibraries SAM4E_RTOS RepRapFirmware Duet2_RTOS (or just Duet2 in version 3.2 and later) Duet Maestro CoreNG or CoreN2G SAM4S or SAM4S_SDHC_USB_RTOS FreeRTOS SAM4S RRFLibraries SAM4S_RTOS RepRapFirmware DuetMaestro Duet085 (Duet0.85 and Duet0.6) Note: Needs v1.20 tags CoreNG SAM3X8E RRFLibraries SAM3X RepRapFirmware Duet085 -
When you build RepRapFirmware, Eclipse will build the other projects that it depends on automatically; so the following is for information only. If you build manually then the only constraint is that you build all the other projects (except DuetWiFiSocketServer, which you do not need to build) before you build RepRapFirmware.
- Using Homebrew makes it very easy to install new software on macOS.
- Install Homebrew: see https://brew.sh/ for instructions
- Download and install the gcc-arm-embedded: brew install --cask gcc-arm-embedded
- Download and install Eclipse for C++: brew install --cask eclipse-cpp
- Git clone the required repositories. For example:
- git clone https://github.com/Duet3D/RepRapFirmware.git --branch 3.5-dev
- git clone https://github.com/Duet3D/CANlib.git --branch 3.5-dev
- git clone https://github.com/Duet3D/CoreN2G.git --branch 3.5-dev
- git clone https://github.com/Duet3D/FreeRTOS.git --branch 3.5-dev
- git clone https://github.com/Duet3D/RRFLibraries.git --branch 3.5-dev
- git clone https://github.com/Duet3D/DuetWiFiSocketServer.git --branch dev
- Make CrcAppender available to Eclipse. The easiest way to do this is to:
- Make CrcAppender an executable. Find it in RRF git folder RepRapFirmware/Tools/CrcAppender/macos-x86_64/CrcAppender. In a terminal window, cd to this folder, then send chmod 755 CrcAppender to make it an executable.
- Copy CrcAppender to somewhere your system PATH can find it, usually /usr/local/bin/
- Open Eclipse via the terminal. You need to do this, because otherwise it won't find CrcAppender, which is required for building the firmware.
- Find Eclipse in your Application folder, then right-click on it and 'Show Package Contents'. Open Contents/MacOS/ to find the 'eclipse' executable.
- Drag this to a terminal window, then press return in the terminal to run Eclipse.
- Leave the terminal window open while Eclipse is running. You'll need to run Eclipse this way each time you open it.
- Set up Eclipse
- The build depends on the Eclipse workspace variable ArmGccPath being set to the directory where your arm-none-eabi-g++ compiler resides. To set it, go to Eclipse -> Settings -> C/C++ -> Build -> Build Variables and click "Add...". Create variable name 'ArmGccPath', Type 'Directory', then browse to the folder containing eg /Applications/ArmGNUToolchain/12.2.mpacbti-rel1/arm-none-eabi/bin
- For current versions of RRF, import RepRapFirmware, CANlib, CoreN2G, FreeRTOS, RRFLibraries and DuetWiFiSocketServer projects using File -> Open Projects from File System.
- Older versions of RRF may not require CANlib, and use CoreNG rather than CoreN2G. See the instructions above for the dependencies and configurations needed.
- Build RepRapFirmware
- Build CANlib, CoreN2G, FreeRTOS and RRFLibraries first, then RepRapFirmware. DuetWiFiSocketServer must be present but you don't need to build it.
- Build RRF for your board by selecting the Build configuration from the hammer icon drop-down in the menu bar at the top of the screen.
See this forum post.