Skip to content

Commit bee4d7e

Browse files
maribucrasbe
andcommitted
boards: use boards.h to indicated UF2 bootloader usage
Using `CFLAGS += -DBOOTLOADER_UF2` poisens the ccache. Using the `board.h` only adds entropy to the files actually including that header. The single user of that flag has been updated accordingly. Co-authored-by: crasbe <[email protected]>
1 parent 70160a8 commit bee4d7e

File tree

15 files changed

+29
-24
lines changed

15 files changed

+29
-24
lines changed

boards/adafruit-grand-central-m4-express/Makefile.include

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
CFLAGS += -DBOOTLOADER_UF2
2-
31
PROG_TTY_BOARD_FILTER := --vendor 'Adafruit Industries' --model 'Grand Central M4 Express'
42

53
# Include all definitions for flashing with bossa other USB

boards/adafruit-grand-central-m4-express/include/board.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,8 @@ extern "C" {
8585
#endif
8686
/** @} */
8787

88+
#define BOOTLOADER_UF2 1 /**< This board uses the UF2 bootloader */
89+
8890
#ifdef __cplusplus
8991
}
9092
#endif

boards/adafruit-itsybitsy-m4/Makefile.include

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
CFLAGS += -DBOOTLOADER_UF2
2-
31
# Include all definitions for flashing with bossa other USB
42
include $(RIOTBOARD)/common/samdx1-arduino-bootloader/Makefile.include
53
# Include handling of serial and non-bossa programmers (if selected by user)

boards/adafruit-itsybitsy-m4/include/board.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,8 @@ extern "C" {
6060
#define XTIMER_HZ (1000000ul)
6161
/** @} */
6262

63+
#define BOOTLOADER_UF2 1 /**< This board uses the UF2 bootloader */
64+
6365
#ifdef __cplusplus
6466
}
6567
#endif

boards/adafruit-metro-m4-express/Makefile.include

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
CFLAGS += -DBOOTLOADER_UF2
2-
31
PROG_TTY_BOARD_FILTER := --vendor 'Adafruit Industries' --model 'Metro M4 Express'
42

53
# Include all definitions for flashing with bossa other USB

boards/adafruit-metro-m4-express/include/board.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,8 @@ extern "C" {
6666
#define MTD_0 mtd_dev_get(0) /**< MTD device for the 8 MiB QSPI Flash */
6767
/** @} */
6868

69+
#define BOOTLOADER_UF2 1 /**< This board uses the UF2 bootloader */
70+
6971
#ifdef __cplusplus
7072
}
7173
#endif

boards/adafruit-pybadge/Makefile.include

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
CFLAGS += -DBOOTLOADER_UF2
2-
31
# stdio over usb takes several seconds to be up after flashing
42
TERM_DELAY ?= 4
53

boards/adafruit-pybadge/include/board.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,8 @@ extern "C" {
107107
#define XTIMER_HZ (1000000ul) /**< Default timer runs at 1MHz */
108108
/** @} */
109109

110+
#define BOOTLOADER_UF2 1 /**< This board uses the UF2 bootloader */
111+
110112
#ifdef __cplusplus
111113
}
112114
#endif

boards/common/samdx1-arduino-bootloader/reset.c

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -20,21 +20,22 @@
2020

2121
#define USB_H_USER_IS_RIOT_INTERNAL
2222

23+
#include "board.h"
2324
#include "cpu.h"
2425
#include "usb_board_reset.h"
2526

2627
#ifdef HMCRAMC0_ADDR
27-
#define DBL_TAP_PTR ((volatile uint32_t *)(HMCRAMC0_ADDR + HMCRAMC0_SIZE - 4))
28+
# define DBL_TAP_PTR ((volatile uint32_t *)(HMCRAMC0_ADDR + HMCRAMC0_SIZE - 4))
2829
#else
29-
#define DBL_TAP_PTR ((volatile uint32_t *)(HSRAM_ADDR + HSRAM_SIZE - 4))
30+
# define DBL_TAP_PTR ((volatile uint32_t *)(HSRAM_ADDR + HSRAM_SIZE - 4))
3031
#endif
3132

32-
#ifdef BOOTLOADER_UF2
33-
#define SAMD21_DOUBLE_TAP_ADDR DBL_TAP_PTR
34-
#define SAMD21_DOUBLE_TAP_MAGIC_NUMBER (0xF01669EFUL)
33+
#if BOOTLOADER_UF2
34+
# define SAMD21_DOUBLE_TAP_ADDR DBL_TAP_PTR
35+
# define SAMD21_DOUBLE_TAP_MAGIC_NUMBER (0xF01669EFUL)
3536
#else
36-
#define SAMD21_DOUBLE_TAP_ADDR (0x20007FFCUL)
37-
#define SAMD21_DOUBLE_TAP_MAGIC_NUMBER (0x07738135UL)
37+
# define SAMD21_DOUBLE_TAP_ADDR (0x20007FFCUL)
38+
# define SAMD21_DOUBLE_TAP_MAGIC_NUMBER (0x07738135UL)
3839
#endif
3940

4041
void usb_board_reset_in_bootloader(void)

boards/feather-m0/Makefile.include

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,3 @@
1-
# Boards after around 2018 use the more modern UF2 bootloader.
2-
# Comment out for the old BOSSA bootloader or upgrade to
3-
# the UF2 bootloader.
4-
CFLAGS += -DBOOTLOADER_UF2
5-
61
# setup the flash tool used
72
ifeq ($(PROGRAMMER),jlink)
83
# in case J-Link is attached to SWD pins, use a plain CPU memory model

0 commit comments

Comments
 (0)