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

Merge pull request #15887 from aabadie/pr/boards/atmega_bootloader

boards/atmega: cleanup BOOTLOADER variables definitions
This commit is contained in:
Alexandre Abadie 2021-02-02 18:02:10 +01:00 committed by GitHub
commit 459e28c7d5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
12 changed files with 27 additions and 30 deletions

View File

@ -4,6 +4,5 @@ PORT_DARWIN ?= $(firstword $(sort $(wildcard /dev/tty.usbmodem*)))
BAUD ?= 9600
ARDUINO_DUEMILANOVE_BOOTLOADER ?= atmegaboot
BOOTLOADER ?= $(ARDUINO_DUEMILANOVE_BOOTLOADER)
include $(RIOTBOARD)/common/arduino-atmega/Makefile.include

View File

@ -11,6 +11,6 @@ BAUD ?= 9600
# PROGRAMMER defaults to avr109 which is the internal flasher via USB. Can be
# overridden for debugging (which requires changes that require to use an ISP)
BOOTLOADER ?= avr109
ARDUINO_LEONARDO_BOOTLOADER ?= avr109
include $(RIOTBOARD)/common/arduino-atmega/Makefile.include

View File

@ -2,6 +2,5 @@
BAUD ?= 9600
ARDUINO_MEGA2560_BOOTLOADER ?= stk500v2
BOOTLOADER ?= $(ARDUINO_MEGA2560_BOOTLOADER)
include $(RIOTBOARD)/common/arduino-atmega/Makefile.include

View File

@ -4,6 +4,5 @@ PORT_DARWIN ?= $(firstword $(sort $(wildcard /dev/tty.usbmodem*)))
BAUD ?= 9600
ARDUINO_NANO_BOOTLOADER ?= atmegaboot
BOOTLOADER ?= $(ARDUINO_NANO_BOOTLOADER)
include $(RIOTBOARD)/common/arduino-atmega/Makefile.include

View File

@ -46,7 +46,7 @@ available for RIOT. Refer to the project page for instructions on how to
build an flash the bootloader. Don't forgot to also update the fuse settings
to set the bootloader size to 256 words (512 bytes).
Compile and flash with `make BOARD=arduino-nano BOOTLOADER=optiboot flash` or
Compile and flash with `make BOARD=arduino-nano ATMEGA_BOOTLOADER=optiboot flash` or
use `export ARDUINO_NANO_BOOTLOADER=optiboot` in order to not have to specify
the bootloader during compilation and flashing.

View File

@ -2,6 +2,5 @@
BAUD ?= 9600
ARDUINO_UNO_BOOTLOADER ?= optiboot
BOOTLOADER ?= $(ARDUINO_UNO_BOOTLOADER)
include $(RIOTBOARD)/common/arduino-atmega/Makefile.include

View File

@ -4,7 +4,6 @@ PORT_DARWIN ?= $(firstword $(sort $(wildcard /dev/tty.usbmodem*)))
# refine serial port information for pyterm
BAUD ?= 115200
AVR_RSS2_BOOTLOADER ?= stk500v2
BOOTLOADER ?= $(AVR_RSS2_BOOTLOADER)
BOOTLOADER_SIZE ?= 4K # Unlike the Arduino Mega2560, the bootloader size is 4K
ATMEGA_BOOTLOADER_SIZE ?= 4K # Unlike the Arduino Mega2560, the bootloader size is 4K
include $(RIOTBOARD)/common/atmega/Makefile.include

View File

