PrusaFirmwareBraino

From RepRap
Jump to: navigation, search

PRUSA FIRMWARE

When I built my Prusa in 2011, I used Sanguino electronics with ATMEGA644P, and Sprinter firmware. PC ran Windows operations system.

Now (2015), I need to modify the firmware as part of printer calibration PrusaCalibrationNotesBraino. The old PC has been replaced with a upgraded workstation running Linux (Mint 17, similar to Ubuntu). The entire tool chain has seen changes or upgrades. The information retained from the original firmware is the Configuration.h from Sprinter. This should be all that is necessary.

The goal is Sprinter firmware on Sanginololu electronics prior to calibration PrusaCalibrationNotesBraino.

This is the summary of investigation spanning one month's time. Getting new firmware on this working machine was much more difficult than necessary, and more difficult that at the time of the origianl build. The reason being that the documentation has not been kept current. Hopefully this page will capture a snapshot of the current stat of the tools as of January 2015. I hope your firmware build is significantly shorter.

Prerequisites

In order to create new firmware, we need:

  • host PC (toolchain)
  • Reprep (electronic configuration + mechanical configuration)
  • Firmware application (source code configured for the individual reprap machine)
  • firmware programmer (to get the new firmware into the reprap controler)
  • test to verify everything works

The reprap is a working metric (Mendel) Prusa (2011). The electronics are known-working Sanguinololu v1.3a.

The host PC needs the full toolchain discovered and installed. On Linux this should be much easier than on Windows, as windows was a not pleasant.

Host PC Toolchain

My host PC has linux Mint 17 64 bit. Actually, I did this a bunch of times and I believe the correct instrustions are the same and successful on Mint 16 and 17 both 32 bit and 64 bit. We Need:

  • Host PC OS
  • Arduino IDE (compiler)
  • Sanguino hardware support files (so the Arduino IDE compiler knows our hardware)
  • Sprinter firmware source code

We want to use the Arduino IDE to compile the Sprinter firmware for our hardware.

OS Clean install

I start with a clean OS install. I run virtual box virtual machines. If anything goes horribly wrong it is quicker to launch a new virtual machine rather than re-do the main PC.

When everything finally works, I either keep the virtual machine, or configure a dedicated physical machine. In this case I have a bunch of old junker PC that are still fine for running a 3D printer, and this frees up my main rig for its intended purpose.

Download Arduino IDE

  • Download the latest Arduino from the Arduino downloads page http://arduino.cc/en/main/software. I used 1.0.6 for linux 32 bit for this pass of the instructions, but it also worked with 64 bit last pass.
  • Extract the downloaded archive. (to your home directory Downloads folder by default)
  • Find the Arduino script in the arduino directory. (in your Downloads directory or wherever you extracted it)
  • Launch the Arduino IDE by running the shell script (just click on it). NOTE: you just run it in place as-is, there is no install step aside from the extract step.


At first launch, the Arduino IDE creates a "sketchbook" directory. This is a C code "projects" directory. I guess they could not simply name it "projects", as that would be too obvious.

Also, at first launch, the Arduino IDE will add the current user to the DIALOUT group. This is required, as it allows us to access the USB virtual serial port /dev/ttyUSB0. The USB virtual serial port /dev/ttyUSB0 is the connection from the Arduino IDE to the Sanguino electronics. This will also be the connection to the PRonterface application on the PC, but we'll get to that in a minute.

NOTE: Do NOT install arduino IDE (1.0.5 at this writing) from the Software Manager in Linux Mint. That method auto-installs into /usr/share/arduino. Compiling results in an error.

 /usr/share/arduino/hardware/sanguino/cores/arduino/HardwareSerial.cpp:132:15: error: attempt to use poisoned "SIG_USART1_RECV"
  #elif defined(SIG_USART1_RECV)
                ^

This error can be corrected, but involves editing files you should not have to edit. Also, I encountered additional errors after fixing this, and stopped as it was leading nowhere. The successful method is download to someplace in your home directory, extract to someplace in your home directory, and run it from where you extracted it. The error might have something to do with owner and permissions, but that is beyond the scope of this instruction.

install pronterface

In order to test the firmware, we need the control application Pronterface running on the PC. After testing Pronterface is the tool by which we control the printer for day to day operation.

Run the following commands from a terminal window

sudo apt-get install python-serial python-wxgtk2.8 python-pyglet python-tornado python-setuptools python-libxml2 python-gobject avahi-daemon libavahi-compat-libdnssd1 python-dbus python-psutil git

