Jump to content
Ultimaker Community of 3D Printing Experts
Sign in to follow this  
zhonghello

How to build marlin firmware with makefile?

Recommended Posts

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

 

 

Share this post


Link to post
Share on other sites

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...

 

Share this post


Link to post
Share on other sites

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)

 

 

 

Share this post


Link to post
Share on other sites

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...

 

Share this post


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
Sign in to follow this  

  • Our picks

    • How to 3D print with reinforced engineering materials
      Ultimaker is hosting a webinar where we explain how you can achieve and maintain a high print success rate using these new reinforced engineering materials. Learn from Ultimaker's Product Manager of Materials and top chemical engineer Bart van As how you can take your 3D printing to that next level.
      • 2 replies
    • "Back To The Future" using Generative Design & Investment Casting
      Designing for light-weight parts is becoming more important, and I’m a firm believer in the need to produce lighter weight, less over-engineered parts for the future. This is for sustainability reasons because we need to be using less raw materials and, in things like transportation, it impacts the energy usage of the product during it’s service life.
        • Like
      • 12 replies
×

Important Information

Welcome to the Ultimaker Community of 3D printing experts. Visit the following links to read more about our Terms of Use or our Privacy Policy. Thank you!