From 6cc78ad2f1657f9d34e3e808eedb2af737573c77 Mon Sep 17 00:00:00 2001 From: Alexandre Abadie Date: Wed, 24 Feb 2021 16:47:26 +0100 Subject: [PATCH 1/3] boards/sensebox_samd21: don't include Makefile.dep in Makefile.include --- boards/sensebox_samd21/Makefile.include | 3 --- 1 file changed, 3 deletions(-) diff --git a/boards/sensebox_samd21/Makefile.include b/boards/sensebox_samd21/Makefile.include index 0ccbc79afd..5d4c54647e 100644 --- a/boards/sensebox_samd21/Makefile.include +++ b/boards/sensebox_samd21/Makefile.include @@ -11,6 +11,3 @@ else ifeq ($(PROGRAMMER),bossa) # ROM_OFFSET skips the space taken by the pre-flashed Arduino bootloader. ROM_OFFSET ?= 0x2000 endif - -# setup the boards dependencies -include $(RIOTBOARD)/sensebox_samd21/Makefile.dep From 8072333802281bb72f652016d11852d87d56b9d7 Mon Sep 17 00:00:00 2001 From: Alexandre Abadie Date: Wed, 24 Feb 2021 16:59:28 +0100 Subject: [PATCH 2/3] boards/sensebox_samd21: refactor to use USB CDC ACM for stdio --- boards/sensebox_samd21/Kconfig | 1 + boards/sensebox_samd21/Makefile | 2 ++ boards/sensebox_samd21/Makefile.dep | 3 +++ boards/sensebox_samd21/Makefile.features | 3 +++ boards/sensebox_samd21/Makefile.include | 15 ++++++++++----- boards/sensebox_samd21/doc.txt | 7 +++++-- 6 files changed, 24 insertions(+), 7 deletions(-) diff --git a/boards/sensebox_samd21/Kconfig b/boards/sensebox_samd21/Kconfig index df42e1051c..2f08f34387 100644 --- a/boards/sensebox_samd21/Kconfig +++ b/boards/sensebox_samd21/Kconfig @@ -19,3 +19,4 @@ config BOARD_SENSEBOX_SAMD21 select HAS_PERIPH_TIMER select HAS_PERIPH_UART select HAS_PERIPH_USBDEV + select HAS_HIGHLEVEL_STDIO diff --git a/boards/sensebox_samd21/Makefile b/boards/sensebox_samd21/Makefile index f8fcbb53a0..c05443c508 100644 --- a/boards/sensebox_samd21/Makefile +++ b/boards/sensebox_samd21/Makefile @@ -1,3 +1,5 @@ MODULE = board +DIRS = $(RIOTBOARD)/common/samdx1-arduino-bootloader + include $(RIOTBASE)/Makefile.base diff --git a/boards/sensebox_samd21/Makefile.dep b/boards/sensebox_samd21/Makefile.dep index 5472bf8b8d..716e2eadfb 100644 --- a/boards/sensebox_samd21/Makefile.dep +++ b/boards/sensebox_samd21/Makefile.dep @@ -1,3 +1,6 @@ ifneq (,$(filter saul_default,$(USEMODULE))) USEMODULE += saul_gpio endif + +# setup the samd21 arduino bootloader related dependencies +include $(RIOTBOARD)/common/samdx1-arduino-bootloader/Makefile.dep diff --git a/boards/sensebox_samd21/Makefile.features b/boards/sensebox_samd21/Makefile.features index e5b79684b9..6eae3247bb 100644 --- a/boards/sensebox_samd21/Makefile.features +++ b/boards/sensebox_samd21/Makefile.features @@ -10,3 +10,6 @@ FEATURES_PROVIDED += periph_spi FEATURES_PROVIDED += periph_timer FEATURES_PROVIDED += periph_uart FEATURES_PROVIDED += periph_usbdev + +# Put other features for this board (in alphabetical order) +FEATURES_PROVIDED += highlevel_stdio diff --git a/boards/sensebox_samd21/Makefile.include b/boards/sensebox_samd21/Makefile.include index 5d4c54647e..527c3231c6 100644 --- a/boards/sensebox_samd21/Makefile.include +++ b/boards/sensebox_samd21/Makefile.include @@ -3,11 +3,16 @@ PROGRAMMER ?= bossa PROGRAMMERS_SUPPORTED += bossa -# setup the flash tool used -ifeq ($(PROGRAMMER),jlink) - # in case J-Link is attached to SWD pins, use a plain CPU memory model - JLINK_DEVICE = atsamd21 -else ifeq ($(PROGRAMMER),bossa) +# in case J-Link is attached to SWD pins, use a plain CPU memory model +JLINK_DEVICE = atsamd21 + +ifeq ($(PROGRAMMER),bossa) # ROM_OFFSET skips the space taken by the pre-flashed Arduino bootloader. ROM_OFFSET ?= 0x2000 endif + +# Include all definitions for flashing with bossa over USB +include $(RIOTBOARD)/common/samdx1-arduino-bootloader/Makefile.include + +# Include handling of serial and non-bossa programmers (if selected by user) +include $(RIOTMAKE)/boards/sam0.inc.mk diff --git a/boards/sensebox_samd21/doc.txt b/boards/sensebox_samd21/doc.txt index aa5bdabc1d..d257941249 100644 --- a/boards/sensebox_samd21/doc.txt +++ b/boards/sensebox_samd21/doc.txt @@ -26,8 +26,11 @@ SenseBox board is based on the Atmel SAMD21G18A microcontroller. See ### Accessing STDIO via UART -To access the STDIO of RIOT, a FTDI to USB converted needs to be plugged to -the UART/Serial 1 pins on the board. +STDIO of RIOT is directly available over the USB port. + +The `TERM_DELAY` environment variable can be used to add a delay (in second) +before opening the serial terminal. The default value is 2s which should be +enough in most of the situation. ### On I2C port I2C port is enabled by default. To disable it use ```I2C_DISABLE```. To From 759d088ecc042b1cee780c31641de57f083c9dd1 Mon Sep 17 00:00:00 2001 From: Alexandre Abadie Date: Wed, 24 Feb 2021 18:47:53 +0100 Subject: [PATCH 3/3] tests/bench_xtimer: add sensebox to low memory boards --- tests/bench_xtimer/Makefile | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/bench_xtimer/Makefile b/tests/bench_xtimer/Makefile index d9f77767db..0150156d7d 100644 --- a/tests/bench_xtimer/Makefile +++ b/tests/bench_xtimer/Makefile @@ -55,6 +55,7 @@ LOW_MEMORY_BOARDS += \ opencm904 \ saml10-xpro \ saml11-xpro \ + sensebox_samd21 \ serpente \ sodaq-autonomo \ sodaq-explorer \