Pronterface won't build due to error about numPy (on linux Mint 32 bit) so -

 Open the Software Manager and install Python-Numpy   

Get the material for Printrun (Pronterface)

 git clone https://github.com/kliment/Printrun.git

This will create a folder Printrun in your home directory. Clicking on the pronterface script will launch the pronterface alpplication.

Be careful of the instruction in the readme, those are very old and out of date. Avoid these. Following the old instructions can mess things up.

install slicer

Slic3r converts stl files into g-code commands that the printer firmaware uses to move the print head and extruder.

From https://github.com/alexrj/Slic3r/wiki/Running-Slic3r-from-git-on-GNU-Linux

 sudo apt-get install git build-essential libgtk2.0-dev libwxgtk2.8-dev libwx-perl libmodule-build-perl libnet-dbus-perl libexpat1-dev
sudo apt-get install cpanminus

The following command provides 3D graphics support, but can cause an error due to interference with the Linux Nouvea driver for Nvidia. Either skip it, of be aware you might have to come back and uninstall this line as listed below if the problem has not been fixed. (Development fix is beyond the scope of this instruction).

sudo apt-get install libxmu-dev freeglut3-dev libwxgtk-media2.8-dev

If you have an error (i.e. when you try to start Slic3r, the entire system locks and/or crashes and reboots) come back and uninstall this line and reboot

sudo apt-get uninstall libxmu-dev freeglut3-dev libwxgtk-media2.8-dev  

NOTE: I uninstalled the 3D graphics support for Slic3r and am able to work. However, IF SLIC3R IS RUNNING WHEN THEN MACHINE GOES TO STANDBY (when the machine goes to idles from power management or screen saver) SOME GOES WRONG. When the machine wakes up, it shortly craches. Exist Slic3r when finished slicing to avoid this issue.

This is the command that installs Slic3r. It creates a folder in you home directory called Slic3r contaioning the code which we will build.

git clone https://github.com/alexrj/Slic3r.git

At last, we have all bits in place, and we can build slic3r. Be aware that these build command take a longh time even on a fast machine. Its worth the wait, once built, slic3r is very fast.

cd Slic3r
sudo perl Build.PL

sudo perl Build.PL --gui

launch sli3r by clicking on the slic3r.pl perl script.

I found that I needed to reboot after the build. Also, on my system I recieved and error with Wx. However, after reboot Slic3r performed its function, so I am leaving well enough alone.

Reprap Physical machine

The physical machine has specific mechanical and electrical components; we need to configure the firmware to match these.

The electronics is the microcontroler and circuit board (motherboard).

The mechanical is the belts and cogs, the steppers, the thermistors in hot end and print bed, and theextruder drive mechanism.

We must ensure these are set correctly in the firmware for the machine to function properly.

Sanguinololu Electronics

The silkscreen on the board displays Sanguino(lolu) v1.3a. Originally, I felt I wanted Sanguino electronics as the closest thing to a "standard", and purchased this. In fact, I found the anti-static bag it came in, it was from Solidoodle. The board arrived with a bootloader pre-burned, so I have no previous experience or need of any bootloader programmer.

I started at the Sanguinololu page. That page is only googe for HARDWARE, and does not seem to be of much use after the board is constructed. The page lists FUSES (which should not be an issue on a running board) and confirms Sprinter (my previous choice for firmware) is valid for these electronics.

NOTE: originally, the information was associated with the name "Sanguino". However, if we google sanguino, Google sends us to a binoculars place. Notice the next hit display below the binocular red herring is Google Code Sanguino. This will be used later.

Download Sanguino hardware support

I started at the Sanguinololu page. That page is only good for BUILDING the hardware.

The sanguino support that we need to compile the Sprinter firmware is actually found on google code sanguino http://code.google.com/p/sanguino/

It should end up looking like:

 ~/arduino/hardware
 ~/arduino/hardware/arduino
 ~/arduino/hardware/sanguino
 ~/arduino/hardware/tools

Now that the support is in place, the Arduino IDE can know what to do for the Sanguino electronics board. All we have to do is select the sanguino board in the arduino IDE.

  • Open the Arduino IDE and select Tools > Board > Sanguino W/ AMTEGA644P

