Jump to content

How to build marlin firmware with makefile?


zhonghello

Recommended Posts

Posted · How to build marlin firmware with makefile?

Dears,

I want to build marlin firmware with makefile, and I have installed Arduino 1.5.2 and the install path is G:/software.

Then I changed makefile as below:

# 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 ?= G:/software/arduino-1.5.2-windows/arduino-1.5.2

ARDUINO_VERSION ?= 152

 

# You can optionally set a path to the avr-gcc tools. Requires a trailing slash. (ex: /usr/local/avr-gcc/bin)

AVR_TOOLS_PATH ?= G:/software/arduino-1.5.2-windows/arduino-1.5.2/hardware/tools/avr/bin/

 

After changed the makefile, from a command prompt, I change into Marlin directory, and then type 'make', it shows below error:

G:\Marlin>make

make: *** No rule to make target `G:/Marlin/applet/wiring.o', neede

d by `G:/Marlin/applet/Marlin.elf'. Stop.

 

Very appreciated if any help~

PS: Actually, I am not sure about the arduino version :152

 

 

  • Link to post
    Share on other sites

    Posted · How to build marlin firmware with makefile?

    I did a quick test here and the Ultimaker/Marlin compiles fine with the latest 'stable' Arduino 1.0 (1.0.5) and gives the error you get with 1.5 Beta (tested with 1.5.7).

    Unless you absolutely want/need to go ahead with 1.5, easiest is to install 1.0...

    1.5 probably requires some more tweak in the Makefiles -- note that 1.5.7 does not even have the avr-utils, which requires more work to setup a build environment...

     

  • Link to post
    Share on other sites

    • 1 month later...
    Posted · How to build marlin firmware with makefile?

    I did a quick test here and the Ultimaker/Marlin compiles fine with the latest 'stable' Arduino 1.0 (1.0.5) and gives the error you get with 1.5 Beta (tested with 1.5.7).

    Unless you absolutely want/need to go ahead with 1.5, easiest is to install 1.0...

    1.5 probably requires some more tweak in the Makefiles -- note that 1.5.7 does not even have the avr-utils, which requires more work to setup a build environment...

     

    Not entirely true, You get this issue also with 1.0.5 when using a wrong motherboard. The default right now is '11' in the Makefile. A patch I have in my local git repository looks like the following (tested on *ubuntu) for an UM2 which is motherboard version 72. Arduino is installed via apt-get and i think it now has a dependancy on the normal avrdude (avrdude.conf is a symlink to /etc/avrdude...)

    diff --git a/Marlin/Makefile b/Marlin/Makefile

    index d8c7d0a..481c454 100644

    --- a/Marlin/Makefile

    +++ b/Marlin/Makefile

    @@ -37,19 +37,19 @@

    # 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 ?= 11

    +HARDWARE_MOTHERBOARD ?= 72

     

    # Arduino source install directory, and version number

    -ARDUINO_INSTALL_DIR ?= ../../arduino-0022

    -ARDUINO_VERSION ?= 22

    +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 ?=

     

    #Programmer configuration

    UPLOAD_RATE ?= 115200

    -AVRDUDE_PROGRAMMER ?= arduino

    -UPLOAD_PORT ?= /dev/arduino

    +AVRDUDE_PROGRAMMER ?= wiring

    +UPLOAD_PORT ?= /dev/ultimaker2

     

    #Directory used to build files in, contains all the build files, from object files to the final hex file.

    BUILD_DIR ?= applet

    @@ -293,7 +293,7 @@ LDFLAGS = -lm

    # 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/avr/etc/avrdude.conf \

    +AVRDUDE_FLAGS = -D -C $(ARDUINO_INSTALL_DIR)/hardware/tools/avrdude.conf \

    -p $(MCU) -P $(AVRDUDE_PORT) -c $(AVRDUDE_PROGRAMMER) \

    -b $(UPLOAD_RATE)

     

     

     

  • Link to post
    Share on other sites

    Posted · How to build marlin firmware with makefile?

    Well... Yeah...

    I meant to say that it works for building UM stock firmware...

    It also does not work out of the box if you try compile e.g. for a RepRep Full Display controller instead of the UltiController...

    Stock firmware is built from the '_do_make.bat' script where board and other options are set properly. This works perfectly and do not require any patch.

    Then obviously if you try anything else than that you are on your own...

     

  • Link to post
    Share on other sites

    Posted · How to build marlin firmware with makefile?

    _do_make.bat however is very platform specific and requires patching when changing arduino versions etc. Also, _do_make.bat is basically patching the Makefile 'on the fly'.

    Since we're talking about UM's specifically here it's not unthinkable that RepRap based firmware won't build 'out of the box' ;)

     

  • 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
    • Our picks

      • UltiMaker Cura 5.8 Stable released 🎉
        In the Cura 5.8 stable release, everyone can now tune their Z seams to look better than ever. Method series users get access to new material profiles, and the base Method model now has a printer profile, meaning the whole Method series is now supported in Cura!
        • 5 replies
      • Introducing the UltiMaker Factor 4
        We are happy to announce the next evolution in the UltiMaker 3D printer lineup: the UltiMaker Factor 4 industrial-grade 3D printer, designed to take manufacturing to new levels of efficiency and reliability. Factor 4 is an end-to-end 3D printing solution for light industrial applications
        • 3 replies
    ×
    ×
    • Create New...