Skip to content

How to: Build Prusa Firmware

3d-gussner edited this page Dec 23, 2018 · 8 revisions

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.

Step 1 - Development environment preparation for Prusa-Firmware

  1. Downloaded Arduino-IDE-1.6.9-windows.zip file from https://www.arduino.cc/download_handler.php?f=/arduino-1.6.9-windows.zip .

  2. extract the zip in your <path>

  3. 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.

    1. Now you have <path>\arduino-1.6.9-windows\arduino-1.6.9\portable
  4. created a folder output under <path>\arduino-1.6.9-windows\arduino-1.6.9\portable.

    1. Now you have <path>\arduino-1.6.9-windows\arduino-1.6.9\portable\output
  5. Prepare the Arduino toolchain

    1. Open the portable IDE
    2. Choose File -> Preferences and set "Additional Boards Manager URLs" to the RAMBo repository: https:// raw.githubusercontent.com/ultimachine/ArduinoAddons/master/package_ultimachine_index.json
    3. Select Tools -> Boards -> Boards Manager and install the RAMBo board:
      "RepRap Arduino-compatible Mother Board (RAMBo) by UltiMachine"
    4. Close the IDE.
    5. Open the IDE and select RAMBo as target board from the Tools -> Boards submenu
  6. 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

  1. add/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
  1. 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.
  2. 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.

Useful tools for Windows are:

Step 2 - Download or Clone Prusa-Firmware

Step 3 - Configure the Prusa-Firmware - select variant

  1. 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.
  2. If you gonna compile the firmware just in english set LANG_MODE to 0 in file "Firmware/config.h" (this is now default).
  3. 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:
    1. 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
    2. Change #define FW_REPOSITORY "Unknown" to #define FW_REPOSITORY "Prusa3d"

Step 4 - Compile the Pruse-Firmware

  1. Open exclusive Prusa-Firmware Arduino IDE 1.6.9 / 1.8.5
  2. Load the firmware project with File -> Open... Navigate to and open:
    Prusa-Firmware/Firmware/Firmware.ino
  3. Make sure that you selected the "RAMBo" board under Tools -> Board -> RAMBo
  4. Compile the firmware with Sketch -> Verify/Compile (CTRL-R) --or--
  5. Export the compiled binary with Sketch -> Export compiled Binary (CTRL-ALT-S).
    You will find the exported binary in Prusa-Firmware/Firmware/Firmware.ino.rambo.hex

Step 5 - Upload Firmware

  1. 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
    1. Check under Tools -> Board: that you have chosen the RAMBo
    2. Choose the correct COM port under Tools -> Port:
    3. Upload your Prusa-Firmware via Sketch -> Upload (CTRL-U)
  2. You also can upload your exported .hex files via Slic3rPE or Prusa Flash tool if it is "single language" version.
  3. If you have a multiple language version you need to use Slic3rPE to upload the compiled firmware