NOTE on BOOTLOADER: WE should not have to load a bootloader unless 1) the board/chip is brand new or 2) the bootloader was overwritten. If the Arduino IDE cannot upload the Sprinter application to the Sanguino, it might need the bootloader (re)written. The FUSES for ATMEGA644P are defined incorrectly in Sanguino-0101r1. The fuse definition that must be corrected are in the file build.txt. If you need to burn a bootloader you must fix the fuses (see below)

NOTE: If the Arduino IDE was downloaded from the Arduino site, the Arduino IDE code should all be in the current user home directory somewhere (probably under Downloads by default) and we have permission to move and copy files here (GOOD). IF the software was installed from thesoftware center, it will be under /user/share/arduino and will be owned by root (BAD). Install from the software center should be avoided as it causes weird errors, and was not successful for loading firmware to the sanguino.

Reprap firmware application - Download Sprinter source code

From https://github.com/kliment/Sprinter

Run this command in a terminal window:

 git clone https://github.com/kliment/Sprinter.git

The command will create a Sprinter directory in you home directory which contains all the Sprinter firmware code.

Move the Sprinter directory to the sketchbook fold that the Arduino IDE created earlier.

Now when you launch the Arduino IDE, the file menu displays Sprinter under the sketchbook directory. File -> Sketchbook -> Sprinter is the method to access the project for edit and compile.

sprinter instructions are broken for sanguino / sanguinololu

Ignore all the instructions in the SPRINTER readme file. Those are out of date, and will send you in circles for days.

in particular, the sprinter readme file Step 3 says "3. Get the sanguino software, version 0023

  http://sanguino.cc/softwareforlinux".  This has two issues: version 0023 is old, but eh biggest issue is the link points to binocular in Australia, and is of no use to us. 

The sanguino hardware support is actually found on google code sanguino http://code.google.com/p/sanguino/.

modify source code files

For the most part, the changes needed to configure the sprinter source code are made in configuration.h

In my case, I also modify one items in Sprinter.pde (Sprinter.ino) and need to reverse pins in pins.h

modify Sprinter.PDE (Sprinter.ino)

I like to have the printer TELL me if the firmware is correct, and if it has changed. To do this, I add a date/time stamp. To achive this, in Sprinter.pde:

  • locate the VERSION_TEXT definition around line 252
  #define _VERSION_TEXT "1.3.22T / 20.08.2012"
  • comment this line out, but copy the defintion to the beginning of the file
 //   #define _VERSION_TEXT "1.3.22T / 20.08.2012"
  • move and uncomment the definition at the beginning of the file, add a date stamp
  #define _VERSION_TEXT "1.3.22T / 20.08.2012 Braino20150203-1622 esteps693"

Now I will change the date/time each time I make a change to the file, and add single word note like esteps693 to flag what I changed in the file. The printer will display this when connected to pronterface. This is handy to confirm that the new firmwware did in fact upload, and where I left off after my last upload.

modifiy Configuration.h

Modify the following in configuration.h

  • open the Arduino IDE
  • in the file menu select sketchbook > Sprinter
  • The sprinter project opens
  • click the tab for configuration.h

These are the edits I perform:

No SD on this machine:

  // Comment out (using // at the start of the line) to disable SD support:
  // #define SDSUPPORT

Select Sanguino:

  // Sanguinololu 1.2 and above = 62
  // #define MOTHERBOARD 33
  #define MOTHERBOARD 62

OK, this is what I needed to change. Last time I had X and Y step per unit as 57.11, & extruder steps per unit was 700 (calculating by hand). Now the online calculator http://prusaprinters.org/calculator/ says I need 57.265569 and 625.70629055 (and I checked it, and the calculatin looks correct). This is the bit that should fix my print issues. How did I get 57.11 instead of 57.265569? I didn't know what I was doing and/or I changed something with the mods I made. It may have something to do with the "effective diameter of the Hobbed bolt". This means the the 8mm boltdiamter get reduced when we cut the hobs into it. Also when we tighten the idle bearing again the hob, the effective diameter (and/or the effective diameter of the filament) changes. So we have to run some tests from Triffid Hunter's calibration, and adjust there numbers. But more on that later, for now find the file and edit it.

  //// Calibration variables
  // X, Y, Z, E steps per unit - Metric Prusa Mendel with Wade extruder:
  // #define _AXIS_STEP_PER_UNIT {80, 80, 3200/1.25,700}
  #define _AXIS_STEP_PER_UNIT {57.265569, 57.265569, 3200/1.25, 693} 

The final number (693 at this writing) is what is tweaked to tune the extruder steps per unit.

