How to Upload Firmware Arduino .h Files
How To Successfully Flash Your 3D Printer'due south Firmware
When customizing or upgrading your 3D printer, you lot may need to flash your firmware - here are the steps to succeed.
Flashing firmware can be a daunting task, especially if you've never washed it before. Collectively, we at MatterHackers have washed it hundreds, if non thousands of times, so we can capeesh the complexity involved.
In any case, but try to stay calm. Though information technology is complex, flashing firmware is a scientific process, and the rules of logic apply. Even when you lot're looking at an error bulletin telling y'all that you don't accept a sure library-- when you know for a fact that you've installed that particular library not v minutes ago-- and yous can feel your claret boiling, just remind yourself that this isn't a matter of life and death. We've been there, and there is a logical explanation that tin (eventually) be found.
Process overview
The process for flashing firmware (at least in the context of the 3D printing earth) consists of something like the following:
- Make sure yous are running the latest version of Arduino software and have the correct libraries installed. If your lath is non Arduino-based, obtain the comparable software.
- Download the correct firmware for your printer.
- Make any adjustments to the firmware, which is common for hardware modifications.
- Select the right serial port and blazon of Arduino board for your printer.
- Compile and upload the firmware.
Non much to information technology, is there? Sometimes it is just that easy. If non, resources are bachelor to assist yous along. Come across the section beneath, 'Boosted resources'.
Arduino
What is Arduino? Arduino is an open source electronics visitor and platform which designs and sells microcontrollers. The boards they produce are the ground for many of the boards used for controlling 3D printers due to their open source nature and ease of utilize.
As mentioned in the final section, the Arduino platform is not the only platform used for running 3D printer controllers. Smoothie is another such platform, and requires different software to flash boards which use information technology. In this guide we're going to focus on Arduino-based controllers, since nigh boards we deal with are based on them. The concept and general process volition be the same, though, then well-nigh everything we discuss here should exist good information no matter what platform your printer runs on.
How practise I know what platform my controller board runs on?
Good question. If your printer runs RAMPS, RAMBo, Duet, or anything else based on an Arduino board, then it's Arduino-based.
Common non-Arduino boards include Smoothie, BeagleBone, and Duet. These require their own firmware-flashing software which we practise not cover here.
If in dubiousness, check with the board manufacturer for information about flashing firmware.
How to install
Head over to the Arduino website and download the latest version of the Arduino IDE (integrated development environment) for your operating arrangement: https://www.arduino.cc/en/Master/software
Just make sure y'all get the standalone version, not the online IDE. The online version requires an account, and since we're more often than not familiar with the standalone version, we're going to outline the process using that. You are welcome to attempt to follow along using the online IDE, but in that location may be differences that nosotros don't cover.
Encounter the Arduino Getting Started guide if you have whatsoever bug getting the IDE up and running: https://world wide web.arduino.cc/en/Guide/HomePage
Purpose
And so what does the Arduino IDE actually do? This program loads the firmware files into retentiveness, allows the user to edit code if necessary, compiles the code, and finally sends the compiled code to the lath over a serial connexion.
Firmware
Firmware is the actual lawmaking that runs your printer. It starts every bit human-readable lawmaking, which defines the logic (i.due east. how the printer is supposed to act given sure circumstances), is compiled into motorcar-readable lawmaking, and so is uploaded to the memory on the controller board where information technology senses input and reacts according to the logic divers in the code. It'due south very complex, and takes a lot of smart people a long fourth dimension to develop.
Flavors
On its fundamental level, firmware is just a computer program. As is typical of any function that a computer program performs, different programs accept been created that all work similarly. They all do the same matter (i.due east. control a 3D printer), but the logic and algorithms they utilize can be dissimilar, and thus function differently. We telephone call these unlike programs different flavors-- like ice cream. One's not necessarily ameliorate than another (though sometimes they certainly are), but just different .
Some of the common open source firmware solutions available include Repetier, Marlin, Sprinter, Smoothie, grbl, etc. Nosotros'll affect Repetier and Marlin specifically, though the same concepts will use to most any of the others.
Download
Electric current versions of the firmware files for Repetier and Marlin tin be plant in their corresponding GitHub repositories:
Repetier: https://github.com/repetier/Repetier-Firmware
Marlin: https://github.com/MarlinFirmware/Marlin
Now just then you know, firmware is provided in various forms. Hex files (.hex) are common, just they are a result of having already compiled the lawmaking and cannot be configured, so you lot will need to become the files that contain the code to exist able to edit if needed.
What you are looking for is the .ino file (file format for the Arduino program), forth with the other .cpp and .h files that make up the lawmaking. They should all be in a folder chosen 'Marlin' or 'Repetier', depending on the flavour.
If your printer's manufacturer has a website, hopefully they host pre-configured firmware intended specifically for your printer. Lulzbot, makers of the TAZ, has firmware readily available for all their printers, for example. While they provide .hex files on the primary page listing bachelor firmware , if you dig downward into the FTP site yous can notice the Arduino file along with the other code yous need to edit and compile from scratch. For example, here's a link to the Marlin folder that contains the .ino, .cpp, and .h files that make up the Marlin firmware for the TAZ half-dozen: TAZ half dozen Marlin Firmware
Download the binder, with all the files inside, and open the .ino file using the Arduino IDE.
Configuration
In one case you have the firmware open you can edit the lawmaking. You lot probably don't need to touch near of these files, as they have lots of variables and information already divers, and messing something up could crusade a compiler fault. Mostly speaking, it'southward all-time not to edit anything unless y'all know what information technology does and you are certain that y'all need to.
Configuration.h
In Marlin and Repetier, the Configuration.h file is the one yous'll probably get to know the best. It contains almost of the common user-editable settings that you're likely to need to edit when doing a modification. Other firmware should have a comparable file, which will function similarly.
Below is a list of the nigh mutual settings you might desire to modify in both Marlin'due south and Repetier's Configuration.h files. For further information, yous tin consult the Marlin documentation at marlinfw.org or the Repetier documentation at repetier.com . Repetier also has a handy online configuration tool , so you do not demand to edit the Configuration.h file directly.
When you are washed, be certain to save your changes past hitting CTRL + S.
Baudrate
# define BAUDRATE 115200
The rate at which $.25 of information are interchanged betwixt the board and the host computer. Common values are 115200 and 250000.
Motherboard type
# ascertain MOTHERBOARD BOARD_RAMPS_14_EFB
The type of controller board your printer has. RAMPS, RAMBo, Azteeg, etc.
Thermistor type
# ascertain TEMP_SENSOR_0 five
Different thermistors have different resistances to measure temperature. Defining which thermistor your hot end uses is admittedly necessary to ensure that the temperature is measured correctly.
Motor directions
# define INVERT_X_DIR true
# define INVERT_Y_DIR imitation
# ascertain INVERT_Z_DIR true
# define INVERT_E0_DIR fake
While motor wires can be physically swapped effectually to alter the direction in which the motors turn, the firmware can sometimes more hands be changed. Changing the value for the direction of the motors will cause them to spin the opposite management.
Steps per mm/motor current
# define DEFAULT_AXIS_STEPS_PER_UNIT { 80, 80, 4000, 500 }
Setting how many steps is required to move the motor one millimeter is critical for calibrating the printer and making sure it moves correctly.
Endstop configurations
# ascertain X_MIN_ENDSTOP_INVERTING false
# ascertain Y_MIN_ENDSTOP_INVERTING false
# define Z_MIN_ENDSTOP_INVERTING fake
Knowing how many endstops the printer has and whether the switches are always on or always closed is important, and these settings are easily adjusted here.
Temperature maximums
# define HEATER_0_MAXTEMP 285
If you upgrade your hot cease (say, to an all-metal E3D v6 from a PEEK one), yous'll want to be able to increase the maximum temperature and then that the printer knows information technology can go up that high. Temperatures can be manually set in degrees Celsius.
Compiling and Uploading
Now that you take made all the changes you want to your firmware configuration, it is fourth dimension to set up Arduino to upload your new firmware to your printer.
Libraries
Some firmwares require boosted libraries to be installed. These are additional pieces of software which the firmware utilizes to perform certain functions. For example, one library commonly used by printer firmwares is U8glib which handles graphical LCD displays. If your printer has a graphical (not text based) screen then you will need this library.
Libraries are hands installed through the Library Director in Arduino.
- Go to Sketch > Include Library > Manage Libraries.
- Search for U8glib.
- Click Install.
Board
This is where y'all must select the blazon of motherboard that is installed in your printer. If you select the wrong board, you will almost likely become an error when compiling.
Most 3D printer motherboards are based on the Arduino Mega 2560, so if you are in incertitude and then selecting "Arduino/Genuino Mega or Mega 2560" is a safe bet. In some cases, though, you volition need to add a new board to Arduino.
Motherboards and Arduino Selection
| Motherboard | Arduino Board Selection |
| Azteeg X3 and Azteeg X3 Pro | Arduino/Genuino Mega or Mega 2560 |
| Brainwave Pro | Brainwave Pro Instructions |
| Printrboard | [BootloaderCDC]Teensylu/Printrboard Instructions |
| RAMPS | Arduino/Genuino Mega or Mega 2560 |
| RAMBo and RAMBo Mini | RAMBo Custom Board URL: https://raw.githubusercontent.com/ultimachine/ArduinoAddons/primary/package_ultimachine_index.json |
| Ultimainboard | Arduino/Genuino Mega or Mega 2560 |
Installing Custom Boards
This process varies depending on which board you demand to install, and which version of Arduino you are running. The following outlines the process using the built-in Boards Manager in Arduino 1.6 or after. This works for the RAMBo board. For other boards you will need to follow the instructions in the links provided in a higher place.
- Go to File > Preferences. In the box for "Additional Boards Manager URLs" paste the URL for your board.
- Become to Tools > Board > Boards Manager. Search for your motherboard, and click Install.
- Go back to Tools > Board and select your motherboard.
Port
This is the serial port you employ to connect to your printer. This is the same as the serial port selected in MatterControl. If y'all accept only one printer connected to your computer, then choose the simply port available.
Compiling
Compiling converts the human readable (if you are a programmer) source lawmaking into binary instructions which the processor understands. When you lot click the checkbox button in Arduino, information technology will compile the firmware. During this process it will check for any issues with the lawmaking. Cross your fingers. If all goes well so when it is washed it will report the size of the compiled firmware in white text in the panel area. If there is an issue, information technology will give you lot an fault message in orange text.
If you run into a problem, don't panic. We have some common problems listed below. Check to see if your error message is amidst them.
Uploading
Finally, click the arrow button to upload the firmware to your printer. It volition be automatically compiled if you lot have non washed so already, and and so the transfer will begin. This will take a infinitesimal or two; but exist patient. When the process completes your printer volition reboot.
Getting Assist
If y'all run across a problem, don't panic. We have some common problems listed below. Cheque to come across if your error message is amongst them. If not, you will probably have to become to the internet for aid. Google is your friend. Arduino volition oft requite yous a very long list of mistake letters in the console. The most disquisitional one is ordinarily the first ane. Search for the mistake bulletin along with the proper name of your firmware or printer. You will likely find some forum posts pointing you lot in the right direction.
If you exercise not plow up annihilation in your research, y'all may need to ask a question on a web forum. The best place to ask is probably the forum for your specific printer. The most important thing to remember when request a question online is to include the full text of the error message. Whenever Arduino gives you an fault, at that place will exist a button above the console area which lets yous re-create the entire text. You can so post information technology using a service similar Pastebin .
Common Errors
An error occurred while uploading the sketch
This means that Arduino is unable to communicate with your printer. Make certain that your printer is powered on and that you have selected the right port. Try pressing the reset button on your board later on clicking upload. Some printers crave special steps to be taken to put them in programming style. Consult your printer'south documentation to see if at that place is a button combination you lot must press or hold down in order to flash the firmware.
If yous are absolutely certain that your printer is powered and communicating with your reckoner so it may be possible that there is an issue with the microcontroller'due south bootloader. Flashing the bootloader requires specialized equipment. If your bootloader is corrupt then you should contact your printer or motherboard'south manufacturer.
using typedef-proper noun 'fpos_t' after 'struct'
Y'all are using an older firmware which is non compatible with the latest versions of Arduino. Arduino ane.6 and afterward bankrupt compatibility with older versions. Some printers notwithstanding utilize older firmware which has not been updated yet. You will need to install Arduino version ane.0.6. You can find it here:
https://www.arduino.cc/en/Main/OldSoftwareReleases
'DIOZ_PROBE_PIN_RPORT' was not declared in this scope
This indicates that the motherboard yous are trying to use (the one you have defined in Configuration.h) is not fully supported by your firmware. Specifically, the firmware is trying to utilise pins that have not been defined in that motherboard's entry in pins.h. This may happen if you are trying to apply a unlike type of motherboard than your printer came with.
Error compiling for board Arduino/Genuino Mega or Mega 2560.
This type of error message is shown if Arduino cannot discover a file it is looking for. Usually this is considering you are missing one of the libraries required by your firmware. In the example in a higher place nosotros are missing the U8glib library. See the section above on installing libraries.
You lot might also encounter a similar fault message regarding Configuration.h if yous opened the .zip file your firmware came in only did non unpack it. Yous must unpack the .zip in order for Arduino to read all the firmware files.
Source: https://www.matterhackers.com/news/how-to-successfully-flash-your-3d-printers-firmware
0 Response to "How to Upload Firmware Arduino .h Files"
Post a Comment