-
Notifications
You must be signed in to change notification settings - Fork 11
How to: Build Prusa Firmware
Update 06 Jan 2019: You can try to use https://github.com/3d-gussner/Prusa-Firmware/tree/MK3-win_build to build your firmware under Windows. Please also read the release notes https://github.com/3d-gussner/PF-build-env/releases
Prusa still want us to compile the Prusa-Firmware with Arduino IDE 1.6.9 BUT the MMU2 has to be compiled with Arduino IDE 1.8.5.
So please follow these instructions below for Arduino IDE 1.6.9 and Arduino IDE 1.8.5 to have these exclusive for Prusa-Firmware and MMU2 delevlopment.
I never had issues to compile Prusa-Firmware with Arduino IDE 1.8.5 (except some bugs in the source code) and running it on my printers. But to be compatible with their development policy in case of issues I do both.
-
Downloaded Arduino-IDE-1.6.9-windows.zip file from https://www.arduino.cc/download_handler.php?f=/arduino-1.6.9-windows.zip .
-
extract the zip in your
<path>
-
create a folder portable under
<path>\arduino-1.6.9-windows\arduino-1.6.9\
Making it portable you can separate the Prusa Firmware IDE 1.6.9 from other Arduino projects, libraries, boards and sketches. It is exclusively for Prusa Firmware.- Now you have
<path>\arduino-1.6.9-windows\arduino-1.6.9\portable
- Now you have
-
created a folder output under
<path>\arduino-1.6.9-windows\arduino-1.6.9\portable
.- Now you have
<path>\arduino-1.6.9-windows\arduino-1.6.9\portable\output
- Now you have
-
Prepare the Arduino toolchain
- Open the portable IDE
- Choose File -> Preferences and set "Additional Boards Manager URLs" to the RAMBo repository: https:// raw.githubusercontent.com/ultimachine/ArduinoAddons/master/package_ultimachine_index.json
- Select Tools -> Boards -> Boards Manager and install the RAMBo board:
"RepRap Arduino-compatible Mother Board (RAMBo) by UltiMachine" - Close the IDE.
- Open the IDE and select RAMBo as target board from the Tools -> Boards submenu
-
Modify in
<path\arduino-1.6.9-windows\arduino-1.6.9\portable\packages\avr\platform.txt
the line
compiler.c.elf.flags={compiler.warning_flags} -Os -Wl,--gc-sections
to
compiler.c.elf.flags={compiler.warning_flags} -Os -Wl,-u,vfprintf -lprintf_flt -lm -Wl,--gc-sections
- add or find and modify in
<path>\arduino-1.6.9-windows\arduino-1.6.9\portable\preferences.txt
the lines
board=rambo
boardsmanager.additional.urls=https://raw.githubusercontent.com/ultimachine/ArduinoAddons/master/package_ultimachine_index.json
build.path=<path>\arduino-1.6.9-windows\arduino-1.6.9\portable\output
build.verbose=true
....
compiler.cache_core=false
...
serial.stopbits=1
sketchbook.path=<path>\arduino-1.6.9-windows\arduino-1.6.9\portable\sketchbook\libraries
software=ARDUINO
- update the libraries when they show up BUT NEVER EVER update the Arduino AVR Boards in the board manger these must stay under IDE 1.6.9 at version 1.6.11. Using Arduino IDE 1.8.5 updating boards, library isn't an issue.
- made some changes to the language sh scripts
- /lang/config.sh
# Arduino main folder:
export ARDUINO=<path>/arduino-1.6.9-windows/arduino-1.6.9
...
# Output folder:
export OUTDIR="<path>/arduino-1.6.9-windows/arduino-1.6.9/portable/output"
This matches the exclusive Prusa IDE 1.6.9 paths with the language sh scripts.
If you want to use Arduino IDE 1.8.5 follow the steps above and just change 1.6.9
to 1.8.5
.
- Notepad++ https://notepad-plus-plus.org/ Great tool to edit and compare single files (Compare Plugin)
- Winmerge http://winmerge.org/?lang=en I use it all the time to compare different versions of development folders and files
- Git-scm https://git-scm.com/downloads
- You can either clone the prusa3d/Prusa-Firmware repository to a local directory or download the ZIP file from https://github.com/prusa3d/Prusa-Firmware
- Specific released versions of source code in either .zip or .tar.gz packages can be found here: https://github.com/prusa3d/Prusa-Firmware/releases
- 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. - If you gonna compile the firmware just in english set
LANG_MODE to 0
in file"Firmware/config.h"
(this is now default). - After testing your own firmware and it works fine, change in
"Configuration.h"
following things to get rid of LCD warnings and user interactions when connecting via USB/Octoprint:- Change
#define FW_DEV_VERSION FW_VERSION_UNKNOWN
to at least#define FW_DEV_VERSION FW_VERSION_RC
or if you 100% sure to#define FW_DEV_VERSION FW_VERSION_GOLD
- Change
#define FW_REPOSITORY "Unknown"
to#define FW_REPOSITORY "Prusa3d"
- Change
- Open exclusive Prusa-Firmware Arduino IDE 1.6.9 / 1.8.5
- Load the firmware project with File -> Open... Navigate to and open:
Prusa-Firmware/Firmware/Firmware.ino
- Make sure that you selected the
"RAMBo"
board under Tools -> Board -> RAMBo - Compile the firmware with Sketch -> Verify/Compile (CTRL-R) --or--
- Export the compiled binary with Sketch -> Export compiled Binary (CTRL-ALT-S).
You will find the exported binary inPrusa-Firmware/Firmware/Firmware.ino.rambo.hex
- If you have your printer connected to your computer and compiled your Prusa-Firmware successfully you can upload the "single language" Firmware directly from Arduino IDE 1.6.9 / 1.8.5. Don't try this if you have multiple languages activeated
- Check under Tools -> Board: that you have chosen the
RAMBo
- Choose the correct
COM port
under Tools -> Port: - Upload your Prusa-Firmware via Sketch -> Upload (CTRL-U)
- Check under Tools -> Board: that you have chosen the
- You also can upload your exported
.hex
files via Slic3rPE or Prusa Flash tool if it is "single language" version. - If you have a multiple language version you need to use Slic3rPE to upload the compiled firmware