Proper bed travel for this machine:

  //-----------------------------------------------------------------------
  //Max Length for Prusa Mendel, check the ways of your axis and set this Values
  //-----------------------------------------------------------------------
  const int X_MAX_LENGTH = 190 ; // 200;  Only needs to be 190 for very tall (94 mm) objects; 205 for calibrating bed.
  const int Y_MAX_LENGTH = 180; //200;
  const int Z_MAX_LENGTH = 94; // 100

additional modification for my printer - fix reversed X Axis

I think the parts I purchased were reversed in the X-Axis. Everything works great, except in Pronterface, clicking +X sends the extruder to the left. It a little annoying but I could live with it. After finally going back and sorting the firmware out, I figure I may as well fix this now.

This fix has two parts: half is in configuration.h half, is in Pins.h

From http://www.thefrankes.com/wp/?p=2651

in ~/Sprinter/configuration.h:

change const bool INVERT_X_DIR = false; to

// const bool INVERT_X_DIR = false; 
const bool INVERT_X_DIR = true;

change #define X_HOME_DIR -1 to

 // #define X_HOME_DIR -1
 #define X_HOME_DIR 1

NOTICE: there must be exactly one space between DIR and 1 or it won't work

change "const bool min_software_endstops = false; //If true, axis won't move to coordinates less than zero." and "const bool max_software_endstops = true; //If true, axis won't move to coordinates greater than the defined lengths below." to

 //const bool min_software_endstops = false; //If true, axis won't move to coordinates less than zero.
 //const bool max_software_endstops = true; //If true, axis won't move to coordinates greater than the defined lengths below.
 const bool min_software_endstops = true; //If true, axis won't move to coordinates less than zero.
 const bool max_software_endstops = false; //If true, axis won't move to coordinates greater than the defined lengths below.

This is so the X can move to do the home operation.

in ~/Sprinter/pins.h

  • find line 667 #if MOTHERBOARD == 62 (this is the Sanguino section)
  • find

"#define X_MIN_PIN 18" "#define X_MAX_PIN -2"

change this to

 // #define X_MIN_PIN          18
 //#define X_MAX_PIN           -2
 #define X_MIN_PIN          -2
 #define X_MAX_PIN          18

Be aware the the X Axis won't want to move until the HOME button have been clicked


Compile and uploader Sprinter

Now that everything is set up, compile the Sprinter source code we modified and upload it to the printer's Sanguino board.

In the Arduino IDE, use the Verify button to compile the source code. If there are no errors, we can continue with upload.

Ensure the Arduino IDE is connected to /dev/tty/USB0

Click the upload button.

ABOUT THE BOOTLOADER - Loading the Program into the machine

At this point, we compile the source code on the PC, using the Arduino IDE. When the program compiles successfully (zero errors) we can upload the program into the machine's electronics to be permanently available on power up.

We need something to get the program we compiled to the reprep. There are two ways, one using a special peice of hardware call a programmer, or using a peice of software called a bootloader.

Here's the deal: when the machine wakes up, the microcontroler checks if there is a programmer device trying to get ihis attention. If so he says hi, and the programmer can send the program. When no programmer is present, the microcontroller tries to run his program. When his program is a bootloader, the microcontroller asks if the PC has a new program; if so they say hi and arrange to load the new program. The bootloader, once in place, eliminates the further need of the program hardware. However, we need the progrmamer to load the bootloader at least one time. ALSO, it is possible to load the program in such a way that it overwrite the bootload (they are both just programs to the microcontroller). If the bootloader is overwirtten, the firmware cannot be changed without using a programmer again.

Most purchased electronics come with a bootloader already in place. However there are many instructions on the web that tell us to overwrite the bootloader. Unless you are a developer and already have a programmer, overwriting the bootloader renders the machine unchangable (until you buy a programmer, and figure out how to use it, etc; it is not pretty for a non-developer, see below).

If a bootloader is present, the Arduino IDE UPLOAD button will load the program with no errors. If there are errors, turn on the verbose messages, these will say a lot about what the IDE is trying to do. However, they can be misleading. In general, if there are errors on upload, find a programmer, and check the fuses and upload the bootloader.

About the programmer

If you are not a developer, odds are you wish to use the Reprap as an appliance (just printerr stuff rather than redisgn the machine itself). If you are in needs of a programmer, you can get one for free or at least cheap that will work sufficiently without unnecessary expense.

I build a parallel programmer

http://arduino.cc/en/Hacking/ParallelProgrammer?from=Main.ParallelProgrammer

