HOW TO: Build and upload new firmware

Discussion in 'Hack Talk' started by mildmojo, Feb 21, 2015.

  1. mildmojo

    mildmojo Active Member

    Joined:
    Jan 31, 2015
    Messages:
    327
    Likes Received:
    114
    Here's a quick firmware building/uploading HOWTO.

    Note: As of 2016-Jan-29, Deltaprintr staff indicate all printers are shipped with the latest available firmware. There's no need to upload new firmware to your printer unless you're modifying the source code.
    1. Grab the Arduino 1.0.6 IDE and install it or unzip it somewhere. (Mac users, you'll need to install Apple's Java 6 update.) (The newer version 1.6.0 WILL NOT WORK. This is the #1 most common problem by far. CHECK YOUR VERSION.)
    2. Grab the Teensyduino installer and follow the instructions to install it where you unzipped or installed the Arduino IDE.
    3. Windows: Update your Virtual COM Port (VCP) driver so your PC can talk to the printer. Get it from FTDI's driver page. (There's a Windows setup executable linked in the "Comments" column on the right.)
      Linux: Make sure you get a copy of the udev rules linked at the top right of the Teensyduino page. Follow the instructions in the file to install it so the printer controller shows up as a serial device with the right name and permissions.
      Mac: If you're on OSX 10.9+, you may need to disable Apple's wonky FTDI driver and reinstall the original.
    4. Grab a copy of u8glib. Don't unzip it. I don't know if the version matters, but the Deltaprintr support page links to version 1.13.
    5. Grab a copy of the firmware from the Deltaprintr support page (Kickstarter non-XL firmware mirrored at the unofficial GitHub repo; use the "Download ZIP" button at the top right. XL and website-ordered printers need modified firmware with different max heights.). Unzip it somewhere.
    6. Open up the Arduino IDE. Add the u8glib library using Sketch => Import Library => Add Library. Point it to the u8glib_arduino_v1.13.zip file you downloaded in step 4.
    7. In the Arduino IDE, use File => Open and find the firmware's Marlin.ino file by digging down into the unzipped copy of the firmware until it shows up. That'll open the whole project with all the files.
    8. Go to Tools => Board and pick "Arduino Mega 2560 or Mega ADK".
    9. Go to Tools => Serial Port and make sure the right one's picked. You might have to try a few if there's more than one listed. You may have to connect the USB cable between the PC and printer before the port shows up in the list.
    10. Click the checkmark button or hit Ctrl+R to compile the firmware to make sure it builds without error. If it succeeds, you'll see something like "Binary sketch size: 136,964 bytes (of a 258,048 byte maximum)" in the little black console.
    11. All good? Hook up the USB cable to the printer and upload the new firmware by clicking the little arrow button on the toolbar or pressing Ctrl+U. This may take a couple of minutes; be patient. The progress bar will finish up and the printer will reset. Good to go.
    Notes:
    • When I modified a file outside the Arduino IDE, it wouldn't include my changes in the firmware build—even after recompiling—until I restarted the IDE.
    • If you've edited settings in the firmware (e.g. home height or PID values) but the printer's not respecting them, you may need to load your new firmware settings with the "Restore Failsafe" menu item. This will reset all settings in working memory to firmware defaults. Once loaded, you can use "Save Configuration" to write this config to EEPROM to be loaded at each boot. This will overwrite any customizations you've saved before.
     
    Last edited: Jan 29, 2016
    jeb, Valentin, jangrewe and 4 others like this.
  2. Shai

    Shai Master printer guru Deltaprintr Staff

    Joined:
    Dec 25, 2013
    Messages:
    1,314
    Likes Received:
    289
    Also make sure to switch the jumper from INT to USB on the electronics board!
     
  3. mildmojo

    mildmojo Active Member

    Joined:
    Jan 31, 2015
    Messages:
    327
    Likes Received:
    114
    @Shai, is that just a precaution in case the new firmware goes nuts and tries to drive the 12V devices immediately after reset?

    Firmware updates on INT power seem to work fine, with 12V and USB connected at the same time (as you might for printing). I can't find any directions about not using INT power for firmware updates after lightly scouring the internet. The Reprap Azteeg X3 page, in particular, makes no note about requiring USB-only power for firmware updates. I'm sure firmware uploads will work on USB power, but flipping the machine over or dismounting newer models' controller boards for every firmware modification would be painful. :)
     
    Last edited: Feb 21, 2015
  4. WillyB

    WillyB New Member

    Joined:
    Feb 1, 2015
    Messages:
    13
    Likes Received:
    6
    Mildmojo: You are a great person for posting this how to guide right at the time I needed it. I was about to tepidly delve into trying to work this procedure out today on my own to fix a problem that has been vexing me for weeks now, when I found your guide while looking for another post. I can't estimate how many hours you just saved me today, and now I have the confidence to try other mods on my own.

    Thanks again. My problem now appears to be solved for good. You are a true warrior poet...
     
    Shai and mildmojo like this.
  5. AcBCDN

    AcBCDN Member

    Joined:
    Feb 14, 2014
    Messages:
    57
    Likes Received:
    11
    Works much better. Thanks.
     
  6. Shai

    Shai Master printer guru Deltaprintr Staff

    Joined:
    Dec 25, 2013
    Messages:
    1,314
    Likes Received:
    289
    @mildmojo Does choosing Mega ADK work? We use Mega 2560. Never tried the other, just want to confirm.
     
  7. Daniel Wilkerson

    Daniel Wilkerson New Member

    Joined:
    Feb 1, 2015
    Messages:
    9
    Likes Received:
    2
    @Shai I'm using Arduino 1.0.6 ... it has both boards as a single option. See attached
     

    Attached Files:

    mildmojo likes this.
  8. Ryan-3D

    Ryan-3D Active Member

    Joined:
    Feb 5, 2015
    Messages:
    142
    Likes Received:
    32
    Great tutorial. I followed it exactly and was able to upload my modified firmware with no issues. As MILDMOJO mentioned, I did not bother to change the jumper on the board to USB, and it still seemed to work just fine.
     
  9. Shai

    Shai Master printer guru Deltaprintr Staff

    Joined:
    Dec 25, 2013
    Messages:
    1,314
    Likes Received:
    289
    @Daniel Wilkerson Oh, yes.. that is correct! Forgot that they are on the same line. Never mind!
     
  10. jangrewe

    jangrewe Member

    Joined:
    Mar 11, 2014
    Messages:
    54
    Likes Received:
    10
    I just found the time to set things up, thanks for your instructions - works flawless.

    Now, on to break things, shall we? ;-)
     
  11. Jake

    Jake New Member

    Joined:
    Feb 28, 2014
    Messages:
    19
    Likes Received:
    5
    Shai is there any support for boards that are not connecting to the computer via USB? I've seen a couple others having similar problems as me, any thoughts I'd like to do the firmware but cant with out being able to connect via USB.
    Thanks
     
  12. Shai

    Shai Master printer guru Deltaprintr Staff

    Joined:
    Dec 25, 2013
    Messages:
    1,314
    Likes Received:
    289
    Jake, every board is able to connect to upload firmware. It just may have issues connecting to the software to control the printer. Two different things.

    How else would we be able to upload the firmware? ;)
     
  13. Jake

    Jake New Member

    Joined:
    Feb 28, 2014
    Messages:
    19
    Likes Received:
    5
    Very true Shai, I'm still having trouble maybe i should try a Mac. I'm a bit out my league lol.
     
  14. dr_dre

    dr_dre Member

    Joined:
    Mar 11, 2014
    Messages:
    43
    Likes Received:
    10
    I just recompiled the Deltaprintr firmware with Arduino 1.6.
    it scaled down another 6 Kb in size . :):)

    Ive noticed one improvement for now :)

    thats when you press connect it seems to respond better in Repetier ( 64B windows) and gives the green connect button. Not always but more frequently now.

    So you can manually control the printer. ( instead of pushing the hardware reset button on the left side of the lcd display)


    To make it work i had to do a few adjustments.

    I used the latest Teensy beta build for arduino 1.6 at :
    https://forum.pjrc.com/threads/2774...ns-to-support-it?p=66967&viewfull=1#post66967

    And i had to install (add library) the "Time" Library from :

    http://www.pjrc.com/teensy/td_libs_Time.html

    I added
    #include <Time.h>
    in Marlin.h at line 38 ( just below the #include "pins.h")

    Im still trying to get rid of ALL the small pocks ( high cpu usage that causes this) at the moment the Main display trick is working aswell with arduino 1.6 compile.

    Hoping to find more improvements in the near future :)
     
  15. jangrewe

    jangrewe Member

    Joined:
    Mar 11, 2014
    Messages:
    54
    Likes Received:
    10
    Thanks for keeping up with this, I was a bit unhappy to downgrade to 1.0.6 again, but I also didn't want to try the Teensy betas, as their users kept reporting issues.

    Let's hope they create a stable release soon, so we can update the Github repo with your change and recommend using the latest Arduino then.
     
  16. Valentin

    Valentin Active Member

    Joined:
    Apr 28, 2014
    Messages:
    172
    Likes Received:
    34
    One thing I want to ask, for the teensyduino, what packages do you need to install? I installed all of them, but just to make sure. Thanks for the tutorial.
     
  17. mildmojo

    mildmojo Active Member

    Joined:
    Jan 31, 2015
    Messages:
    327
    Likes Received:
    114
    I'm not sure which ones are strictly necessary, but it doesn't hurt anything to have them all installed. They're small. :)
     
  18. Ben Navo

    Ben Navo New Member

    Joined:
    Mar 11, 2014
    Messages:
    8
    Likes Received:
    0
    I don't want to sound like an idiot, because these instructions are easy to follow. However, I cannot seem to find the Marlin.ino file?
     
  19. Ryan-3D

    Ryan-3D Active Member

    Joined:
    Feb 5, 2015
    Messages:
    142
    Likes Received:
    32
    You'll find it in this folder after you unzip the firmware...
    ...\Kickstarter RG Marlin\Kickstarter RG Marlin\wingtangwong-deltaprintr-marlin-fsr-e4739163329a\Marlin\
     
    Ben Navo likes this.
  20. gilligone

    gilligone Member

    Joined:
    Mar 12, 2014
    Messages:
    38
    Likes Received:
    3
    Ok I'm having trouble here... everything went kosher up until picking the serial port. I plugged my printer into my macbook pro and have only 4 options in the serial ports. I've tried uploading on all four options and only gotten timedout..
     
Loading...

Share This Page