Jump to content
Ultimaker Community of 3D Printing Experts

Tinker firmware - introduction


Recommended Posts

Posted · Tinker firmware - introduction
5 hours ago, gr5 said:

I'm not sure where you need steps/sec though.  I'm not sure if that's what you need.

 

@killerb77 gr5 is right, that's the calculation i talked about.

 

@gr5

I changed the speed constants for the material load/unload wizard from mm/s to steps/sec a while ago.

The actual speed depends on the steps/mm setting now. The idea is to ensure, that the wizard can be used with different motors/feeders/steps

without the need to recompile the firmware with different speed constants.

 

For example:

* the UM2 firmware uses 282 steps/mm and 100 mm/s  (= 28200 steps/s)

* the UM2+ uses 369 steps/mm and 80 mm/s (= 29520 steps/s)

 

I've chosen a value of 26500 steps/sec. That's a value that should be easily achievable with the given combination of Arduino and stepper driver.

I don't know why it's necessary to reduce it to such a low value for the bondtech feeder.

 

A similar thing is done with the acceleration.

In short: it's exclusively used for the material change wizard (which you probably don't use anymore, right?) :sunglass:

  • Link to post
    Share on other sites
    • Replies 161
    • Created
    • Last Reply

    Top Posters In This Topic

    Top Posters In This Topic

    Popular Posts

    I was asked to sum up some facts about the alternative "tinker" firmware. Here are the basics and the main links to start with it:   What is the "Tinker-Firmware"? It's an alternative firmware for

    I would like to say thank you for your reply and helping me in my problem

    I'd get a uninterruptable power supply.   So you will need 2 of the features that come with tinkerMarlin.  I mentioned above - you can set the Z position of the print head exactly.  In this

    Posted Images

    Posted · Tinker firmware - introduction
    5 hours ago, tinkergnome said:

    The idea is to ensure, that the wizard can be used with different motors/feeders/steps

    without the need to recompile the firmware with different speed constants.

    Ah.  Smart.

    5 hours ago, tinkergnome said:

    In short: it's exclusively used for the material change wizard (which you probably don't use anymore, right?)

    True.  Very true.  Actually I use it for my um2go - I use the "insert material" one.  For removing I just pull it out.  My um2go still has the black feeder but I'm planning to switch to Meduza some day.  No rush.  Once I switch my use of the "change wizard" will drop to zero.

  • Link to post
    Share on other sites
    Posted (edited) · Tinker firmware - introduction

    Flashed Tinker V17.10.1 on my UM2+ and noticed when its doing lots of retractions and fast travel moves the screen starts going a little funny like all the text jumps to the left and back, also noticed the LED lighting flickers for a couple seconds every now and then.

     

    EDIT: I wounder if this is related to this?

     

     

    Is this normal?

     

    Also can't run the auto pid tune I get failed temps to high.

     

    EDIT:

    I managed to get it to work by turning on the part cooling fan and cupping my hand to direct the air to the hot end for the first cyclical and got very different numbers from stock and using them number over stock lead to the print head not been able to stay on 210c it mostly stayed around the 206c

     

    Stock: p 10.00 i 2.50 d 100.00  Auto PID: p 8.82 i 0.67 d 29.19

     

    Is this because I had to direct air flow for 0/5 to 1/5? 

    Edited by ChrisRiddell
  • Link to post
    Share on other sites
    Posted · Tinker firmware - introduction
    7 hours ago, ChrisRiddell said:

    noticed the LED lighting flickers for a couple seconds every now and then.

     

    Do you use the PID mode for the build plate? I heard that this generates a lot more electrical 'noise' than the 'bang-bang' mode and i wonder, if the flickering is related to this?

    If so, can you switch the PID mode off and check, if it makes a difference?

     

    In addition: during dual prints the power supply is working at it limits, perhaps there's a small voltage drop now and then that can cause the display jittering?

    Another test: try to reduce the value for the 'Total budget' in Preferences -> Power budget and check if it makes a difference.

     

    7 hours ago, ChrisRiddell said:

    can't run the auto pid tune

     

     

    I think the PID auto tuning is pretty useless in it's current implementation. It doesn't matter if you start it on the printer or via a serial console. Perhaps you'll get better results if you preheat the nozzle to a temperature near the target temperature before you start the auto-tuning.

     

    The defaults have changed for the UM2+ (35W) heaters:  p 12.00 i 0.75 d 55.00

    I would start with these and tune it manually, if necessary.

     

     

  • Link to post
    Share on other sites
    Posted · Tinker firmware - introduction
    2 minutes ago, tinkergnome said:

    Do you use the PID mode for the build plate? I heard that this generates a lot more electrical 'noise' than the 'bang-bang' mode and i wonder, if the flickering is related to this?

    If so, can you switch the PID mode off and check, if it makes a difference?

     

    I'm not sure what mode the bed is on I'll check after this 5 hour print but its stock what ever its set too once flashing and doing the factory reset.

     

    4 minutes ago, tinkergnome said:

    In addition: during dual prints the power supply is working at it limits, perhaps there's a small voltage drop now and then that can cause the display jittering?

    Another test: try to reduce the value for the 'Total budget' in Preferences -> Power budget and check if it makes a difference.

    What do you mean dual prints? My printer is not running the mark2 mod, I'll check the Total budget thing out.

  • Link to post
    Share on other sites
    Posted · Tinker firmware - introduction
    2 hours ago, ChrisRiddell said:

    My printer is not running the mark2 mod

     

    mea culpa, wrong topic...

    But you can experiment with both settings anyway and check what happens.

  • Link to post
    Share on other sites
    Posted · Tinker firmware - introduction
    11 hours ago, tinkergnome said:

    But you can experiment with both settings anyway and check what happens.

     

    Okay the bed was already set to No PID ("bang-bang"), Played with the power budget total seen no real change. the screen text still jumps even while not printing if you are going through the menu's its very random and happens more often while printing.

     

    If its not something to worry about and will not harm the printer I'll set the LED and Screen timeouts so i don't see it.

  • Link to post
    Share on other sites
    Posted · Tinker firmware - introduction

    Ran into a weird issue after doing a couple prints using the change filament the homing of the head fails it hits the end stops then goes crazy like it did not hit the end stops.

     

    worked after powering off and on but does it again after doing alot of prints then trying to change the filament.

  • Link to post
    Share on other sites
    Posted · Tinker firmware - introduction
    11 hours ago, ChrisRiddell said:

    Ran into a weird issue after doing a couple prints using the change filament the homing of the head fails it hits the end stops then goes crazy like it did not hit the end stops.

     

    worked after powering off and on but does it again after doing alot of prints then trying to change the filament.

    The same thing happened to me once with TW. Luckily, I was nearby and could stop it.

  • Link to post
    Share on other sites
    Posted · Tinker firmware - introduction
    14 hours ago, ChrisRiddell said:

    he head fails it hits the end stops then goes crazy like it did not hit the end stops.

    I'm sure it did not trigger one of the end stops.  It makes this crazy loud noise like your printer will self destruct - but then it's fine, right?  You probably need to move one of your end stop limit switches a tiny bit.  You can either bend the metal tab on the switch or you can loosen the 2 screws holding it and slide it closer to where it will trigger sooner.  First figure out if it's X or Y.  Push the head around and listen for where the two switches "click".  One of them probably needs more force than the other - that's the problem axis.  If it's the X axis also check to see if your fan shroud is maybe bent and hitting the left wall of the printer - if so just bend the fan shroud back.

  • Link to post
    Share on other sites
    Posted · Tinker firmware - introduction

    Hi,

    Same problem here since i installed Tinker Firmware.

     

    Another recurrent problem is a big retraction after finishing a print. I have to move filament 50-100 mm and extrude a little amount of it in order to start next print.

  • Link to post
    Share on other sites
    Posted (edited) · Tinker firmware - introduction

     

    On 15.2.2018 at 1:35 AM, ChrisRiddell said:

    Ran into a weird issue after doing a couple prints using the change filament the homing of the head fails it hits the end stops then goes crazy like it did not hit the end stops.

    worked after powering off and on but does it again after doing alot of prints then trying to change the filament.

     

    and exactly the same happened to me as well. (UM2+) Repeatedly, end stop works for everything else except change filament. I could alternate between home head and change filament, home works, change filament ignored the end stop (i hear it click). Power off/on fixed it. While the problem occured, i had a garbled Y position showing in Move Axis screen display
     

    20180216_075306671_iOS.thumb.jpg.b8e8589f5a82cf86c6af2dbceac452e8.jpg

    Edited by StephanK
  • Link to post
    Share on other sites
    Posted · Tinker firmware - introduction

    Done more testing and @StephanK is right every other homing works but change filament ignores the end stops unless filament change is the first thing you do once you turn on.

  • Link to post
    Share on other sites
    Posted · Tinker firmware - introduction

    What should the 'Gcode flavor' setting be set to in Cura for a Ultimaker 2+ with this firmware?

    Thanks

  • Link to post
    Share on other sites
    Posted · Tinker firmware - introduction

    It still supports both “Ultimaker 2” (ultigcode) and “Marlin”, as before. Marlin will give you full control over temperatures in Cura.

  • Link to post
    Share on other sites
    Posted · Tinker firmware - introduction
    5 hours ago, ahoeben said:

    It still supports both “Ultimaker 2” (ultigcode) and “Marlin”, as before. Marlin will give you full control over temperatures in Cura.

    And ultigcode (the default) gives you full control of temperatures on the printer itself.

  • Link to post
    Share on other sites
    Posted · Tinker firmware - introduction

    @StephanK - many people don't use change filament.  I doubt Tinker uses it.  So there could be a bug that slipped by.  Or maybe this is a known bug that was fixed but this is very interesting to me because it could be related to a rarer bug.  What version of tinker software did you use exactly (which printer type/variation).  What does it show for the version on your display.

     

    Can you get it to repeat?  If you start from powering on the first time, what would be the procedure for me to get this issue you see on the display and the weird homing behavior?  I have um2go, um2, um2ext so I can try to repeat your test with the exact same printer type and the same firmware.

     

     

  • Link to post
    Share on other sites
    Posted · Tinker firmware - introduction

    @gr5

    This is a long story. First of all. I am using an UltiMaker 2+, fitted with a Bontech DDG (the one that looks like the original UM2+ feeder just black). It is connected via USB to a RasPi3 running Repetier Server. I control all my prints that way. This setup has been working absolutely flawless for the ~2 years i had the UM2+ now. Not a single problem. The printer is running or on standby 24x7 x364. 

    My troubles started after i flashed current tinker 17.10.01 in order to get the Bondtech working (changed E-Steps and motor direction). After that i noticed that occasionally after the end of successful a print, starting the next subsequent print, my printer would print in mid air. Looking at the Z position in the display, it seemed as if the printer thought total z axis had shrunk by said roughly 1cm (it varies a bit). So it somehow lost track of the Z-axis and came in about a cm sort. I tried in vain to get this bug to reproduce, for days, i was sitting there smartphone in hand recording the start of each trying to catch it on film, as the display shows it right then there if it is going to fail. I gave up after a few days, couple of days later is when it struck again :-) TinkerGnome had asked me (here - original post in German)  to keep an eye on Z-offset via terminal, but never saw anything unusual and of course, the problem never happened while i monitored it.

    The reason why i mention all this is because i think they're ralated. In both cases it feels like the "printer" loses track of the proper position. 

    I cannot for the life of me git it to repeat reliably. The z-axis problem happened 3-4 times within a couple of weeks, hasn't happened since. Instead, now i get this homing bug with the garbled position for Y started occuring. Again no clear pattern. It does not happen after a power on/power off cycle, it does happen occasionally after the end of a successful print

     

     

    Start Code:
     

    G28 ; home all axes
    G1 X5 Y10 F3000 ; bring extruder to front
    G92 E0 ; zero the extruded length
    G1 Z10 ; lower
    G1 E19 F200 ; purge nozzle quickly
    G1 E26 F60 ; purge nozzle slowly
    G92 E0 ; zero the extruded length again
    G1 E-5.5 F400 ; retract
    G1 X190 Z0 F9000 ; pull away filament
    G1 X210 F9000 ; wipe
    G1 Y20 F9000 ; wipe
    G1 E0 ; feed filament back



    End code: 

    G28 X0 ; home the X-axis
    M104 S0 ; turn off heaters
    M140 S0 ; turn off bed
    M106 S0; turn off fan
    M84 ; disable motors

    No other scripts are active. 
    Atm, the printer works fine.

    Version readout attached.

    I'd be most happy to run some tests if there's anything you can think of that might help :-)

     

    20180304_125121247_iOS.jpg

  • Link to post
    Share on other sites
    Posted · Tinker firmware - introduction
    26 minutes ago, StephanK said:

    It does not happen after a power on/power off cycle, it does happen occasionally after the end of a successful print

    Damn!  I suspect this will never get resolved.  So as far as I can tell from a dozen or so reports, tinker 16.01 is fine but newer versions have some subtle bug that corrupts memory occasionally.  It's very sublte and the right things all have to happen at the same time.  Once memory is corrupted anything can happen.  Power cycling fixes it.  I was hoping you had a procedure that could somewhat reliably create the problem within 5 minutes.  But instead one has to print for probably 10 hours and even then it's not reliable.

     

    So I have only two things for you to try:

    When you switched to tinker did you do a "factory reset"?  If not I recommend it.  There are a few dozen parameters that are stored in eeprom such as steps/mm and width of platform.  These values are stored in a different place in each version of Marlin so not doing a factory reset can cause some suble issues.

     

    Please turn off geek mode while printing.  See if that seems to fix it.  It seems to have solved the issue for one person (maybe I think).

     

    Now realize you don't need tinker firmware to use the DDG.  There are other ways to set steps/mm.  For example you can set steps/mm with a single gcode and then save that with another.  So you can install normal Marlin if you want.  But it has to be a version of Marlin that rotates the extruder in the right direction at least which I think the UM2+ firmware does.

    • Like 1
    Link to post
    Share on other sites
    Posted · Tinker firmware - introduction

    Yeah, did factory resets a few time meanwhile. 

    I'll turn geek mode off and see if it happens again.. But i gotta say, despite the glitch, i do not really want to miss Tinker anymore. 

    I'll keep an eye out and will report back with any new findings. Oh, another tidbit: my leds are flickering noticeable while both heaters are heating. Power flucuations <> memory corruption, is there a possible connection there?

    One thing i did notice with the change filament feature is this: If you wait too long to confirm that the new filament is now properly coming out of the nozzle, it will eventually start the change filament procedure from step one, If you misclick now it'll happily try fast advancing the filament. Which at this point is already right there at the nozzle.. It's not pretty when that happens ;-)
     

  • Link to post
    Share on other sites
    Posted (edited) · Tinker firmware - introduction

    I'm having a terrible time compiling this firmware. For a sanity check I compiled the https://github.com/Ultimaker/Ultimaker2Marlin with no issues. It keeps complaining about the 

    clearWriteError 

    not being found. Which is defined in 

    C:\Users\dddd\Downloads\Ultimaker2Marlin-17.10\Ultimaker2Marlin-17.10\ArduinoAddons\Arduino_1.x.x\sanguino\cores\arduino

    I followed the directions, place the whole sanguino directory in the arduino/hardware folder. I've tried both 1.00 and 0.xx. I've tried copying the cores/arduino into arduino/hardware/arduino. I've been trying to fix this for 5 hours so I've tried about every combo I could think of.
    I'm at this point not sure what I am doing wrong. I've gone as far as to copy these and add them manually to the C code. Even that didn't work...

     

    That said, what is the difference between Ultimaker2Marlin if I cannot get tinker gnome working...

     

    Side note, yes I need to compile my own. I need to set the config.h for custom settings for my bondtech And volcano e3d v6 on a UM2 extended.

     

     

    Full stack trace 

     


    cardreader.cpp: In member function 'void CardReader::write_command(char*)':
    cardreader.cpp:393: error: 'class SdFile' has no member named 'clearWriteError'
    cardreader.cpp:403: error: 'class SdFile' has no member named 'getWriteError'
    cardreader.cpp: In member function 'bool CardReader::write_string(char*)':
    cardreader.cpp:413: error: 'class SdFile' has no member named 'getWriteError'

     

    I've tried off t he current branch "geek_mode" as well as on the last 2 releases. 

     

    Side thought.... The arduino program is self contained in its directory. It is also open source... It could be put on Github completely configured and ready to go...  That would save people a lot of time. 

    Edited by Starwind0
  • Link to post
    Share on other sites
    Posted · Tinker firmware - introduction

    How do you compile it? Here is a great description from @gr5 - in case you missed it.

     

    The "ArduinoAddons" folder is not needed for the Ultimaker firmware, i think it is a relict from the originally Marlin.

     

    1 hour ago, Starwind0 said:

    I followed the directions, place the whole sanguino directory in the arduino/hardware folder.

     

    Which directions? Where does those come from? That sounds odd... whatever you have done - i would revert this step.

    AFAIK "sanguino" is a hardware variant that has nothing to do with the Ultimaker mainboard.

    "SdFile" inherits from "Print" ("Print.h"), which resides in a subfolder of the Arduino compiler installation (.../hardware/arduino/avr/cores/arduino)

     

    BTW: which compiler version do you use? I use 1.8.1 at the moment, this works like it is described in the link from above.

  • Link to post
    Share on other sites
    Posted · Tinker firmware - introduction

    Hey Okay I'll try that out. Thanks!

    I was following what was in the github readme on 
    https://github.com/TinkerGnome/Ultimaker2Marlin

    Quote

    Configuring and compilation:

    Install the arduino software IDE/toolset v23 (Some configurations also work with 1.x.x)http://www.arduino.cc/en/Main/Software

    For gen6/gen7 and sanguinololu the Sanguino directory in the Marlin dir needs to be copied to the arduino environment. copy ArduinoAddons\Arduino_x.x.x\sanguino \hardware\Sanguino

    Copy the Marlin firmware https://github.com/ErikZalm/Marlin/tree/Marlin_v1 (Use the download button)

    Start the arduino IDE. Select Tools -> Board -> Arduino Mega 2560 or your microcontroller Select the correct serial port in Tools ->Serial Port Open Marlin.pde

    Click the Verify/Compile button

    Click the Upload button If all goes well the firmware is uploading

    That's ok. Enjoy Silky Smooth Printing.

     

     

    Which I was wondering how it was going to output the correct type given the instructions were clearly a mega 2560 instruction. I was suing the ancient version 23 of the arduino software, per the readme. 

    Note I do have a Mac as well as a PC, so I think I can do this with less hoops. 

  • Link to post
    Share on other sites
    Posted · Tinker firmware - introduction

    Okay some progress...
    I was really fighting the system. The main root of the fight tonight is the differences between a Windows Installation and a Mac one. I spent most of the day trying to get v23 libraries to work, not understanding that they were really for lack of a better term, the SDK for arduino, and that I was trying to mix v185 and v23 source code. I spent most of the night rooting though the make file trying to figure out where it was trying to map things to and from and understanding it's structure.

    I downloaded the git version of Arduino (link). Looking though its file structure I had an ah hah moment where i recognized the paths from the make file sources. So pointed the package.sh to the root of this directory. That fixed the vast majority of the issues alone.

    To setup the avr-GCC I had to manually edit the Make file to hardcode the path (could be put in package.sh, but this was faster)

     

    Now... this is where I am getting a little lost. It's been a long time since I've done any CPP work. 

     

    avr-gcc: error: Marlin.map: No such file or directory

     

    is the main error we are getting. It is true, I am not seeing this file. How to say this without confusing. When I was hacking around and adding the dependencies manually I still failed to generate a compiled firmware. However the output directory did have this file. Again I am not saying I can generate it with the current solution above, nor that it was a success, I am just pointing out that the build tools GCC seem to be working. ( I also tested avr-gcc by doing their led.c example).

     

    So now I'm not sure what I am missing. Lets recap.

     

    I downloaded 17.10.1 of tinker gnome. 

    I have set up Avr-gcc from http://maxembedded.com/2015/06/setting-up-avr-gcc-toolchain-on-linux-and-mac-os-x/ (note issues running brew install avr-libc -- may have ran twice)

    I have downloaded the latest Arduino 1.8.5 source code. (link above)

    I have set the package.sh to point to the arduino 1.8.5 sources

    I have made the make file point to my AVG-gcc tool (AVR_TOOLS_PATH ?= /usr/local/CrossPack-AVR/bin/)

    I have tested AVG... Though no one told me to use that specific tool.

    I have made sure there are no spaces in my directory paths.

    I installed SDL but couldn't figure out why we needed it.  Did a brew install so it was auto configured for me. 

     

    ddd-MacBook-Pro-2:Marlin ddd$ ./package.sh 
    
      RM    _Ultimaker2/*
    
      RMDIR _Ultimaker2/
    
      CC    /Users/ddd/Downloads/Arduino-1.8.5/hardware/arduino/avr/cores/arduino/hooks.c
    
      CC    /Users/ddd/Downloads/Arduino-1.8.5/hardware/arduino/avr/cores/arduino/wiring.c
    
      CC    /Users/ddd/Downloads/Arduino-1.8.5/hardware/arduino/avr/cores/arduino/wiring_analog.c
    
      CC    /Users/ddd/Downloads/Arduino-1.8.5/hardware/arduino/avr/cores/arduino/wiring_digital.c
    
      CC    /Users/ddd/Downloads/Arduino-1.8.5/hardware/arduino/avr/cores/arduino/wiring_pulse.c
    
      CC    /Users/ddd/Downloads/Arduino-1.8.5/hardware/arduino/avr/cores/arduino/wiring_shift.c
    
      CC    /Users/ddd/Downloads/Arduino-1.8.5/hardware/arduino/avr/cores/arduino/WInterrupts.c
    
      CXX   UltiLCD2.cpp
    
      CXX   UltiLCD2_gfx.cpp
    
      CXX   UltiLCD2_hi_lib.cpp
    
      CXX   UltiLCD2_low_lib.cpp
    
      CXX   UltiLCD2_menu_first_run.cpp
    
      CXX   UltiLCD2_menu_maintenance.cpp
    
      CXX   UltiLCD2_menu_material.cpp
    
      CXX   UltiLCD2_menu_print.cpp
    
      CXX   lifetime_stats.cpp
    
      CXX   UltiLCD2_menu_main.cpp
    
      CXX   powerbudget.cpp
    
      CXX   UltiLCD2_menu_utils.cpp
    
      CXX   UltiLCD2_menu_prefs.cpp
    
      CXX   tinkergnome.cpp
    
      CXX   machinesettings.cpp
    
      CXX   filament_sensor.cpp
    
      CXX   /Users/ddd/Downloads/Arduino-1.8.5/hardware/arduino/avr/cores/arduino/new.cpp
    
      CXX   /Users/ddd/Downloads/Arduino-1.8.5/hardware/arduino/avr/cores/arduino/WMath.cpp
    
      CXX   /Users/ddd/Downloads/Arduino-1.8.5/hardware/arduino/avr/cores/arduino/WString.cpp
    
      CXX   /Users/ddd/Downloads/Arduino-1.8.5/hardware/arduino/avr/cores/arduino/Print.cpp
    
      CXX   Marlin_main.cpp
    
      CXX   MarlinSerial.cpp
    
      CXX   Sd2Card.cpp
    
      CXX   SdBaseFile.cpp
    
      CXX   SdFile.cpp
    
      CXX   SdVolume.cpp
    
      CXX   motion_control.cpp
    
      CXX   planner.cpp
    
      CXX   stepper.cpp
    
      CXX   temperature.cpp
    
      CXX   cardreader.cpp
    
      CXX   ConfigurationStore.cpp
    
      CXX   watchdog.cpp
    
      CXX   electronics_test.cpp
    
      CXX   /Users/ddd/Downloads/Arduino-1.8.5/hardware/arduino/avr/cores/arduino/main.cpp
    
      CXX   Marlin.elf
    
      CXX   _Ultimaker2/Ultimaker2Marlin-17.10.1
    
    avr-gcc: error: Marlin.map: No such file or directory
    
    make: *** [Marlin.elf] Error 1
    
    make: *** Waiting for unfinished jobs....
    
    avr-gcc: error: Marlin.map: No such file or directory
    
    make: *** [_Ultimaker2/Ultimaker2Marlin-17.10.1] Error 1
    
    cp: _Ultimaker2/Marlin.hex: No such file or directory
    
      RM    _Ultimaker2Dual/*
    
      RMDIR _Ultimaker2Dual/
    
      CC    /Users/ddd/Downloads/Arduino-1.8.5/hardware/arduino/avr/cores/arduino/wiring.c
    
      CC    /Users/ddd/Downloads/Arduino-1.8.5/hardware/arduino/avr/cores/arduino/hooks.c
    
      CC    /Users/ddd/Downloads/Arduino-1.8.5/hardware/arduino/avr/cores/arduino/wiring_analog.c
    
      CC    /Users/ddd/Downloads/Arduino-1.8.5/hardware/arduino/avr/cores/arduino/wiring_digital.c
    
      CC    /Users/ddd/Downloads/Arduino-1.8.5/hardware/arduino/avr/cores/arduino/wiring_pulse.c
    
      CC    /Users/ddd/Downloads/Arduino-1.8.5/hardware/arduino/avr/cores/arduino/wiring_shift.c
    
      CC    /Users/ddd/Downloads/Arduino-1.8.5/hardware/arduino/avr/cores/arduino/WInterrupts.c
    
      CXX   UltiLCD2.cpp
    
      CXX   UltiLCD2_gfx.cpp
    
      CXX   UltiLCD2_hi_lib.cpp
    
      CXX   UltiLCD2_low_lib.cpp
    
      CXX   UltiLCD2_menu_first_run.cpp
    
      CXX   UltiLCD2_menu_maintenance.cpp
    
      CXX   UltiLCD2_menu_material.cpp
    
      CXX   UltiLCD2_menu_print.cpp
    
      CXX   lifetime_stats.cpp
    
      CXX   UltiLCD2_menu_main.cpp
    
      CXX   powerbudget.cpp
    
      CXX   UltiLCD2_menu_utils.cpp
    
      CXX   UltiLCD2_menu_prefs.cpp
    
      CXX   tinkergnome.cpp
    
      CXX   machinesettings.cpp
    
      CXX   filament_sensor.cpp
    
      CXX   /Users/ddd/Downloads/Arduino-1.8.5/hardware/arduino/avr/cores/arduino/new.cpp
    
      CXX   /Users/ddd/Downloads/Arduino-1.8.5/hardware/arduino/avr/cores/arduino/WMath.cpp
    
      CXX   /Users/ddd/Downloads/Arduino-1.8.5/hardware/arduino/avr/cores/arduino/WString.cpp
    
      CXX   /Users/ddd/Downloads/Arduino-1.8.5/hardware/arduino/avr/cores/arduino/Print.cpp
    
      CXX   Marlin_main.cpp
    
      CXX   MarlinSerial.cpp
    
      CXX   Sd2Card.cpp
    
      CXX   SdBaseFile.cpp
    
      CXX   SdFile.cpp
    
      CXX   SdVolume.cpp
    
      CXX   motion_control.cpp
    
      CXX   planner.cpp
    
      CXX   stepper.cpp
    
      CXX   temperature.cpp
    
      CXX   cardreader.cpp
    
      CXX   ConfigurationStore.cpp
    
      CXX   watchdog.cpp
    
      CXX   electronics_test.cpp
    
      CXX   /Users/ddd/Downloads/Arduino-1.8.5/hardware/arduino/avr/cores/arduino/main.cpp
    
      CXX   Marlin.elf
    
      CXX   _Ultimaker2Dual/Ultimaker2Marlin-17.10.1
    
    avr-gcc: error: Marlin.map: No such file or directory
    
    make: *** [Marlin.elf] Error 1
    
    make: *** Waiting for unfinished jobs....
    
    avr-gcc: error: Marlin.map: No such file or directory
    
    make: *** [_Ultimaker2Dual/Ultimaker2Marlin-17.10.1] Error 1
    
    cp: _Ultimaker2Dual/Marlin.hex: No such file or directory
    
      RM    _Ultimaker2plus/*
    
      RMDIR _Ultimaker2plus/
    
      CC    /Users/ddd/Downloads/Arduino-1.8.5/hardware/arduino/avr/cores/arduino/wiring.c
    
      CC    /Users/ddd/Downloads/Arduino-1.8.5/hardware/arduino/avr/cores/arduino/hooks.c
    
      CC    /Users/ddd/Downloads/Arduino-1.8.5/hardware/arduino/avr/cores/arduino/wiring_analog.c
    
      CC    /Users/ddd/Downloads/Arduino-1.8.5/hardware/arduino/avr/cores/arduino/wiring_digital.c
    
      CC    /Users/ddd/Downloads/Arduino-1.8.5/hardware/arduino/avr/cores/arduino/wiring_pulse.c
    
      CC    /Users/ddd/Downloads/Arduino-1.8.5/hardware/arduino/avr/cores/arduino/wiring_shift.c
    
      CC    /Users/ddd/Downloads/Arduino-1.8.5/hardware/arduino/avr/cores/arduino/WInterrupts.c
    
      CXX   UltiLCD2.cpp
    
      CXX   UltiLCD2_gfx.cpp
    
      CXX   UltiLCD2_hi_lib.cpp
    
      CXX   UltiLCD2_low_lib.cpp
    
      CXX   UltiLCD2_menu_first_run.cpp
    
      CXX   UltiLCD2_menu_maintenance.cpp
    
      CXX   UltiLCD2_menu_material.cpp
    
      CXX   UltiLCD2_menu_print.cpp
    
      CXX   lifetime_stats.cpp
    
      CXX   UltiLCD2_menu_main.cpp
    
      CXX   powerbudget.cpp
    
      CXX   UltiLCD2_menu_utils.cpp
    
      CXX   UltiLCD2_menu_prefs.cpp
    
      CXX   tinkergnome.cpp
    
      CXX   machinesettings.cpp
    
      CXX   filament_sensor.cpp
    
      CXX   /Users/ddd/Downloads/Arduino-1.8.5/hardware/arduino/avr/cores/arduino/new.cpp
    
      CXX   /Users/ddd/Downloads/Arduino-1.8.5/hardware/arduino/avr/cores/arduino/WMath.cpp
    
      CXX   /Users/ddd/Downloads/Arduino-1.8.5/hardware/arduino/avr/cores/arduino/WString.cpp
    
      CXX   /Users/ddd/Downloads/Arduino-1.8.5/hardware/arduino/avr/cores/arduino/Print.cpp
    
      CXX   Marlin_main.cpp
    
      CXX   MarlinSerial.cpp
    
      CXX   Sd2Card.cpp
    
      CXX   SdBaseFile.cpp
    
      CXX   SdFile.cpp
    
      CXX   SdVolume.cpp
    
      CXX   motion_control.cpp
    
      CXX   planner.cpp
    
      CXX   stepper.cpp
    
      CXX   temperature.cpp
    
      CXX   cardreader.cpp
    
      CXX   ConfigurationStore.cpp
    
      CXX   watchdog.cpp
    
      CXX   electronics_test.cpp
    
      CXX   /Users/ddd/Downloads/Arduino-1.8.5/hardware/arduino/avr/cores/arduino/main.cpp
    
      CXX   _Ultimaker2plus/Ultimaker2Marlin-17.10.1
    
      CXX   Marlin.elf
    
    avr-gcc: error: Marlin.map: No such file or directory
    
    make: *** [Marlin.elf] Error 1
    
    make: *** Waiting for unfinished jobs....
    
    avr-gcc: error: Marlin.map: No such file or directory
    
    make: *** [_Ultimaker2plus/Ultimaker2Marlin-17.10.1] Error 1
    
    cp: _Ultimaker2plus/Marlin.hex: No such file or directory
    
      RM    _Ultimaker2plusDual/*
    
      RMDIR _Ultimaker2plusDual/
    
      CC    /Users/ddd/Downloads/Arduino-1.8.5/hardware/arduino/avr/cores/arduino/wiring.c
    
      CC    /Users/ddd/Downloads/Arduino-1.8.5/hardware/arduino/avr/cores/arduino/hooks.c
    
      CC    /Users/ddd/Downloads/Arduino-1.8.5/hardware/arduino/avr/cores/arduino/wiring_analog.c
    
      CC    /Users/ddd/Downloads/Arduino-1.8.5/hardware/arduino/avr/cores/arduino/wiring_digital.c
    
      CC    /Users/ddd/Downloads/Arduino-1.8.5/hardware/arduino/avr/cores/arduino/wiring_pulse.c
    
      CC    /Users/ddd/Downloads/Arduino-1.8.5/hardware/arduino/avr/cores/arduino/wiring_shift.c
    
      CC    /Users/ddd/Downloads/Arduino-1.8.5/hardware/arduino/avr/cores/arduino/WInterrupts.c
    
      CXX   UltiLCD2.cpp
    
      CXX   UltiLCD2_gfx.cpp
    
      CXX   UltiLCD2_hi_lib.cpp
    
      CXX   UltiLCD2_low_lib.cpp
    
      CXX   UltiLCD2_menu_first_run.cpp
    
      CXX   UltiLCD2_menu_maintenance.cpp
    
      CXX   UltiLCD2_menu_material.cpp
    
      CXX   UltiLCD2_menu_print.cpp
    
      CXX   lifetime_stats.cpp
    
      CXX   UltiLCD2_menu_main.cpp
    
      CXX   powerbudget.cpp
    
      CXX   UltiLCD2_menu_utils.cpp
    
      CXX   UltiLCD2_menu_prefs.cpp
    
      CXX   tinkergnome.cpp
    
      CXX   machinesettings.cpp
    
      CXX   filament_sensor.cpp
    
      CXX   /Users/ddd/Downloads/Arduino-1.8.5/hardware/arduino/avr/cores/arduino/new.cpp
    
      CXX   /Users/ddd/Downloads/Arduino-1.8.5/hardware/arduino/avr/cores/arduino/WMath.cpp
    
      CXX   /Users/ddd/Downloads/Arduino-1.8.5/hardware/arduino/avr/cores/arduino/WString.cpp
    
      CXX   /Users/ddd/Downloads/Arduino-1.8.5/hardware/arduino/avr/cores/arduino/Print.cpp
    
      CXX   Marlin_main.cpp
    
      CXX   MarlinSerial.cpp
    
      CXX   Sd2Card.cpp
    
      CXX   SdBaseFile.cpp
    
      CXX   SdFile.cpp
    
      CXX   SdVolume.cpp
    
      CXX   motion_control.cpp
    
      CXX   planner.cpp
    
      CXX   stepper.cpp
    
      CXX   temperature.cpp
    
      CXX   cardreader.cpp
    
      CXX   ConfigurationStore.cpp
    
      CXX   watchdog.cpp
    
      CXX   electronics_test.cpp
    
      CXX   /Users/ddd/Downloads/Arduino-1.8.5/hardware/arduino/avr/cores/arduino/main.cpp
    
      CXX   Marlin.elf
    
      CXX   _Ultimaker2plusDual/Ultimaker2Marlin-17.10.1
    
    avr-gcc: error: Marlin.map: No such file or directory
    
    make: *** [Marlin.elf] Error 1
    
    make: *** Waiting for unfinished jobs....
    
    avr-gcc: error: Marlin.map: No such file or directory
    
    make: *** [_Ultimaker2plusDual/Ultimaker2Marlin-17.10.1] Error 1
    
    cp: _Ultimaker2plusDual/Marlin.hex: No such file or directory
    
    ddd-MacBook-Pro-2:Marlin ddd$ 

     

     

     

    #!/usr/bin/env bash
    
    # This script is to package the Marlin package for Arduino
    # This script should run under Linux and Mac OS X, as well as Windows with Cygwin.
    
    #############################
    # CONFIGURATION
    #############################
    
    ##Which version name are we appending to the final archive
    export BUILD_NAME=17.10.1
    
    #############################
    # Actual build script
    #############################
    
    if [ -z `which make` ]; then
    	MAKE=mingw32-make
    else
    	MAKE=make
    fi
    
    
    # Change working directory to the directory the script is in
    # http://stackoverflow.com/a/246128
    SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
    cd "$SCRIPT_DIR"
    
    # #For building under MacOS we need gnutar instead of tar
    # if [ -z `which gnutar` ]; then
    # 	TAR=tar
    # else
    # 	TAR=gnutar
    # fi
    
    #############################
    # Build the required firmwares
    #############################
    
    #if [ -d "D:/arduino-1.8.1" ]; then
    	ARDUINO_PATH=/Users/ddd/Downloads/Arduino-1.8.5
    	ARDUINO_VERSION=185
    #elif [ -d "/Applications/Arduino.app/Contents/Resources/Java" ]; then
    #	ARDUINO_PATH=/Applications/Arduino.app/Contents/Resources/Java
    #	ARDUINO_VERSION=105
    #elif [ -d "D:/Arduino" ]; then
    #	ARDUINO_PATH=D:/Arduino
    #	ARDUINO_VERSION=165
    #else
    #	ARDUINO_PATH=/usr/share/arduino
    #	ARDUINO_VERSION=105
    #fi
    
    
    #Build the Ultimaker2 firmwares.
    # gitClone https://github.com/TinkerGnome/Ultimaker2Marlin.git _Ultimaker2Marlin
    # cd _Ultimaker2Marlin/Marlin
    
    # USE_CHANGE_TEMPERATURE
    
    $MAKE -j 3 HARDWARE_MOTHERBOARD=72 ARDUINO_INSTALL_DIR=${ARDUINO_PATH} ARDUINO_VERSION=${ARDUINO_VERSION} BUILD_DIR=_Ultimaker2 clean
    sleep 2
    mkdir _Ultimaker2
    $MAKE -j 3 HARDWARE_MOTHERBOARD=72 ARDUINO_INSTALL_DIR=${ARDUINO_PATH} ARDUINO_VERSION=${ARDUINO_VERSION} BUILD_DIR=_Ultimaker2 DEFINES="'STRING_CONFIG_H_AUTHOR=\"Tinker_${BUILD_NAME}\"' TEMP_SENSOR_1=0 EXTRUDERS=1 FILAMENT_SENSOR_PIN=30 BABYSTEPPING DEFAULT_POWER_BUDGET=175 HEATER_0_MAXTEMP=315 HEATER_1_MAXTEMP=315 HEATER_2_MAXTEMP=315"
    
    cp _Ultimaker2/Marlin.hex resources/firmware/Tinker-MarlinUltimaker2-${BUILD_NAME}.hex
    
    $MAKE -j 3 HARDWARE_MOTHERBOARD=72 ARDUINO_INSTALL_DIR=${ARDUINO_PATH} ARDUINO_VERSION=${ARDUINO_VERSION} BUILD_DIR=_Ultimaker2Dual clean
    sleep 2
    mkdir _Ultimaker2Dual
    $MAKE -j 3 HARDWARE_MOTHERBOARD=72 ARDUINO_INSTALL_DIR=${ARDUINO_PATH} ARDUINO_VERSION=${ARDUINO_VERSION} BUILD_DIR=_Ultimaker2Dual DEFINES="'STRING_CONFIG_H_AUTHOR=\"Tinker_${BUILD_NAME}\"' TEMP_SENSOR_1=20 EXTRUDERS=2 FILAMENT_SENSOR_PIN=30 BABYSTEPPING DEFAULT_POWER_BUDGET=160 HEATER_0_MAXTEMP=315 HEATER_1_MAXTEMP=315 HEATER_2_MAXTEMP=315"
    #cd -
    
    cp _Ultimaker2Dual/Marlin.hex resources/firmware/Tinker-MarlinUltimaker2-dual-${BUILD_NAME}.hex
    
    $MAKE -j 3 HARDWARE_MOTHERBOARD=72 ARDUINO_INSTALL_DIR=${ARDUINO_PATH} ARDUINO_VERSION=${ARDUINO_VERSION} BUILD_DIR=_Ultimaker2plus clean
    sleep 2
    mkdir _Ultimaker2plus
    $MAKE -j 3 HARDWARE_MOTHERBOARD=72 ARDUINO_INSTALL_DIR=${ARDUINO_PATH} ARDUINO_VERSION=${ARDUINO_VERSION} BUILD_DIR=_Ultimaker2plus DEFINES="'STRING_CONFIG_H_AUTHOR=\"Tinker_${BUILD_NAME}+\"' TEMP_SENSOR_1=0 EXTRUDERS=1 FILAMENT_SENSOR_PIN=30 BABYSTEPPING UM2PLUS DEFAULT_POWER_BUDGET=175 HEATER_0_MAXTEMP=315 HEATER_1_MAXTEMP=315 HEATER_2_MAXTEMP=315 'EEPROM_VERSION=\"V12\"'"
    
    cp _Ultimaker2plus/Marlin.hex resources/firmware/Tinker-MarlinUltimaker2plus-${BUILD_NAME}.hex
    
    $MAKE -j 3 HARDWARE_MOTHERBOARD=72 ARDUINO_INSTALL_DIR=${ARDUINO_PATH} ARDUINO_VERSION=${ARDUINO_VERSION} BUILD_DIR=_Ultimaker2plusDual clean
    sleep 2
    mkdir _Ultimaker2plusDual
    $MAKE -j 3 HARDWARE_MOTHERBOARD=72 ARDUINO_INSTALL_DIR=${ARDUINO_PATH} ARDUINO_VERSION=${ARDUINO_VERSION} BUILD_DIR=_Ultimaker2plusDual DEFINES="'STRING_CONFIG_H_AUTHOR=\"Tinker_${BUILD_NAME}+\"' TEMP_SENSOR_1=20 EXTRUDERS=2 FILAMENT_SENSOR_PIN=30 BABYSTEPPING UM2PLUS DEFAULT_POWER_BUDGET=160 HEATER_0_MAXTEMP=315 HEATER_1_MAXTEMP=315 HEATER_2_MAXTEMP=315 'EEPROM_VERSION=\"V12\"'"
    
    cp _Ultimaker2plusDual/Marlin.hex resources/firmware/Tinker-MarlinUltimaker2plus-dual-${BUILD_NAME}.hex

     

     

     

    # Sprinter Arduino Project Makefile
    #
    # Makefile Based on:
    # Arduino 0011 Makefile
    # Arduino adaptation by mellis, eighthave, oli.keller
    # Marlin adaption by Daid
    #
    # This has been tested with Arduino 1.0.5.
    #
    # This makefile allows you to build sketches from the command line
    # without the Arduino environment (or Java).
    #
    # Detailed instructions for using the makefile:
    #
    #  1. Modify the line containg "ARDUINO_INSTALL_DIR" to point to the directory that
    #     contains the Arduino installation (for example, under Mac OS X, this
    #     might be /Applications/arduino-0012).
    #
    #  2. Modify the line containing "UPLOAD_PORT" to refer to the filename
    #     representing the USB or serial connection to your Arduino board
    #     (e.g. UPLOAD_PORT = /dev/tty.USB0).  If the exact name of this file
    #     changes, you can use * as a wildcard (e.g. UPLOAD_PORT = /dev/tty.usb*).
    #
    #  3. Set the line containing "MCU" to match your board's processor.
    #     Older one's are atmega8 based, newer ones like Arduino Mini, Bluetooth
    #     or Diecimila have the atmega168.  If you're using a LilyPad Arduino,
    #     change F_CPU to 8000000. If you are using Gen7 electronics, you
    #     probably need to use 20000000. Either way, you must regenerate
    #     the speed lookup table with create_speed_lookuptable.py.
    #
    #  4. Type "make" and press enter to compile/verify your program.
    #
    #  5. Type "make upload", reset your Arduino board, and press enter to
    #     upload your program to the Arduino board.
    #
    # Note that all settings are set with ?=, this means you can override them
    # from the commandline with "make HARDWARE_MOTHERBOARD=71" for example
    
    # This defined the board you are compiling for (see Configuration.h for the options)
    HARDWARE_MOTHERBOARD ?= 72
    
    # Arduino source install directory, and version number
    ARDUINO_INSTALL_DIR  ?= /usr/share/arduino
    ARDUINO_VERSION      ?= 105
    
    # You can optionally set a path to the avr-gcc tools. Requires a trailing slash. (ex: /usr/local/avr-gcc/bin)
    AVR_TOOLS_PATH ?= /usr/local/CrossPack-AVR/bin/
    
    
    #Programmer configuration
    UPLOAD_RATE        ?= 115200
    AVRDUDE_PROGRAMMER ?= wiring
    UPLOAD_PORT        ?= /dev/arduino
    
    #Directory used to build files in, contains all the build files, from object files to the final hex file.
    BUILD_DIR          ?= applet
    
    ############################################################################
    # Below here nothing should be changed...
    
    # Here the Arduino variant is selected by the board type
    # HARDWARE_VARIANT = "arduino", "Sanguino", "Gen7", ...
    # MCU = "atmega1280", "Mega2560", "atmega2560", "atmega644p", ...
    
    #Gen7
    ifeq ($(HARDWARE_MOTHERBOARD),10)
    HARDWARE_VARIANT ?= Gen7
    MCU              ?= atmega644
    F_CPU            ?= 20000000
    else ifeq  ($(HARDWARE_MOTHERBOARD),11)
    HARDWARE_VARIANT ?= Gen7
    MCU              ?= atmega644p
    F_CPU            ?= 20000000
    else ifeq  ($(HARDWARE_MOTHERBOARD),12)
    HARDWARE_VARIANT ?= Gen7
    MCU              ?= atmega644p
    F_CPU            ?= 20000000
    else ifeq  ($(HARDWARE_MOTHERBOARD),13)
    HARDWARE_VARIANT ?= Gen7
    MCU              ?= atmega1284p
    F_CPU            ?= 20000000
    
    #RAMPS
    else ifeq  ($(HARDWARE_MOTHERBOARD),3)
    HARDWARE_VARIANT ?= arduino
    MCU              ?= atmega2560
    else ifeq  ($(HARDWARE_MOTHERBOARD),33)
    HARDWARE_VARIANT ?= arduino
    MCU              ?= atmega2560
    else ifeq  ($(HARDWARE_MOTHERBOARD),34)
    HARDWARE_VARIANT ?= arduino
    MCU              ?= atmega2560
    
    #Duemilanove w/ ATMega328P pin assignment
    else ifeq  ($(HARDWARE_MOTHERBOARD),4)
    HARDWARE_VARIANT ?= arduino
    HARDWARE_SUB_VARIANT ?= standard
    MCU              ?= atmega328p
    
    #Gen6
    else ifeq  ($(HARDWARE_MOTHERBOARD),5)
    HARDWARE_VARIANT ?= Gen6
    MCU              ?= atmega644p
    else ifeq  ($(HARDWARE_MOTHERBOARD),51)
    HARDWARE_VARIANT ?= Gen6
    MCU              ?= atmega644p
    
    #Sanguinololu
    else ifeq  ($(HARDWARE_MOTHERBOARD),6)
    HARDWARE_VARIANT ?= Sanguino
    MCU              ?= atmega644p
    else ifeq  ($(HARDWARE_MOTHERBOARD),62)
    HARDWARE_VARIANT ?= Sanguino
    MCU              ?= atmega644p
    else ifeq  ($(HARDWARE_MOTHERBOARD),63)
    HARDWARE_VARIANT ?= Sanguino
    MCU              ?= atmega644p
    
    #Ultimaker
    else ifeq  ($(HARDWARE_MOTHERBOARD),7)
    HARDWARE_VARIANT ?= arduino
    MCU              ?= atmega2560
    else ifeq  ($(HARDWARE_MOTHERBOARD),71)
    HARDWARE_VARIANT ?= arduino
    MCU              ?= atmega1280
    else ifeq  ($(HARDWARE_MOTHERBOARD),72)
    HARDWARE_VARIANT ?= arduino
    MCU              ?= atmega2560
    
    #Teensylu
    else ifeq  ($(HARDWARE_MOTHERBOARD),8)
    HARDWARE_VARIANT ?= Teensy
    MCU              ?= at90usb1286
    else ifeq  ($(HARDWARE_MOTHERBOARD),81)
    HARDWARE_VARIANT ?= Teensy
    MCU              ?= at90usb1286
    else ifeq  ($(HARDWARE_MOTHERBOARD),82)
    HARDWARE_VARIANT ?= Teensy
    MCU              ?= at90usb646
    
    #Gen3+
    else ifeq  ($(HARDWARE_MOTHERBOARD),9)
    HARDWARE_VARIANT ?= Sanguino
    MCU              ?= atmega644p
    
    #Megatronics
    else ifeq  ($(HARDWARE_MOTHERBOARD),70)
    HARDWARE_VARIANT ?= arduino
    MCU              ?= atmega2560
    
    #Alpha OMCA board
    else ifeq  ($(HARDWARE_MOTHERBOARD),90)
    HARDWARE_VARIANT ?= SanguinoA
    MCU              ?= atmega644
    
    #Final OMCA board
    else ifeq  ($(HARDWARE_MOTHERBOARD),91)
    HARDWARE_VARIANT ?= Sanguino
    MCU              ?= atmega644p
    
    #Rambo
    else ifeq  ($(HARDWARE_MOTHERBOARD),301)
    HARDWARE_VARIANT ?= arduino
    MCU              ?= atmega2560
    
    endif
    
    # Be sure to regenerate speed_lookuptable.h with create_speed_lookuptable.py
    # if you are setting this to something other than 16MHz
    # Set to 16Mhz if not yet set.
    F_CPU ?= 16000000
    
    # Arduino containd the main source code for the Arduino
    # Libraries, the "hardware variant" are for boards
    # that derives from that, and their source are present in
    # the main Marlin source directory
    ifeq ($(HARDWARE_VARIANT), arduino)
    HARDWARE_DIR = $(ARDUINO_INSTALL_DIR)/hardware
    else
    ifeq ($(shell [ $(ARDUINO_VERSION) -ge 100 ] && echo true), true)
    HARDWARE_DIR = ../ArduinoAddons/Arduino_1.x.x
    else
    HARDWARE_DIR = ../ArduinoAddons/Arduino_0.xx
    endif
    endif
    HARDWARE_SRC = $(HARDWARE_DIR)/$(HARDWARE_VARIANT)/avr/cores/arduino
    
    TARGET = $(notdir $(CURDIR))
    
    # VPATH tells make to look into these directory for source files,
    # there is no need to specify explicit pathnames as long as the
    # directory is added here
    
    VPATH = .
    VPATH += $(BUILD_DIR)
    VPATH += $(HARDWARE_SRC)
    ifeq ($(HARDWARE_VARIANT), arduino)
    VPATH += $(ARDUINO_INSTALL_DIR)/libraries/LiquidCrystal
    VPATH += $(ARDUINO_INSTALL_DIR)/libraries/SPI
    else
    VPATH += $(HARDWARE_DIR)/libraries/LiquidCrystal
    VPATH += $(HARDWARE_DIR)/libraries/SPI
    endif
    ifeq ($(HARDWARE_VARIANT), arduino)
    HARDWARE_SUB_VARIANT ?= mega
    VPATH += $(ARDUINO_INSTALL_DIR)/hardware/arduino/avr/variants/$(HARDWARE_SUB_VARIANT)
    else
    HARDWARE_SUB_VARIANT ?= standard
    VPATH += $(HARDWARE_DIR)/$(HARDWARE_VARIANT)/variants/$(HARDWARE_SUB_VARIANT)
    endif
    SRC = wiring.c hooks.c \
    	wiring_analog.c wiring_digital.c \
    	wiring_pulse.c \
    	wiring_shift.c WInterrupts.c
    CXXSRC = UltiLCD2.cpp UltiLCD2_gfx.cpp UltiLCD2_hi_lib.cpp UltiLCD2_low_lib.cpp \
    	UltiLCD2_menu_first_run.cpp UltiLCD2_menu_maintenance.cpp UltiLCD2_menu_material.cpp \
    	UltiLCD2_menu_print.cpp lifetime_stats.cpp UltiLCD2_menu_main.cpp powerbudget.cpp
    CXXSRC += UltiLCD2_menu_utils.cpp UltiLCD2_menu_prefs.cpp tinkergnome.cpp  \
    	machinesettings.cpp filament_sensor.cpp new.cpp
    CXXSRC += WMath.cpp WString.cpp Print.cpp Marlin_main.cpp	\
    	MarlinSerial.cpp Sd2Card.cpp SdBaseFile.cpp SdFile.cpp \
    	SdVolume.cpp motion_control.cpp planner.cpp \
    	stepper.cpp temperature.cpp cardreader.cpp ConfigurationStore.cpp \
    	watchdog.cpp electronics_test.cpp
    #CXXSRC += LiquidCrystal.cpp ultralcd.cpp SPI.cpp Servo.cpp Tone.cpp
    
    #Check for Arduino 1.0.0 or higher and use the correct sourcefiles for that version
    ifeq ($(shell [ $(ARDUINO_VERSION) -ge 100 ] && echo true), true)
    CXXSRC += main.cpp
    else
    SRC += pins_arduino.c main.c
    endif
    
    FORMAT = ihex
    
    # Name of this Makefile (used for "make depend").
    MAKEFILE = Makefile
    
    # Debugging format.
    # Native formats for AVR-GCC's -g are stabs [default], or dwarf-2.
    # AVR (extended) COFF requires stabs, plus an avr-objcopy run.
    DEBUG = stabs
    
    OPT = s
    
    DEFINES ?=
    
    # Program settings
    CC = $(AVR_TOOLS_PATH)avr-gcc
    CXX = $(AVR_TOOLS_PATH)avr-g++
    OBJCOPY = $(AVR_TOOLS_PATH)avr-objcopy
    OBJDUMP = $(AVR_TOOLS_PATH)avr-objdump
    AR  = $(AVR_TOOLS_PATH)avr-ar
    SIZE = $(AVR_TOOLS_PATH)avr-size
    NM = $(AVR_TOOLS_PATH)avr-nm
    AVRDUDE = avrdude
    REMOVE = rm -f
    MV = mv -f
    
    # $(info $$CC is [${CC}])
    # $(info $$CXX is [${CXX}])
    
    # Place -D or -U options here
    CDEFS    = -DF_CPU=$(F_CPU) ${addprefix -D , $(DEFINES)}
    CXXDEFS  = $(CDEFS)
    
    ifeq ($(HARDWARE_VARIANT), Teensy)
    CDEFS  += -DUSB_SERIAL
    SRC    += usb.c pins_teensy.c
    CXXSRC += usb_api.cpp
    endif
    
    # Add all the source directories as include directories too
    CINCS = ${addprefix -I ,${VPATH}}
    CXXINCS = ${addprefix -I ,${VPATH}}
    
    # Compiler flag to set the C Standard level.
    # c89   - "ANSI" C
    # gnu89 - c89 plus GCC extensions
    # c99   - ISO C99 standard (not yet fully implemented)
    # gnu99 - c99 plus GCC extensions
    #CSTANDARD = -std=gnu99
    CDEBUG = -g$(DEBUG)
    CWARN = -Wall -Wstrict-prototypes
    CTUNING = -funsigned-char -funsigned-bitfields -fpack-struct \
    	-fshort-enums -w -ffunction-sections -fdata-sections \
    	-DARDUINO=$(ARDUINO_VERSION)
    ifneq ($(HARDWARE_MOTHERBOARD),)
    CTUNING += -DMOTHERBOARD=${HARDWARE_MOTHERBOARD}
    endif
    #CEXTRA = -Wa,-adhlns=$(<:.c=.lst)
    
    CFLAGS := $(CDEBUG) $(CDEFS) $(CINCS) -O$(OPT) $(CWARN) $(CEXTRA) $(CTUNING)
    CXXFLAGS :=         $(CDEFS) $(CINCS) -O$(OPT) -Wall    $(CEXTRA) $(CTUNING)
    #ASFLAGS = -Wa,-adhlns=$(<:.S=.lst),-gstabs
    LDFLAGS = -lm
    ifeq ($(MCU),atmega2560)
    LDFLAGS += -Wl,--relax
    endif
    
    
    # Programming support using avrdude. Settings and variables.
    AVRDUDE_PORT = $(UPLOAD_PORT)
    AVRDUDE_WRITE_FLASH = -U flash:w:$(BUILD_DIR)/$(TARGET).hex:i
    AVRDUDE_FLAGS = -D -C $(ARDUINO_INSTALL_DIR)/hardware/tools/avrdude.conf \
    	-p $(MCU) -P $(AVRDUDE_PORT) -c $(AVRDUDE_PROGRAMMER) \
    	-b $(UPLOAD_RATE)
    
    # Define all object files.
    OBJ = ${patsubst %.c, $(BUILD_DIR)/%.o, ${SRC}}
    OBJ += ${patsubst %.cpp, $(BUILD_DIR)/%.o, ${CXXSRC}}
    OBJ += ${patsubst %.S, $(BUILD_DIR)/%.o, ${ASRC}}
    
    # Define all listing files.
    LST = $(ASRC:.S=.lst) $(CXXSRC:.cpp=.lst) $(SRC:.c=.lst)
    
    # Combine all necessary flags and optional flags.
    # Add target processor to flags.
    ALL_CFLAGS = -mmcu=$(MCU) -I. $(CFLAGS)
    ALL_CXXFLAGS = -mmcu=$(MCU) $(CXXFLAGS)
    ALL_ASFLAGS = -mmcu=$(MCU) -x assembler-with-cpp $(ASFLAGS)
    
    # set V=1 (eg, "make V=1") to print the full commands etc.
    ifneq ($V,1)
     Pecho=@echo
     P=@
    else
     Pecho=@:
     P=
    endif
    
    # Default target.
    all: sizeafter
    
    build: $(BUILD_DIR) elf hex lss sym
    
    # Creates the object directory
    $(BUILD_DIR):
    	$P mkdir -p $(BUILD_DIR)
    
    elf: $(BUILD_DIR)/$(TARGET).elf
    hex: $(BUILD_DIR)/$(TARGET).hex
    eep: $(BUILD_DIR)/$(TARGET).eep
    lss: $(BUILD_DIR)/$(TARGET).lss
    sym: $(BUILD_DIR)/$(TARGET).sym
    
    # Program the device.
    # Do not try to reset an arduino if it's not one
    upload: $(BUILD_DIR)/$(TARGET).hex
    ifeq (${AVRDUDE_PROGRAMMER}, arduino)
    	stty hup < $(UPLOAD_PORT); true
    endif
    	$(AVRDUDE) $(AVRDUDE_FLAGS) $(AVRDUDE_WRITE_FLASH)
    ifeq (${AVRDUDE_PROGRAMMER}, arduino)
    	stty -hup < $(UPLOAD_PORT); true
    endif
    
    	# Display size of file.
    HEXSIZE = $(SIZE) --target=$(FORMAT) $(BUILD_DIR)/$(TARGET).hex
    ELFSIZE = $(SIZE) --mcu=$(MCU) -C $(BUILD_DIR)/$(TARGET).elf; \
              $(SIZE)  $(BUILD_DIR)/$(TARGET).elf
    sizebefore:
    	$P if [ -f $(BUILD_DIR)/$(TARGET).elf ]; then echo; echo $(MSG_SIZE_BEFORE); $(HEXSIZE); echo; fi
    
    sizeafter: build
    	$P if [ -f $(BUILD_DIR)/$(TARGET).elf ]; then echo; echo $(MSG_SIZE_AFTER); $(ELFSIZE); echo; fi
    
    
    # Convert ELF to COFF for use in debugging / simulating in AVR Studio or VMLAB.
    COFFCONVERT=$(OBJCOPY) --debugging \
    	--change-section-address .data-0x800000 \
    	--change-section-address .bss-0x800000 \
    	--change-section-address .noinit-0x800000 \
    	--change-section-address .eeprom-0x810000
    
    
    coff: $(BUILD_DIR)/$(TARGET).elf
    	$(COFFCONVERT) -O coff-avr $(BUILD_DIR)/$(TARGET).elf $(TARGET).cof
    
    
    extcoff: $(TARGET).elf
    	$(COFFCONVERT) -O coff-ext-avr $(BUILD_DIR)/$(TARGET).elf $(TARGET).cof
    
    
    .SUFFIXES: .elf .hex .eep .lss .sym
    .PRECIOUS: .o
    
    .elf.hex:
    	$(Pecho) "  COPY  $@"
    	$P $(OBJCOPY) -O $(FORMAT) -R .eeprom $< $@
    
    .elf.eep:
    	-$(OBJCOPY) -j .eeprom --set-section-flags=.eeprom="alloc,load" \
    		--change-section-lma .eeprom=0 -O $(FORMAT) $< $@
    
    # Create extended listing file from ELF output file.
    .elf.lss:
    	$(OBJDUMP) -h -S $< > $@
    
    # Create a symbol table from ELF output file.
    .elf.sym:
    	$(NM) -n $< > $@
    
    	# Link: create ELF output file from library.
    $(BUILD_DIR)/$(TARGET).elf: $(OBJ) Configuration.h
    	$(Pecho) "  CXX   $@"
    	$P $(CC) $(ALL_CXXFLAGS) -Wl,--gc-sections  -Wl,-Map=$(BUILD_DIR)/$(TARGET).map -o $@ -L. $(OBJ) $(LDFLAGS)
    
    $(BUILD_DIR)/%.o: %.c Configuration.h Configuration_adv.h $(MAKEFILE)
    	$(Pecho) "  CC    $<"
    	$P $(CC) -MMD -c $(ALL_CFLAGS) $< -o $@
    
    $(BUILD_DIR)/%.o: $(BUILD_DIR)/%.cpp Configuration.h Configuration_adv.h $(MAKEFILE)
    	$(Pecho) "  CXX   $<"
    	$P $(CXX) -MMD -c $(ALL_CXXFLAGS) $< -o $@
    
    $(BUILD_DIR)/%.o: %.cpp Configuration.h Configuration_adv.h $(MAKEFILE)
    	$(Pecho) "  CXX   $<"
    	$P $(CXX) -MMD -c $(ALL_CXXFLAGS) $< -o $@
    
    
    # Target: clean project.
    clean:
    	$(Pecho) "  RM    $(BUILD_DIR)/*"
    	$P $(REMOVE) $(BUILD_DIR)/$(TARGET).hex $(BUILD_DIR)/$(TARGET).eep $(BUILD_DIR)/$(TARGET).cof $(BUILD_DIR)/$(TARGET).elf \
    		$(BUILD_DIR)/$(TARGET).map $(BUILD_DIR)/$(TARGET).sym $(BUILD_DIR)/$(TARGET).lss $(BUILD_DIR)/$(TARGET).cpp \
    		$(OBJ) $(LST) $(SRC:.c=.s) $(SRC:.c=.d) $(CXXSRC:.cpp=.s) $(CXXSRC:.cpp=.d)
    	$(Pecho) "  RMDIR $(BUILD_DIR)/"
    	$P rm -rf $(BUILD_DIR)
    
    
    .PHONY:	all build elf hex eep lss sym program coff extcoff clean depend sizebefore sizeafter
    
    # Automaticaly include the dependency files created by gcc
    -include ${wildcard $(BUILD_DIR)/*.d}

     

    Quote

     

  • Link to post
    Share on other sites

    Create an account or sign in to comment

    You need to be a member in order to leave a comment

    Create an account

    Sign up for a new account in our community. It's easy!

    Register a new account

    Sign in

    Already have an account? Sign in here.

    Sign In Now

    ×
    ×
    • Create New...