and ordered (at friend recommendation) USBASP from Ebay.

The USBASP is needed as most of my PC's no longer have parallel ports. The USBASP needs abit of work but the instructions are here: http://jimlaurwilliams.org/wordpress/?p=4803

TEST to Verify everything works

Often, at least one thing has been misconfigured, or there was a typo, or an incoorect assumption, or any other mistake. We need to test if everything is ok. In this case, we can test using the PC application used to control the printer.

Use Pronterface to ensure the axis move corectly, and the endstops function. We want to check the hotend heats up and cools down when commanded.

Pronterface will use the same port /dev/ttyUSB0 to talk to the printer. Make sure nothing else (like serial moniotr from the arduino IDE) is connectd to the port.

  • launch pronterface ~/Printrun/pronterface.py
  • select the port to the printer /dev/ttyUSB0
  • set the baud rate 11520 or 230400 or 250000
  • connect to the printer using the connect button. A message should say "connected"
  • turn on the printer's (12 volt) power supply (note the microcontroller is powered by the USB cable, but the stepper motors, extruder, and heated print bed need the external 12 volt supply to operate)

CAUTION! have your finger near the printer power supply OFF switch until you are sure its set up properly! The motor may try to crash into the side o fthe machine if there is a misconfiguration!

  • Move the motors 1 mm in a safe direction using the "1" buttons
  • check that the motors move TOWARD the endstops when intended, and stop when the endstop is triggered.
  • have your hand on the off switch when checking the axis homeing. check that each axis home to the endstop limit switch without crashing.
  • verify the extruder turns when the extrude and revers buttons are pressed.

Put in filament, heat the hot end, and see if molten filament squirts when commanded.

If enverything is ok so far, move on to Calibration; PrusaCalibrationNotesBraino.

NOTES

Additional stuff you might need if the steps above are insufficient.

final issues before sucess

Once the PC, toolchain, support, and source code were in place, there still were issues before success. Check there is you have problems.

Bootloader was overwritten

It turns out the sanguino(lolu) board did not have a bootloader, even though there was Sprinter firmware on the board. The Arduino IDE appeared to be communicating, and the board board appeared to be responding, but did not accept the new firmware. Perhaps there is some test to determine if a bootloader is present? I have not seen any in the instructions.

This message means there is no bootloader:

 avrdude: Device signature = 0x000000
 avrdude: Yikes!  Invalid device signature.
         Double check connections and try again, or use -F to override
         this check.

See PrusaFirmwareBraino#invalid_device_signature_-means-_No_Bootloader

FUSES: X move in one direction, endstops not working

The FUSES are wrong in the Sanguino support. In ~/hardware/sanguino/board.txt we see:

 atmega644.bootloader.low_fuses=0xFF
 atmega644.bootloader.high_fuses=0x9A
 atmega644.bootloader.extended_fuses=0xFF

However, Sanguinololu#Fuse_Settings tells us:

Fuse Settings

The fuses for the atmel chip must be changed from the default factory settings to disable JTAG.

Symptoms of incorrect fuse settings:

   X axis only moves in one direction.
   Endstops do not work. 

644P Fuse Settings

The settings come from the bootloaders boards.txt file.

Example using avrdude and usbtiny.

avrdude -B 8 -patmega644P -c usbtiny -U lfuse:w:0xFF:m -U hfuse:w:0xDC:m -U efuse:w:0xFD:m


Change ~/hardware/sanguino/board.txt to

 //atmega644.bootloader.low_fuses=0xFF
 //atmega644.bootloader.high_fuses=0x9A
 //atmega644.bootloader.extended_fuses=0xFF
 atmega644.bootloader.low_fuses=0xFF
 atmega644.bootloader.high_fuses=0xDC
 atmega644.bootloader.extended_fuses=0xFD

In the Arduino IDE select

ALSO: I don't know if this is crazy or what, but I thought I did this several times. It did not take affect until I hit the reset before burning the bootload (to ensure the board wasn't areleady doing something) and AFTER buring the bootloader (to ensure the changes are committed). Maybe the resets have nothing to do with it, perhaps the parallel programmer is weak it it took many attempts before the fuses actuallty changed. In any case, this is what my notes say worked.