@ -3,51 +3,54 @@ INCLUDES += -I$(RIOTBOARD)/common/atmega/include
# Use avrdude programmer
PROGRAMMER ?= avrdude
# Use atmega board specific bootloader by default
ATMEGA_BOOTLOADER ?= $($(call uppercase_and_underscore,$(BOARD))_BOOTLOADER)
# If avrdude specific programmer is not set, set it based on the bootloader used
ifeq (,$(AVRDUDE_PROGRAMMER))
ifeq (atmegaboot,$(BOOTLOADER))
ifeq (atmegaboot,$(ATMEGA_BOOTLOADER))
AVRDUDE_PROGRAMMER = arduino
BOOTLOADER_SIZE ?= 2048
BOOTLOADER_BAUD ?= 57600
ATMEGA_BOOTLOADER_SIZE ?= 2048
ATMEGA_BOOTLOADER_BAUD ?= 57600
endif
ifeq (optiboot,$(BOOTLOADER))
ifeq (optiboot,$(ATMEGA_BOOTLOADER))
AVRDUDE_PROGRAMMER = arduino
ifneq (,$(filter $(CPU), atmega128rfa1 atmega256rfr2 atmega1281 atmega1284p atmega2560))
# The minimum bootloader size on these CPUs is 1 KiB (so 512 Byte are wasted)
BOOTLOADER_SIZE ?= 1024
ATMEGA_BOOTLOADER_SIZE ?= 1024
else
BOOTLOADER_SIZE ?= 512
ATMEGA_BOOTLOADER_SIZE ?= 512
endif
endif
ifeq (stk500v1,$(BOOTLOADER))
ifeq (stk500v1,$(ATMEGA_BOOTLOADER))
AVRDUDE_PROGRAMMER = stk500v1
BOOTLOADER_SIZE ?= 8K
ATMEGA_BOOTLOADER_SIZE ?= 8K
endif
ifeq (stk500v2,$(BOOTLOADER))
ifeq (stk500v2,$(ATMEGA_BOOTLOADER))
AVRDUDE_PROGRAMMER = stk500v2
BOOTLOADER_SIZE ?= 8K
ATMEGA_BOOTLOADER_SIZE ?= 8K
# Disable auto erase; erasing the flash is done implicitly by the bootloader
# and explicit erase is not supported
FFLAGS_EXTRA += -D
endif
ifeq (avr109,$(BOOTLOADER))
ifeq (avr109,$(ATMEGA_BOOTLOADER))
AVRDUDE_PROGRAMMER = avr109
BOOTLOADER_SIZE ?= 4K
ATMEGA_BOOTLOADER_SIZE ?= 4K
endif
ifeq (derfmega,$(BOOTLOADER))
ifeq (derfmega,$(ATMEGA_BOOTLOADER))
AVRDUDE_PROGRAMMER = wiring
BOOTLOADER_SIZE ?= 4K
ATMEGA_BOOTLOADER_SIZE ?= 4K
endif
ifneq (,$(BOOTLOADER_BAUD))
FFLAGS_EXTRA += -b $(BOOTLOADER_BAUD)
ifneq (,$(ATMEGA_BOOTLOADER_BAUD))
FFLAGS_EXTRA += -b $(ATMEGA_BOOTLOADER_BAUD)
endif
endif
BOOTLOADER_SIZE ?= 0
ROM_RESERVED ?= $(BOOTLOADER_SIZE)
ATMEGA_BOOTLOADER_SIZE ?= 0
ROM_RESERVED ?= $(ATMEGA_BOOTLOADER_SIZE)

View File

@ -5,6 +5,6 @@ PORT_LINUX ?= /dev/ttyUSB0
PORT_DARWIN ?= $(firstword $(sort $(wildcard /dev/tty.usbmodem*)))
# refine serial port information for pyterm
BAUD ?= 115200
BOOTLOADER ?= derfmega
DERFMEGA128_BOOTLOADER ?= derfmega
include $(RIOTBOARD)/common/atmega/Makefile.include

View File

@ -5,6 +5,6 @@ PORT_LINUX ?= /dev/ttyUSB0
PORT_DARWIN ?= $(firstword $(sort $(wildcard /dev/tty.usbmodem*)))
# refine serial port information for pyterm
BAUD ?= 115200
BOOTLOADER ?= derfmega
DERFMEGA256_BOOTLOADER ?= derfmega
include $(RIOTBOARD)/common/atmega/Makefile.include

View File

@ -1,6 +1,6 @@
# Found by checking fuse settings (2048 words so 4KB)
# https://www.microchip.com/DevelopmentTools/ProductDetails/atmega1284p-xpld
BOOTLOADER_SIZE ?= 4K
ATMEGA_BOOTLOADER_SIZE ?= 4K
# For backward compatibility
ifneq (,$(AVRDUDE_PORT))

View File

@ -2,6 +2,5 @@
PORT_DARWIN ?= $(firstword $(sort $(wildcard /dev/tty.usbserial*)))
BAUD ?= 9600
WASPMOTE_PRO_BOOTLOADER ?= stk500v1
BOOTLOADER ?= $(WASPMOTE_PRO_BOOTLOADER)
include $(RIOTBOARD)/common/atmega/Makefile.include