Makefile-ARM: get uploading to work.
This commit is contained in:
parent
3cc81cdba8
commit
9e9e946c6d
40
Makefile-ARM
40
Makefile-ARM
|
|
@ -67,31 +67,19 @@ TOOLCHAIN = arm-none-eabi-
|
||||||
# #
|
# #
|
||||||
##############################################################################
|
##############################################################################
|
||||||
|
|
||||||
# avrdude, typical for AVR-based architectures.
|
# Unlike with AVR, there is no one tool for uploading to all chips. Some
|
||||||
|
# need 'lpc21isp', others (e.g. Arduinos) need 'bossac'.
|
||||||
#
|
#
|
||||||
# Flags:
|
# To deal with this, we simply define the port here and do the rest directly
|
||||||
# -c <programmer-type> Typically stk500 or stk500v2.
|
# in the rules for the 'program' target.
|
||||||
# -b <baudrate> Upload baud rate. Depends on the bootloader in
|
|
||||||
# use. Not used for USB programmers.
|
|
||||||
# -p <mcu type> See MCU above.
|
|
||||||
# -P <port> Serial port the electronics is connected to.
|
|
||||||
# -C <config file> Optional, default is /etc/avrdude.conf.
|
|
||||||
|
|
||||||
UPLOADER ?= avrdude
|
# Frequency of the on-chip R/C oscillator or the on-board quartz crystal.
|
||||||
# UPLOADER = <path-to-arduino-folder>/hardware/tools/avrdude
|
F_CRYSTAL ?= 12000000
|
||||||
|
|
||||||
ifndef UPLOADER_FLAGS
|
|
||||||
UPLOADER_FLAGS = -c stk500v2
|
|
||||||
# UPLOADER_FLAGS += -b 19200
|
|
||||||
# UPLOADER_FLAGS += -b 57600
|
|
||||||
UPLOADER_FLAGS += -b 115200
|
|
||||||
UPLOADER_FLAGS += -p $(MCU)
|
|
||||||
# UPLOADER_FLAGS += -P COM1
|
|
||||||
# UPLOADER_FLAGS += -P /dev/ttyACM0
|
|
||||||
UPLOADER_FLAGS += -P /dev/ttyUSB0
|
|
||||||
# UPLOADER_FLAGS += -C <path-to-arduino-folder>/hardware/tools/avrdude.conf
|
|
||||||
endif
|
|
||||||
|
|
||||||
|
# Serial port the electronics is connected to.
|
||||||
|
UPLOADER_PORT ?= /dev/ttyUSB0
|
||||||
|
#UPLOADER_PORT ?= /dev/ttyACM0
|
||||||
|
#UPLOADER_PORT ?= com1
|
||||||
|
|
||||||
##############################################################################
|
##############################################################################
|
||||||
# #
|
# #
|
||||||
|
|
@ -149,7 +137,13 @@ LIBS = -lm
|
||||||
all: $(PROGRAM).hex $(BUILDDIR)/$(PROGRAM).lst $(BUILDDIR)/$(PROGRAM).sym size
|
all: $(PROGRAM).hex $(BUILDDIR)/$(PROGRAM).lst $(BUILDDIR)/$(PROGRAM).sym size
|
||||||
|
|
||||||
program: $(PROGRAM).hex config.h
|
program: $(PROGRAM).hex config.h
|
||||||
$(UPLOADER) $(UPLOADER_FLAGS) -U flash:w:$(PROGRAM).hex
|
@echo
|
||||||
|
@echo "To let the bootloader complete his work, connect now PIO0_1 to GND,"
|
||||||
|
@echo "then press Reset for a moment. The bootloader should begin uploading."
|
||||||
|
@echo "After being done, disconnect PIO0_1 and press reset again. On a"
|
||||||
|
@echo "Gen7-ARM, PIO0_1 is the Step pin of the Z stepper driver."
|
||||||
|
@echo
|
||||||
|
lpc21isp -control $< $(UPLOADER_PORT) 115200 $(F_CRYSTAL)
|
||||||
|
|
||||||
$(BUILDDIR)/teacup.elf: $(BUILDDIR)/startup.o
|
$(BUILDDIR)/teacup.elf: $(BUILDDIR)/startup.o
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue