Add support for the chipKIT Max32 and Uno32.
This commit is contained in:
parent
82c7954211
commit
61d37eab82
5 changed files with 132 additions and 8 deletions
34
README.md
34
README.md
|
@ -2,9 +2,35 @@
|
|||
|
||||
This is a very simple Makefile which knows how to build Arduino sketches.
|
||||
|
||||
Until March 2012, this was simply posted on my website where you can
|
||||
still find [what
|
||||
documentation](http://mjo.tc/atelier/2009/02/arduino-cli.html
|
||||
"Documentation") exists.
|
||||
Until March 2012, this was simply posted on my website where you can still find
|
||||
[what documentation][docs] exists.
|
||||
|
||||
If you're using Debian or Ubuntu, you can find this in the arduino-core package.
|
||||
|
||||
This Makefile current requires either Arduino 1.0 or MPIDE 0023.
|
||||
|
||||
## chipKIT Support
|
||||
|
||||
In addition to regular Arduino boards, this Makefile supports the Digilent
|
||||
chipKIT Uno32 and Max32, both Arduino-compatible microcontrollers. To use this
|
||||
Makefile with one of those, include `chipKIT.mk` instead of `Arduino.mk` at the
|
||||
bottom of your Makefile.
|
||||
|
||||
include /path/to/chipKIT.mk
|
||||
|
||||
You can adjust the same variables [as described for the Arduino][docs], but the
|
||||
`ARDUINO_DIR` variable must point to an MPIDE installation (which includes the
|
||||
chipKIT toolchain) instead of the Arduino IDE.
|
||||
|
||||
|
||||
Some details on the addition of chipKIT support can be found in another
|
||||
[blog post](http://christopherpeplin.com/2011/12/chipkit-arduino-makefile/).
|
||||
|
||||
[docs]: http://mjo.tc/atelier/2009/02/arduino-cli.html
|
||||
|
||||
## Contributors
|
||||
|
||||
* Martin Oldfield (initial version)
|
||||
* Chris Peplin (chipKIT)
|
||||
* rei_vilo / Olivier
|
||||
* Edward Comer
|
||||
|
|
|
@ -186,11 +186,23 @@ endif
|
|||
ifneq (ARDUINO_DIR,)
|
||||
|
||||
ifndef AVR_TOOLS_PATH
|
||||
AVR_TOOLS_PATH = $(ARDUINO_DIR)/hardware/tools/avr/bin
|
||||
AVR_TOOLS_PATH = $(ARDUINO_DIR)/hardware/tools
|
||||
endif
|
||||
|
||||
ifndef ARDUINO_ETC_PATH
|
||||
ARDUINO_ETC_PATH = $(ARDUINO_DIR)/hardware/tools/avr/etc
|
||||
ifndef AVRDUDE_TOOLS_PATH
|
||||
ifeq ($(OSTYPE),Linux)
|
||||
AVRDUDE_TOOLS_PATH = $(AVR_TOOLS_PATH)
|
||||
else
|
||||
AVRDUDE_TOOLS_PATH = $(AVR_TOOLS_PATH)/avr/bin
|
||||
endif
|
||||
endif
|
||||
|
||||
ifndef AVRDUDE_ETC_PATH
|
||||
ifeq ($(OSTYPE),Linux)
|
||||
AVRDUDE_ETC_PATH = $(AVRDUDE_TOOLS_PATH)
|
||||
else
|
||||
AVRDUDE_ETC_PATH = $(AVR_TOOLS_PATH)/avr/etc
|
||||
endif
|
||||
endif
|
||||
|
||||
ifndef AVRDUDE_CONF
|
||||
|
@ -476,7 +488,7 @@ $(OBJDIR)/%.sym: $(OBJDIR)/%.elf
|
|||
# Avrdude
|
||||
#
|
||||
ifndef AVRDUDE
|
||||
AVRDUDE = $(AVR_TOOLS_PATH)/avrdude
|
||||
AVRDUDE = $(AVRDUDE_TOOLS_PATH)/avrdude
|
||||
endif
|
||||
|
||||
AVRDUDE_COM_OPTS = -q -V -p $(MCU)
|
||||
|
|
60
arduino-mk/chipKIT.mk
Normal file
60
arduino-mk/chipKIT.mk
Normal file
|
@ -0,0 +1,60 @@
|
|||
#
|
||||
# chipKIT extensions for Arduino Makefile
|
||||
# System part (i.e. project independent)
|
||||
#
|
||||
# Copyright (C) 2011 Christopher Peplin <chris.peplin@rhubarbtech.com>,
|
||||
# based on work that is Copyright Martin Oldfield
|
||||
#
|
||||
# This file is free software; you can redistribute it and/or modify it
|
||||
# under the terms of the GNU Lesser General Public License as
|
||||
# published by the Free Software Foundation; either version 2.1 of the
|
||||
# License, or (at your option) any later version.
|
||||
#
|
||||
|
||||
OSTYPE := $(shell uname)
|
||||
|
||||
AVR_TOOLS_PATH = $(ARDUINO_DIR)/hardware/pic32/compiler/pic32-tools/bin
|
||||
|
||||
ifneq ($(OSTYPE),Linux)
|
||||
AVRDUDE_TOOLS_PATH = $(ARDUINO_DIR)/hardware/tools/avr/bin
|
||||
else
|
||||
AVRDUDE_TOOLS_PATH = $(ARDUINO_DIR)/hardware/tools
|
||||
endif
|
||||
|
||||
ifneq ($(OSTYPE),Linux)
|
||||
AVRDUDE_ETC_PATH = $(ARDUINO_DIR)/hardware/tools/avr/etc
|
||||
else
|
||||
AVRDUDE_ETC_PATH = $(AVRDUDE_TOOLS_PATH)
|
||||
endif
|
||||
|
||||
ifndef BOARD
|
||||
BOARD = $(shell $(PARSE_BOARD) $(BOARD_TAG) board)
|
||||
endif
|
||||
|
||||
ARDUINO_CORE_PATH = $(ARDUINO_DIR)/hardware/pic32/cores/pic32
|
||||
ARDUINO_LIB_PATH = $(ARDUINO_DIR)/hardware/pic32/libraries
|
||||
BOARDS_TXT = $(ARDUINO_DIR)/hardware/pic32/boards.txt
|
||||
ARDUINO_VAR_PATH = $(ARDUINO_DIR)/hardware/pic32/variants
|
||||
ARDUINO_VERSION = 23
|
||||
|
||||
CC_NAME = pic32-gcc
|
||||
CXX_NAME = pic32-g++
|
||||
AR_NAME = pic32-ar
|
||||
OBJDUMP_NAME = pic32-objdump
|
||||
OBJCOPY_NAME = pic32-objcopy
|
||||
|
||||
LDSCRIPT = $(shell $(PARSE_BOARD) $(BOARD_TAG) ldscript)
|
||||
LDSCRIPT_FILE = $(ARDUINO_CORE_PATH)/$(LDSCRIPT)
|
||||
|
||||
MCU_FLAG_NAME=mprocessor
|
||||
EXTRA_LDFLAGS = -T$(ARDUINO_CORE_PATH)/$(LDSCRIPT)
|
||||
EXTRA_CXXFLAGS = -mno-smart-io -D$(BOARD)
|
||||
|
||||
CHIPKIT_MK_PATH := $(dir $(lastword $(MAKEFILE_LIST)))
|
||||
|
||||
include $(CHIPKIT_MK_PATH)/Arduino.mk
|
||||
|
||||
# MPIDE still comes with the compilers on Linux, unlike Arduino
|
||||
CC = $(AVR_TOOLS_PATH)/$(CC_NAME)
|
||||
CXX = $(AVR_TOOLS_PATH)/$(CXX_NAME)
|
||||
OBJCOPY = $(AVR_TOOLS_PATH)/$(OBJCOPY_NAME)
|
19
examples/Blink-chipKIT/Blink.pde
Normal file
19
examples/Blink-chipKIT/Blink.pde
Normal file
|
@ -0,0 +1,19 @@
|
|||
/*
|
||||
Blink
|
||||
Turns on an LED on for one second, then off for one second, repeatedly.
|
||||
|
||||
This example code is in the public domain.
|
||||
*/
|
||||
|
||||
void setup() {
|
||||
// initialize the digital pin as an output.
|
||||
// Pin 13 has an LED connected on most Arduino boards:
|
||||
pinMode(13, OUTPUT);
|
||||
}
|
||||
|
||||
void loop() {
|
||||
digitalWrite(13, HIGH); // set the LED on
|
||||
delay(1000); // wait for a second
|
||||
digitalWrite(13, LOW); // set the LED off
|
||||
delay(1000); // wait for a second
|
||||
}
|
7
examples/Blink-chipKIT/Makefile
Normal file
7
examples/Blink-chipKIT/Makefile
Normal file
|
@ -0,0 +1,7 @@
|
|||
BOARD_TAG = uno_pic32
|
||||
ARDUINO_PORT = /dev/cu.usb*
|
||||
|
||||
ARDUINO_LIBS =
|
||||
|
||||
include ../../arduino-mk/chipKIT.mk
|
||||
|
Loading…
Add table
Reference in a new issue