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 BAUD ?= 9600
ARDUINO_DUEMILANOVE_BOOTLOADER ?= atmegaboot ARDUINO_DUEMILANOVE_BOOTLOADER ?= atmegaboot
BOOTLOADER ?= $(ARDUINO_DUEMILANOVE_BOOTLOADER)
include $(RIOTBOARD)/common/arduino-atmega/Makefile.include 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 # 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) # 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 include $(RIOTBOARD)/common/arduino-atmega/Makefile.include

View File

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

View File

@ -4,6 +4,5 @@ PORT_DARWIN ?= $(firstword $(sort $(wildcard /dev/tty.usbmodem*)))
BAUD ?= 9600 BAUD ?= 9600
ARDUINO_NANO_BOOTLOADER ?= atmegaboot ARDUINO_NANO_BOOTLOADER ?= atmegaboot
BOOTLOADER ?= $(ARDUINO_NANO_BOOTLOADER)
include $(RIOTBOARD)/common/arduino-atmega/Makefile.include 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 build an flash the bootloader. Don't forgot to also update the fuse settings
to set the bootloader size to 256 words (512 bytes). 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 use `export ARDUINO_NANO_BOOTLOADER=optiboot` in order to not have to specify
the bootloader during compilation and flashing. the bootloader during compilation and flashing.

View File

@ -2,6 +2,5 @@
BAUD ?= 9600 BAUD ?= 9600
ARDUINO_UNO_BOOTLOADER ?= optiboot ARDUINO_UNO_BOOTLOADER ?= optiboot
BOOTLOADER ?= $(ARDUINO_UNO_BOOTLOADER)
include $(RIOTBOARD)/common/arduino-atmega/Makefile.include 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 # refine serial port information for pyterm
BAUD ?= 115200 BAUD ?= 115200
AVR_RSS2_BOOTLOADER ?= stk500v2 AVR_RSS2_BOOTLOADER ?= stk500v2
BOOTLOADER ?= $(AVR_RSS2_BOOTLOADER) ATMEGA_BOOTLOADER_SIZE ?= 4K # Unlike the Arduino Mega2560, the bootloader size is 4K
BOOTLOADER_SIZE ?= 4K # Unlike the Arduino Mega2560, the bootloader size is 4K
include $(RIOTBOARD)/common/atmega/Makefile.include include $(RIOTBOARD)/common/atmega/Makefile.include

View File

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

View File

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

View File

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

View File

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

View File

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