copy sanguino definitions into Arduino install directories - installed from Software center

  • Find the arduino install directory, check the permission with
  cd /usr/share/arduino/; 
  ls -alF
  • Set permission so we can write to the hardware subdirectory, check they changes with:
 sudo chmod -R 777 hardware
  ls -alF
  • Extract the Sanguino [-0101r1] archive (wherever it was downloaded, this is what we will move shortly).
  • Copy the Sanguino directory to the Arduino install directory /hardware subdirectory (using the file browser). It should end up looking like:
 /usr/share/arduino/hardware
 /usr/share/arduino/hardware/arduino
 /usr/share/arduino/hardware/Sanguino
 /usr/share/arduino/hardware/tools
  • start the arduino IDE, there should be a shortcut in the menu popup
  • the first launch will ask to add your user to the dialout group, say yes.
  • check that the sketchbook directory was created in your home directory
  • shutdown and restart the PC (or virtual machine) so the dialout group change takes affect

Add user to DIALOUT group

At first launch, the Arduino IDE will add the current user to the DIALOUT group. This is required, as it allows us to access the USB virtual serial port /dev/ttyUSB0. The USB virtual serial port /dev/ttyUSB0 is the connection from the Arduino IDE to the Sanguino electronics. This will also be the connection to the PRonterface application on the PC, but we'll get to that in a minute.

If for somereason this did not happen automattically, here are the commands to set up the dialout group. In a terminal window, type the following:

  sudo adduser $USER dialout

Shutdown and restart the PC or virtual machine for the dialout group change to take affect.

Pronterface (printrun) also needs the user added to the dialout group to access /dev/ttyUSB0 and connect to the printer

Weird errors

I recieved lots of weird error messages the on several attempts at installing the Arduino IDE, the Sanguino support, and compiling the Sprinter source code. These were caused by several mistakes on my part:

  • I believed the board had a bootloader, since I had previously had configured and loaded Sprinter firmware.
  • I believed the fuses were set correctly since the printer have been operating properly for years.
  • I assumed the fuse setting in the sanguino download were correct.

Compiling the sprinter firmware gave the error message:

/usr/share/arduino/hardware/sanguino/cores/arduino/HardwareSerial.cpp:132:15: error: attempt to use poisoned "SIG_USART1_RECV"
 #elif defined(SIG_USART1_RECV)
               ^

I cannot determine what caused this or what changed to make this go away. Perhaps it was the missing bootloader or the incorrect fuses. I thought it was due to the OS, the Arduino IDE version, or the Sanguino hardware support version. However, the source code now compiles successfully on Mint 16 32 bit and Mint 17 64 bit. The one thing I DO know is that the "fix" we find via a google search does NOT solve the problem, it only changes it into something else. That is:

 ...edit the Arduino.h in /usr/share/arduino/hardware/sanguino/cores/arduino adding...
    #define __AVR_LIBC_DEPRECATED_ENABLE__ 1 
 ...as third line. 

... may make the message go away, but something else goes wrong. and on and on. If things are set up properly, the message is not displayed in the first place.

Bear this in mind when performing troubleshooting.

invalid device signature -means- No Bootloader

For kicks, here is the full compile and verbose upload report that I looked at for a couple days. I assumed this says the the device is working and communicationg properly, the only issue is the signature is not set, and that signals the upload operation to quit. Perhap it would succeded with the -F option? [update: No and No, No, No; and No. The message means there is no bootloader, the device is funstional but the upload is not working becuase there is no bootloader, the bad signature is a manifestation of the bootloader not replying with the correct signature, the upload attempt has already completed and not responded with the correct answer. The -F option does something other than what were would want here.]

Binary sketch size: 37,620 bytes (of a 63,488 byte maximum)
/usr/share/arduino/hardware/tools/avrdude -C/usr/share/arduino/hardware/tools/avrdude.conf -v -v -v -v -patmega644p -cstk500v1 -P/dev/ttyUSB0 -b38400 -D -Uflash:w:/tmp/build7737045225584187139.tmp/Sprinter.cpp.hex:i 
avrdude: Version 6.0.1, compiled on Oct 21 2013 at 15:55:32
        Copyright (c) 2000-2005 Brian Dean, http://www.bdmicro.com/
        Copyright (c) 2007-2009 Joerg Wunsch
        System wide configuration file is "/usr/share/arduino/hardware/tools/avrdude.conf"
        User configuration file is "/home/sanguino/.avrduderc"
        User configuration file does not exist or is not a regular file, skipping
        Using Port                    : /dev/ttyUSB0
        Using Programmer              : stk500v1
        Overriding Baud Rate          : 38400
