RUG/Pennsylvania/State College/Electronics/Flashing tutorial

From RepRap
Revision as of 19:01, 23 December 2013 by Aem28 (talk | contribs) (Edit the configuration.h file)
Jump to: navigation, search

Welcome

The 'firmware' is a program loaded on the board fixed on the printer (Arduino or RAMBo). This program interprets the g-code commands send by the computer (using a g-code sender such as Pronterface) and turns them into electric signals to command the motors.

Flashing it consists in compiling this firmware on a computer and copying it on the board. Before compiling it, you will need to edit the source code to adapt the firmware to your printer.

Requirements

In order to compile the firmware and send it to the board, you need to download the Arduino IDE software.

You also need to download the Marlin firmware source code. You can either clone the repository if you're familiar with Github, or download the code as a .zip file (download ZIP button on the right).

Prepare the code

The Marlin firmware is written in C and C++. If you don't know those languages, be sure to respect the syntax when you change the code. Anyway, in order to flash a printer, you'll only need to edit a few files that were designed to ease this process.

Once you've downloaded the Marlin source code, un-zip it and open the Marlin-Marlin_v1/Marlin/Marlin.ino file. This file opens the Arduino editor, which allows you to change the source code. Note that you can actually use any text editor to change the code. However, if you do so you'll need to restart the Arduino IDE after you saved your changes, or else they won't be taken into account. All the files you may want to change are located in the same folder as the Marlin.in file.

All the changes are referenced by line number. Those one numbers are likely to change over versions.

Edit the configuration.h file

Line 28: Change the Baudrate to 115200
#define BAUDRATE 115200

Edit the pins.h file

Edit the configuration_adv.h file

Flash the code

Troubleshooting