3.1 RepRap Firmware
The Duet runs RepRap Firmware, a C++ firmware originally written by Dr Adrian Bowyer. The firmware can be compiled with the Arduino IDE or Eclipse and uploaded like other firmware, but an easily-uploaded precompiled version is supplied with new releases. Most users will therefore never have to recompile the firmware, but should upload the current version when setting up the board for the first time. There are 2 reasons for this:-
After the first-time firmware upload, users should only only occasionally need to upload a new precompiled release to take advantage of new features.
Printer-specific information is set by Gcode configuration files which can be edited with a text processor and saved on an SD card which is read on machine startup. Configuration files for different types of printer are also included with new firmware releases.
The firmware supports receiving GCode from 3 locations:-
3.2 Firmware Downloads
The DC42 version of the Firmware covers the widest range of printer configurations - cartesian, delta and core-XY and is recommended for general use. It is available for download at https://github.com/dc42/RepRapFirmware/tree/dev.
Tip: It is easiest to download the entire firmware folder by clicking on the Download Zip button on the right-side of the page, and extract it to a convenient folder on your PC. If you only intend to update to the latest release of the firmware then you will only need the 2 folders “Release” (containing the precompiled binaries) and “SD-image” (containing the files for SD-card) and can delete all the other files and folders if you wish.
Extract the zip file and look in the Release folder for the most recent version - at the time of writing this is RepRapFirmware-1.09x-dc42.bin.
3.3 Supporting Software Downloads
This section and the following one are taken from RepRapPro’s detailed instructions. You should refer to these for more details if needed.
Updating firmware from installed versions prior to V1.09x-dc42 and DWC 1.10
Download and install the appropriate version of Arduino 1.6.1 for your operating system from http://arduino.cc/en/Main/OldSoftwareReleases. You should not use a later version than 1.6.1 as it will not include the application bossac which is used to flash the Duet firmware. You should download and install Arduino before connecting the Duet, so that the correct device drivers will be installed on first connection.
Once installed, bossac can be found in the Arduino application hardware/tools subfolder. For Windows this will be C:\Program Files (x86)\Arduino-1.6.1\hardware\tools or similar and will be listed as bossac.exe (or just bossac if Windows Explorer is set to hide application extensions).
On Linux, if you install Arduino in /usr/local/arduino-1.6.1/, then bossac will be in /usr/local/arduino-1.6.1/hardware/tools/.
On Apple OS X, install the Arduino application in your Applications folder - bossac will then be in Arduino.app/Contents/Resources/Java/hardware/tools/.
3.4 Checking that the Duet is recognized
Connect the Duet to your PC by USB cable with external power to the Duet OFF.
In Windows, use Device Manager to check that your Duet is being recognized properly. If it has firmware loaded it will show up as an “Arduino Due” and have a COM port allocated to it. If the firmware has been erased it will show up as a “Bossa Program Port” with a different COM port.
In Linux, sending “lsusb” from the command line should report “Atmel Corp. at91sam SAMBA bootloader” if the firmware has been erased, and “Arduino SA” if the firmware is loaded.
RepRapPro’s instructions for OS X suggest using the Arduino IDE to check if the Duet is recognized - it should be reported as “cu.usbmodemfa131” or similar. Alternatively send ‘ls /dev/cu.*’ in a Terminal window for a list of ports.
3.5 Software Setup
The bossac program is run from a command line, so it will be easier and involve less typing of paths if you copy it into a temporary directory, along with the version of RepRap Firmware you are going to upload. For conciseness, these instructions will cover the Windows procedures only from now on. For Linux and OS X users, use the same general principles as described below, or refer to RepRapPro’s more detailed instructions if you are not sure of how to proceed.
In Windows, create the folder C:\Temp and copy bossac.exe and RepRapFirmware-1.09x-dc42.bin (or current version if later) into it.
3.6 Flash the Firmware
The firmware can only be uploaded after erasing the previous version and resetting the board. The ERASE and RESET buttons are next to each other on the front short edge of the Duet V0.8.5, to the left of the USB socket. In the picture below they are just above the middle of the left-hand side:-
With the Duet powered by USB only, press the ERASE button in and hold for a few seconds. Release and then press the RESET button, or unplug the USB lead and plug it in again. Wait a few seconds for the Duet to reboot before proceeding.
NOTE: The ERASE and RESET buttons may be “sticky” and not spring back out after pressing. In this event you should gently ease the button out with your fingernail or small pointed object.
Check that the Duet now shows up as unprogrammed - in Windows as “Bossa Program Port”.
Now open a Command Prompt window.
Type cd C:\Temp to change to the directory containing bossac.exe and the firmware .bin file.
Enter the following command to initiate the upload, then press Enter (If you are uploading a different firmware version then change the 1.09x-dc42 to match the name of your file):-
bossac.exe -e -w -v -b RepRapFirmware-1.09x-dc42.bin
(Tip: You can block and copy the above command or an edited version of it to avoid typing errors, but you may have to right-click and select Paste at the command prompt - in some Windows versions the Command Prompt box won’t accept the Ctrl-V keyboard shortcut)
Bossac will report that it has found the device on a COM port, erase flash memory, upload and verify the firmware, and set it as bootable.
You may get one of several error messages if the upload fails:-
If you continue to get one of these errors then refer to the Troubleshooting section below.
3.7 Check your upload (optional)
If you are uploading firmware for the first time to a Duet you may like to follow the procedure below to confirm that the firmware is up and running. First open the Arduino 1.6.1 IDE that you downloaded and installed in Section 3.3 above. Go to Tools>Board and choose Arduino Due (Native USB Port).
Then select the COM port from the Tools>Ports menu.
Now select Tools>Serial Monitor, which will open in a new window. Set the Line Ending box to “Both NL and CR” and the Speed box to “115200 baud” (bottom right), then type “M115” (with a capital M) in the command line and click Send. The Duet will report back the firmware version found - which should be the same as what you uploaded - and the electronics version and date.
3.8 Prepare SD-image
The SD card fitted to your Duet must contain configuration and operating files which are loaded in 4 folders in the card’s root directory:-
It is important to use the matching SD-image files supplied with the firmware release you have just uploaded, and to select the correct versions for your printer type. If you look at the SD-image folder that you downloaded and extracted in Section 3.2 above you will see that it contains “sys” folders for 5 printer variants, and “gcode” folders for 2.
You will need to choose the /gcodes-xxx and /sys-xxx folders for the printer type that most closely matches your printer, as well as the macros and www folders, which are common to all machines. Copy these across to your SD card and then rename the “gcodes-xxx” and “sys-xxx” folders to “gcodes” and “sys” respectively.
You will now need to configure the files in /sys to match your exact printer configuration. If you are upgrading to a new firmware release on an already operational calibrated printer then you can just open your previous version and new version side by side in a file comparison tool such as WinMerge (or 2 text processor windows) and make the necessary changes. If you do not already have a calibrated and working printer, then you should configure the new files using the guidance provided in the following RepRap wiki pages:-
If you encounter problems with any of the steps described above, then the solution will almost certainly be described in RepRapPro’s comprehensive Duet Commissioning, Maintenance and Troubleshooting documents. Some important items are highlighted below:-