avrdude: Send: 0 [30]   [20] 
avrdude: Send: 0 [30]   [20] 
avrdude: Send: 0 [30]   [20] 
avrdude: Recv: . [14] 
avrdude: Recv: . [10] 
        AVR Part                      : ATmega644P
        Chip Erase delay              : 55000 us
        PAGEL                         : PD7
        BS2                           : PA0
        RESET disposition             : dedicated
        RETRY pulse                   : SCK
        serial program mode           : yes
        parallel program mode         : yes
        Timeout                       : 200
        StabDelay                     : 100
        CmdexeDelay                   : 25
        SyncLoops                     : 32
        ByteDelay                     : 0
        PollIndex                     : 3
        PollValue                     : 0x53
        Memory Detail                 :
                                 Block Poll               Page                       Polled
          Memory Type Mode Delay Size  Indx Paged  Size   Size #Pages MinW  MaxW   ReadBack
          ----------- ---- ----- ----- ---- ------ ------ ---- ------ ----- ----- ---------
          eeprom        65    10   128    0 no       2048    8      0  9000  9000 0xff 0xff
                                 Block Poll               Page                       Polled
          Memory Type Mode Delay Size  Indx Paged  Size   Size #Pages MinW  MaxW   ReadBack
          ----------- ---- ----- ----- ---- ------ ------ ---- ------ ----- ----- ---------
          flash         33     6   256    0 yes     65536  256    256  4500  4500 0xff 0xff
                                 Block Poll               Page                       Polled
          Memory Type Mode Delay Size  Indx Paged  Size   Size #Pages MinW  MaxW   ReadBack
          ----------- ---- ----- ----- ---- ------ ------ ---- ------ ----- ----- ---------
          lock           0     0     0    0 no          1    0      0  9000  9000 0x00 0x00
                                 Block Poll               Page                       Polled
          Memory Type Mode Delay Size  Indx Paged  Size   Size #Pages MinW  MaxW   ReadBack
          ----------- ---- ----- ----- ---- ------ ------ ---- ------ ----- ----- ---------
          lfuse          0     0     0    0 no          1    0      0  9000  9000 0x00 0x00
                                 Block Poll               Page                       Polled
          Memory Type Mode Delay Size  Indx Paged  Size   Size #Pages MinW  MaxW   ReadBack
          ----------- ---- ----- ----- ---- ------ ------ ---- ------ ----- ----- ---------
          hfuse          0     0     0    0 no          1    0      0  9000  9000 0x00 0x00
                                 Block Poll               Page                       Polled
          Memory Type Mode Delay Size  Indx Paged  Size   Size #Pages MinW  MaxW   ReadBack
          ----------- ---- ----- ----- ---- ------ ------ ---- ------ ----- ----- ---------
          efuse          0     0     0    0 no          1    0      0  9000  9000 0x00 0x00
                                 Block Poll               Page                       Polled
          Memory Type Mode Delay Size  Indx Paged  Size   Size #Pages MinW  MaxW   ReadBack
          ----------- ---- ----- ----- ---- ------ ------ ---- ------ ----- ----- ---------
          signature      0     0     0    0 no          3    0      0     0     0 0x00 0x00
                                 Block Poll               Page                       Polled
          Memory Type Mode Delay Size  Indx Paged  Size   Size #Pages MinW  MaxW   ReadBack
          ----------- ---- ----- ----- ---- ------ ------ ---- ------ ----- ----- ---------
          calibration    0     0     0    0 no          1    0      0     0     0 0x00 0x00
        Programmer Type : STK500
        Description     : Atmel STK500 Version 1.x firmware
avrdude: Send: A [41] . [80]   [20] 
avrdude: Recv: . [14] 
avrdude: Recv: . [02] 
avrdude: Recv: . [10] 
avrdude: Send: A [41] . [81]   [20] 
avrdude: Recv: . [14] 
avrdude: Recv: . [01] 
avrdude: Recv: . [10] 
avrdude: Send: A [41] . [82]   [20] 
avrdude: Recv: . [14] 
avrdude: Recv: . [10] 
avrdude: Recv: . [10] 
avrdude: Send: A [41] . [98]   [20] 
avrdude: Recv: . [14] 
avrdude: Recv: . [03] 
avrdude: Recv: . [10] 
        Hardware Version: 2
        Firmware Version: 1.16
