boards: leverage avrdude.inc.mk for atmega based boards.
Additionally, it removes unnecessary exports and cleans up waspmote-pro toolchain variables (not needed) which are taken from atmega_common.
This commit is contained in:
parent
1a98d64cd5
commit
d208cba464
@ -1,26 +1,27 @@
|
|||||||
# define the cpu used by the jiminy board
|
# define the cpu used by the jiminy board
|
||||||
export CPU = atmega256rfr2
|
export CPU = atmega256rfr2
|
||||||
|
|
||||||
# export needed for flash rule
|
# configure the terminal program
|
||||||
export PORT_LINUX ?= /dev/ttyACM0
|
PORT_LINUX ?= /dev/ttyACM0
|
||||||
export PORT_DARWIN ?= $(firstword $(sort $(wildcard /dev/tty.usbmodem*)))
|
PORT_DARWIN ?= $(firstword $(sort $(wildcard /dev/tty.usbmodem*)))
|
||||||
|
|
||||||
# Serial Baud rate for Ffasher is configured to 500kBaud
|
|
||||||
# see /usr/include/asm-generic/termbits.h for availabel baudrates on your linux system
|
|
||||||
export PROGRAMMER_SPEED ?= 0010005
|
|
||||||
|
|
||||||
export FFLAGS += -p atmega256rfr2
|
|
||||||
|
|
||||||
# refine serial port information for pyterm
|
# refine serial port information for pyterm
|
||||||
# For 8MHz F_CPU following Baudrate have good error rates
|
# For 8MHz F_CPU following Baudrate have good error rates
|
||||||
# 76923
|
# 76923
|
||||||
# 38400
|
# 38400
|
||||||
BAUD = 38400
|
BAUD ?= 38400
|
||||||
include $(RIOTMAKE)/tools/serial.inc.mk
|
include $(RIOTMAKE)/tools/serial.inc.mk
|
||||||
|
|
||||||
# PROGRAMMER defaults to arduino which is the internal flasher via USB. Can be
|
# PROGRAMMER defaults to wiring which is the internal flasher via USB
|
||||||
# overridden for debugging (which requires changes that require to use an ISP)
|
# using avrdude. Can be overridden for debugging (which requires changes
|
||||||
export PROGRAMMER ?= wiring
|
# that require to use an ISP)
|
||||||
|
PROGRAMMER ?= wiring
|
||||||
|
# set mcu model for avrdude (mandatory)
|
||||||
|
FFLAGS += -p atmega256rfr2
|
||||||
|
# Serial Baud rate for flasher is configured to 500kBaud
|
||||||
|
# see /usr/include/asm-generic/termbits.h for availabel baudrates on your linux system
|
||||||
|
FFLAGS_EXTRA += -b 0010005
|
||||||
|
# avoid error if mcu signature doesn't match
|
||||||
|
FFLAGS_EXTRA += -F
|
||||||
|
|
||||||
# From current fuse configuration
|
# From current fuse configuration
|
||||||
BOOTLOADER_SIZE ?= 4K
|
BOOTLOADER_SIZE ?= 4K
|
||||||
|
|||||||
@ -7,23 +7,22 @@ BOOTLOADER_SIZE ?= 4K
|
|||||||
ROM_RESERVED ?= $(BOOTLOADER_SIZE)
|
ROM_RESERVED ?= $(BOOTLOADER_SIZE)
|
||||||
|
|
||||||
# configure the terminal program
|
# configure the terminal program
|
||||||
export PORT_LINUX ?= /dev/ttyACM0
|
PORT_LINUX ?= /dev/ttyACM0
|
||||||
export PORT_DARWIN ?= $(firstword $(sort $(wildcard /dev/tty.usbserial*)))
|
PORT_DARWIN ?= $(firstword $(sort $(wildcard /dev/tty.usbmodem*)))
|
||||||
export BAUD ?= 9600
|
BAUD ?= 9600
|
||||||
include $(RIOTMAKE)/tools/serial.inc.mk
|
include $(RIOTMAKE)/tools/serial.inc.mk
|
||||||
|
|
||||||
export FLASHER = avrdude
|
# PROGRAMMER defaults to the external flasher Bus Pirate ISP using avrdude.
|
||||||
export DIST_PATH = $(RIOTBOARD)/$(BOARD)/dist
|
PROGRAMMER ?= buspirate
|
||||||
export DEBUGSERVER_PORT = 4242
|
# set mcu model for avrdude
|
||||||
export DEBUGSERVER = $(DIST_PATH)/debug_srv.sh
|
FFLAGS += -p m1284p
|
||||||
export DEBUGSERVER_FLAGS = "-g -j usb :$(DEBUGSERVER_PORT)"
|
# set serial port for avrdude with buspirate
|
||||||
export DEBUGGER_FLAGS = "-x $(RIOTBOARD)/$(BOARD)/dist/gdb.conf $(ELFFILE)"
|
ifeq ($(OS),Linux)
|
||||||
export DEBUGGER = $(DIST_PATH)/debug.sh $(DEBUGSERVER_FLAGS) $(DIST_PATH) $(DEBUGSERVER_PORT)
|
AVRDUDE_PORT ?= /dev/ttyUSB0
|
||||||
|
else ifeq ($(OS),Darwin)
|
||||||
|
AVRDUDE_PORT ?= $(firstword $(sort $(wildcard /dev/tty.usbserial*)))
|
||||||
|
endif
|
||||||
|
# avoid error if mcu signature doesn't match
|
||||||
|
FFLAGS_EXTRA += -F
|
||||||
|
|
||||||
# PROGRAMMER defaults to the Bus Pirate ISP
|
include $(RIOTMAKE)/tools/avrdude.inc.mk
|
||||||
export PROGRAMMER ?= buspirate
|
|
||||||
|
|
||||||
export PROGRAMMER_FLAGS = -P /dev/ttyUSB0
|
|
||||||
|
|
||||||
OFLAGS += -j .text -j .data
|
|
||||||
export FFLAGS += -p m1284p -c $(PROGRAMMER) $(PROGRAMMER_FLAGS) -F -U flash:w:$(HEXFILE)
|
|
||||||
|
|||||||
@ -13,31 +13,15 @@ PORT_DARWIN ?= $(firstword $(sort $(wildcard /dev/tty.usbserial*)))
|
|||||||
BAUD ?= 9600
|
BAUD ?= 9600
|
||||||
include $(RIOTMAKE)/tools/serial.inc.mk
|
include $(RIOTMAKE)/tools/serial.inc.mk
|
||||||
|
|
||||||
# define tools used for building the project
|
# PROGRAMMER defaults to stk500v1 which is the internal flasher via USB
|
||||||
export PREFIX = avr-
|
# using avrdude. Can be overridden for debugging (which requires changes
|
||||||
export CC = $(PREFIX)gcc
|
# that require to use an ISP)
|
||||||
export CXX = $(PREFIX)c++
|
PROGRAMMER ?= stk500v1
|
||||||
export AR = $(PREFIX)ar
|
# set mcu model for avrdude
|
||||||
export AS = $(PREFIX)as
|
FFLAGS += -p m1281
|
||||||
export LINK = $(PREFIX)gcc
|
# configure programmer speed in baud
|
||||||
export SIZE = $(PREFIX)size
|
FFLAGS_EXTRA += -b 115200
|
||||||
export OBJCOPY = $(PREFIX)objcopy
|
# avoid error if mcu signature doesn't match
|
||||||
|
FFLAGS_EXTRA += -F
|
||||||
|
|
||||||
export FLASHER = avrdude
|
include $(RIOTMAKE)/tools/avrdude.inc.mk
|
||||||
export DIST_PATH = $(RIOTBOARD)/$(BOARD)/dist
|
|
||||||
export DEBUGSERVER_PORT = 4242
|
|
||||||
export DEBUGSERVER = $(DIST_PATH)/debug_srv.sh
|
|
||||||
export DEBUGSERVER_FLAGS = "-g -j usb :$(DEBUGSERVER_PORT)"
|
|
||||||
export DEBUGGER_FLAGS = "-x $(RIOTBOARD)/$(BOARD)/dist/gdb.conf $(ELFFILE)"
|
|
||||||
export DEBUGGER = $(DIST_PATH)/debug.sh $(DEBUGSERVER_FLAGS) $(DIST_PATH) $(DEBUGSERVER_PORT)
|
|
||||||
|
|
||||||
# PROGRAMMER defaults to stk500v1 which is the internal flasher via USB. Can be
|
|
||||||
# overridden for debugging (which requires changes that require to use an ISP)
|
|
||||||
export PROGRAMMER ?= stk500v1
|
|
||||||
|
|
||||||
ifeq ($(PROGRAMMER), stk500v1)
|
|
||||||
export PROGRAMMER_FLAGS = -P $(PORT) -b 115200
|
|
||||||
endif
|
|
||||||
|
|
||||||
OFLAGS += -j .text -j .data
|
|
||||||
export FFLAGS += -p m1281 -c $(PROGRAMMER) $(PROGRAMMER_FLAGS) -F -U flash:w:$(HEXFILE)
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user