Skip to content

How to: Build Prusa Firmware

3d-gussner edited this page Feb 16, 2019 · 8 revisions

New automatic build version available.

Build a Prusa Firmware environment for testing and manual compiling

So please follow these instructions below for Arduino IDE 1.8.5 to have these exclusive for Prusa-Firmware and MMU2 delevlopment.

Step 1 - Development environment preparation for Prusa-Firmware

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

  2. extract the zip in your <path>

  3. create a folder portable under <path>\arduino-1.8.5-windows\arduino-1.8.5\ Making it portable you can separate the Prusa Firmware IDE 1.8.5 from other Arduino projects, libraries, boards and sketches. It is exclusively for Prusa Firmware.

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

    1. Now you have <path>\arduino-1.8.5-windows\arduino-1.8.5\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.8.5-windows\arduino-1.8.5\portable\packages\rambo\hardware\avr\1.0.1\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 or find and modify in <path>\arduino-1.8.5-windows\arduino-1.8.5\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.8.5-windows\arduino-1.8.5\portable\output
build.verbose=true

....

compiler.cache_core=false

...

serial.stopbits=1
sketchbook.path=<path>\arduino-1.8.5-windows\arduino-1.8.5\portable\sketchbook\libraries
software=ARDUINO
  1. made some changes to the language sh scripts
  • /lang/config.sh
# Arduino main folder:
export ARDUINO=<path>/arduino-1.8.5-windows/arduino-1.8.5

...

# Output folder:
export OUTDIR="<path>/arduino-1.8.5-windows/arduino-1.8.5/portable/output"

This matches the exclusive Prusa IDE 1.8.5 paths with the language sh scripts.

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