avrdude: Send: A [41] . [84]   [20] 
avrdude: Recv: . [14] 
avrdude: Recv: . [00] 
avrdude: Recv: . [10] 
avrdude: Send: A [41] . [85]   [20] 
avrdude: Recv: . [14] 
avrdude: Recv: . [00] 
avrdude: Recv: . [10] 
avrdude: Send: A [41] . [86]   [20] 
avrdude: Recv: . [14] 
avrdude: Recv: . [00] 
avrdude: Recv: . [10] 
avrdude: Send: A [41] . [87]   [20] 
avrdude: Recv: . [14] 
avrdude: Recv: . [00] 
avrdude: Recv: . [10] 
avrdude: Send: A [41] . [89]   [20] 
avrdude: Recv: . [14] 
avrdude: Recv: . [00] 
avrdude: Recv: . [10] 
        Vtarget         : 0.0 V
        Varef           : 0.0 V
        Oscillator      : Off
        SCK period      : 0.1 us
avrdude: Send: A [41] . [81]   [20] 
avrdude: Recv: . [14] 
avrdude: Recv: . [01] 
avrdude: Recv: . [10] 
avrdude: Send: A [41] . [82]   [20] 
avrdude: Recv: . [14] 
avrdude: Recv: . [10] 
avrdude: Recv: . [10] 
avrdude: Send: B [42] . [82] . [00] . [00] . [01] . [01] . [01] . [01] . [03] . [ff] . [ff] . [ff] . [ff] . [01] . [00] . [08] . [00] . [00] . [01] . [00] . [00]   [20] 
avrdude: Recv: . [14] 
avrdude: Recv: . [10] 
avrdude: Send: E [45] . [05] . [08] . [d7] . [a0] . [00]   [20] 
avrdude: Recv: . [14] 
avrdude: Recv: . [10] 
avrdude: Send: P [50]   [20] 
avrdude: Recv: . [14] 
avrdude: Recv: . [10] 
avrdude: AVR device initialized and ready to accept instructions
Reading | avrdude: Send: V [56] 0 [30] . [00] . [00] . [00]   [20]  
avrdude: Recv: . [14] 
avrdude: Recv: . [00] 
avrdude: Recv: . [10] 
avrdude: Send: V [56] 0 [30] . [00] . [01] . [00]   [20] 
avrdude: Recv: . [14] 
avrdude: Recv: . [00] 
avrdude: Recv: . [10] 
################avrdude: Send: V [56] 0 [30] . [00] . [02] . [00]   [20] 
avrdude: Recv: . [14] 
avrdude: Recv: . [00] 
avrdude: Recv: . [10] 
################################## | 100% 0.02s
avrdude: Device signature = 0x000000 (retrying)
Reading | avrdude: Send: V [56] 0 [30] . [00] . [00] . [00]   [20] 
avrdude: Recv: . [14] 
avrdude: Recv: . [00] 
avrdude: Recv: . [10] 
avrdude: Send: V [56] 0 [30] . [00] . [01] . [00]   [20] 
avrdude: Recv: . [14] 
avrdude: Recv: . [00] 
avrdude: Recv: . [10] 
################avrdude: Send: V [56] 0 [30] . [00] . [02] . [00]   [20] 
avrdude: Recv: . [14] 
avrdude: Recv: . [00] 
avrdude: Recv: . [10] 
################################## | 100% 0.01s
avrdude: Device signature = 0x000000 (retrying)
Reading | avrdude: Send: V [56] 0 [30] . [00] . [00] . [00]   [20] 
avrdude: Recv: . [14] 
avrdude: Recv: . [00] 
avrdude: Recv: . [10] 
avrdude: Send: V [56] 0 [30] . [00] . [01] . [00]   [20] 
avrdude: Recv: . [14] 
avrdude: Recv: . [00] 
avrdude: Recv: . [10] 
################avrdude: Send: V [56] 0 [30] . [00] . [02] . [00]   [20] 
avrdude: Recv: . [14] 
avrdude: Recv: . [00] 
avrdude: Recv: . [10] 
################################## | 100% 0.01s
avrdude: Device signature = 0x000000
avrdude: Yikes!  Invalid device signature.
        Double check connections and try again, or use -F to override
        this check.
avrdude: Send: Q [51]   [20] 
avrdude: Recv: . [14] 
avrdude: Recv: . [10] 
avrdude done.  Thank you.

Again, the above message (from Verbose setting) indicates that while the chip wants 38400 baud, and would talk if it were able, it has no bootloader, and a bootloader must be uploaded to the chip before we can move forward.