diff --git a/boards/arduino-mkr-common/Makefile.include b/boards/arduino-mkr-common/Makefile.include index 8796cd009643448e7ac90d125396594986397079..24bc32982b90451b2fc214d97d323b44aaa1e178 100644 --- a/boards/arduino-mkr-common/Makefile.include +++ b/boards/arduino-mkr-common/Makefile.include @@ -15,8 +15,9 @@ ifeq ($(PROGRAMMER),jlink) export JLINK_DEVICE := ${MKR_JLINK_DEVICE} include $(RIOTMAKE)/tools/jlink.inc.mk else - # on default, we use BOSSA to flash this board - export LINKER_SCRIPT ?= $(RIOTCPU)/sam0_common/ldscripts/$(CPU_MODEL)_mkr.ld + # by default, we use BOSSA to flash this board and take into account the + # preinstalled Arduino bootloader. + export LINKER_SCRIPT ?= $(RIOTCPU)/sam0_common/ldscripts/$(CPU_MODEL)_arduino_bootloader.ld include $(RIOTMAKE)/tools/bossa.inc.mk endif diff --git a/cpu/sam0_common/ldscripts/README.md b/cpu/sam0_common/ldscripts/README.md new file mode 100644 index 0000000000000000000000000000000000000000..0a6e877174eba343974167432fd0455449cc0408 --- /dev/null +++ b/cpu/sam0_common/ldscripts/README.md @@ -0,0 +1,16 @@ +### Atmel SAM0 linker scripts notes + +This folder contains SAM0 CPU specific linker scripts that are used to generate +the final binary firmware. + +There are 2 kinds of scripts: + +* <name of cpu>.ld: used to generate a firmware that starts at the +beginning of the flash memory. The firmware is copied to the flash memory +using [OpenOCD](https://github.com/ntfreak/openocd). + +* <name of cpu>\_arduino\_bootloader.ld: used to generate a firmware +that starts after a preflashed Arduino bootloader. The firmware is copied to +the flash memory using [Bossa](https://github.com/shumatech/BOSSA). +This is the kind of configuration used with Arduino MKR and Adafruit Feather +M0 boards. diff --git a/cpu/sam0_common/ldscripts/samd21g18a_mkr.ld b/cpu/sam0_common/ldscripts/samd21g18a_arduino_bootloader.ld similarity index 83% rename from cpu/sam0_common/ldscripts/samd21g18a_mkr.ld rename to cpu/sam0_common/ldscripts/samd21g18a_arduino_bootloader.ld index 2215f46ee13dad4b9839188119b7fe2c844421bb..258f2069b5cdb38471d54f4177831ed036f78572 100644 --- a/cpu/sam0_common/ldscripts/samd21g18a_mkr.ld +++ b/cpu/sam0_common/ldscripts/samd21g18a_arduino_bootloader.ld @@ -12,7 +12,8 @@ * @{ * * @file - * @brief Memory definitions for the SAMD21DG18A used in Arduino MKR1000 board + * @brief Memory definitions for the SAMD21DG18A when used with a + * preinstalled bootloader. * * @author Hauke Petersen <hauke.petersen@fu-berlin.de> * @author Alexandre Abadie <alexandre.abadie@inria.fr>