Giter VIP home page Giter VIP logo

arduinomakefile's Introduction

arduinoMakefile

This project is just a simple Makefile for Arduino. There are some Makefiles in the Web but all of them are complicated and some does not work properly for newer versions of Arduino. This Makefile is simple and just works!

It does:

  • Compiles your sketch, including the standard Arduino library required
  • Merge all files into a .elf and them translate it to a .hex file
  • Upload the .hex to Arduino's flash memory

WARNING[0]: it was tested only in Ubuntu GNU/Linux with Arduino Uno. Probably it'll work well in any GNU/Linux distribution or Mac OS with Arduino Duemilanove. Windows users: sorry, please use a better OS.

WARNING[1]: by now the feature of compiling external libraries (even standard libraries and third-party libraries) is not implemented. So, if you have some #include in your project, probably it won't work -- but don't be afraid, I'm working on this.

Why another Makefile?

The question was answered in the section above -- but I'm studying all the Makefiles for Arduino that I found in the Web and trying to implement the simplest way of doing it right. I've created a comprehensive list of Makefiles and I'm categorizing them.

Dependencies

You need to have installed:

  • Arduino IDE unpacked -- we just use the libraries' source code
  • gcc-avr, avr-libc and binutils-avr -- for compilation
  • avrdude -- for upload
  • make -- to interpret the Makefile

If you run Ubuntu or Debian, just execute this recipe:

sudo aptitude install gcc-avr avr-libc binutils-avr avrdude make
wget http://arduino.googlecode.com/files/arduino-0022.tgz
tar xfz arduino-0022.tgz

Usage

The head of Makefile is self-explanatory, please read the comments and change these variables:

# Sketch filename without .pde (should be in the same directory of Makefile)
SKETCH_NAME=Blink
# The port Arduino is connected
#  Uno, in GNU/linux: generally /dev/ttyACM0
#  Duemilanove, in GNU/linux: generally /dev/ttyUSB0
PORT=/dev/ttyACM0
# The path of Arduino IDE
ARDUINO_DIR=/home/alvaro/arduino-0022
# Boardy type: use "arduino" for Uno or "skt500v1" for Duemilanove
BOARD_TYPE=arduino
# Baud-rate: use "115200" for Uno or "19200" for Duemilanove
BAUD_RATE=115200

WARNING: you need to have the configuration for Arduino Uno at your avrdude.conf. For some strange reason, the avrdude.conf at the Arduino IDE package does not have Arduino Uno configuration, but it works if do you use the default avrdude configuration file for Ubuntu package (at /etc/avrdude.conf).

arduinomakefile's People

Contributors

dbrgn avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

arduinomakefile's Issues

PORT should be automatically detected

This Makefile should automatically detected in which USB/serial port Arduino is connected -- it should be the default approach.

If the PORT variable is set, it'll override the default approach, using the port specified.

Expand Makefile to chipKIT MPIDE

MPIDE is derived from Arduino 0022 and deals with both Arduino and chipKIT platforms.

Expanding the Makefile to chipKIT would be great.

Add board-name-based instead of characteristics-based configurations

We should use BOARD="Uno" or BOARD="Duemilanove" instead of specifying BOARD_TYPE, BAUD_RATE and PORT.

Note: the PORT variable depends on the platform (GNU/Linux, Mac OS, FreeBSD etc.) and board type (Duemilanove, Uno etc.).

Related to issue #6: PORT should be automatically detected.

Create tests

Each feature of this Makefile should have tests to check if they are working.

The question is: how?

External Libraries Not Compiled

External libraries aren't compiled.

I know you're working on that.

Any progress so far?

WARNING[1]: by now the feature of compiling external libraries (even standard libraries and third-party libraries) is not implemented. So, if you have some #include in your project, probably it won't work -- but don't be afraid, I'm working on this.

Upload .elf file to Arduino

Hi!

How would I have to modify the Makefile to be able to upload a .elf file to an arduino? I have the .elf file compiled from another makefile and I was wondering what I would have to change in order to get that running on an Arduino (UNO).
Thank you for your help.

-Moritz

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.