1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2024-12-29 04:50:03 +01:00

boards/arduino*: use common avrdude.inc.mk from atmega_common

Leverages common flasher (avrdude) and removes unnecessary exports.
Moreover, a reuse of serial.inc.mk is perfomed from the same
atmega_common/Makefile.include
This commit is contained in:
Francisco Acosta 2018-05-15 02:16:27 +02:00 committed by kYc0o
parent 2bdcdddd76
commit 1a98d64cd5
5 changed files with 43 additions and 42 deletions

View File

@ -3,16 +3,19 @@ export CPU = atmega328p
USEMODULE += boards_common_arduino-atmega
#export needed for flash rule
export PORT_LINUX ?= /dev/ttyUSB0
export PORT_DARWIN ?= $(firstword $(sort $(wildcard /dev/tty.usbmodem*)))
export PROGRAMMER_SPEED ?= 57600
# configure the terminal program
PORT_LINUX ?= /dev/ttyUSB0
PORT_DARWIN ?= $(firstword $(sort $(wildcard /dev/tty.usbmodem*)))
BAUD ?= 9600
export FFLAGS += -p m328p
# PROGRAMMER defaults to arduino which is the internal flasher via USB. Can be
# overridden for debugging (which requires changes that require to use an ISP)
export PROGRAMMER ?= arduino
# PROGRAMMER defaults to arduino which is the internal flasher via USB
# using avrdude. Can be overridden for debugging (which requires changes
# that require to use an ISP)
PROGRAMMER ?= arduino
# set mcu model for avrdude
FFLAGS += -p m328p
# configure programmer speed in baud
FFLAGS_EXTRA += -b 57600
BOOTLOADER_SIZE ?= 2K
ROM_RESERVED ?= $(BOOTLOADER_SIZE)

View File

@ -3,16 +3,19 @@ export CPU = atmega2560
USEMODULE += boards_common_arduino-atmega
#export needed for flash rule
export PORT_LINUX ?= /dev/ttyACM0
export PORT_DARWIN ?= $(firstword $(sort $(wildcard /dev/tty.usbmodem*)))
export PROGRAMMER_SPEED ?= 115200
# configure the terminal program
PORT_LINUX ?= /dev/ttyACM0
PORT_DARWIN ?= $(firstword $(sort $(wildcard /dev/tty.usbmodem*)))
BAUD ?= 9600
export FFLAGS += -p m2560
# PROGRAMMER defaults to stk500v2 which is the internal flasher via USB. Can be
# overridden for debugging (which requires changes that require to use an ISP)
export PROGRAMMER ?= stk500v2
# PROGRAMMER defaults to stk500v2 which is the internal flasher via USB
# using avrdude. Can be overridden for debugging (which requires changes
# that require to use an ISP)
PROGRAMMER ?= stk500v2
# set mcu model for avrdude
FFLAGS += -p m2560
# configure programmer speed in baud
FFLAGS_EXTRA += -b 115200
BOOTLOADER_SIZE ?= 8K
ROM_RESERVED ?= $(BOOTLOADER_SIZE)

View File

@ -3,16 +3,19 @@ export CPU = atmega328p
USEMODULE += boards_common_arduino-atmega
# export needed for flash rule
export PORT_LINUX ?= /dev/ttyACM0
export PORT_DARWIN ?= $(firstword $(sort $(wildcard /dev/tty.usbmodem*)))
export PROGRAMMER_SPEED ?= 115200
# configure the terminal program
PORT_LINUX ?= /dev/ttyACM0
PORT_DARWIN ?= $(firstword $(sort $(wildcard /dev/tty.usbmodem*)))
BAUD ?= 9600
export FFLAGS += -p m328p
# PROGRAMMER defaults to arduino which is the internal flasher via USB. Can be
# overridden for debugging (which requires changes that require to use an ISP)
export PROGRAMMER ?= arduino
# PROGRAMMER defaults to stk500v2 which is the internal flasher via USB
# using avrdude. Can be overridden for debugging (which requires changes
# that require to use an ISP)
PROGRAMMER ?= arduino
# set mcu model for avrdude
FFLAGS += -p m328p
# configure programmer speed in baud
FFLAGS_EXTRA += -b 115200
BOOTLOADER_SIZE ?= 512
ROM_RESERVED ?= $(BOOTLOADER_SIZE)

View File

@ -3,19 +3,10 @@ include $(RIOTBOARD)/common/arduino-atmega/Makefile.dep
INCLUDES += -I$(RIOTBOARD)/common/arduino-atmega/include
# refine serial port information
export BAUD ?= 9600
include $(RIOTMAKE)/tools/serial.inc.mk
export FLASHER = avrdude
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)
# Disable auto erase for flash and avoid error if signature doesn't match
FFLAGS_EXTRA += -F -D
export PROGRAMMER_FLAGS = -P $(PORT) -b $(PROGRAMMER_SPEED)
OFLAGS += -j .text -j .data
export FFLAGS += -c $(PROGRAMMER) $(PROGRAMMER_FLAGS) -F -D -U flash:w:$(HEXFILE)
# include avrdude flashing tool
include $(RIOTMAKE)/tools/avrdude.inc.mk

View File

@ -15,7 +15,8 @@ export FFLAGS += -p atmega256rfr2
# For 8MHz F_CPU following Baudrate have good error rates
# 76923
# 38400
export BAUD = 38400
BAUD = 38400
include $(RIOTMAKE)/tools/serial.inc.mk
# PROGRAMMER defaults to arduino which is the internal flasher via USB. Can be
# overridden for debugging (which requires changes that require to use an ISP)
@ -25,4 +26,4 @@ export PROGRAMMER ?= wiring
BOOTLOADER_SIZE ?= 4K
ROM_RESERVED ?= $(BOOTLOADER_SIZE)
include $(RIOTBOARD)/common/arduino-atmega/Makefile.include
include $(RIOTMAKE)/tools/avrdude.inc.mk