From fea9e68b88da9462043f99d98149a0b620063d7e Mon Sep 17 00:00:00 2001 From: Benjamin Valentin Date: Thu, 5 Nov 2020 20:54:23 +0100 Subject: [PATCH 1/8] nrf802154: don't hard-code max TX power The smaller family members only have 4dBm max output power. --- cpu/nrf52/radio/nrf802154/nrf802154.c | 4 ++-- cpu/nrf52/radio/nrf802154/nrf802154_radio.c | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/cpu/nrf52/radio/nrf802154/nrf802154.c b/cpu/nrf52/radio/nrf802154/nrf802154.c index 5c646b0e8c..687805e7c7 100644 --- a/cpu/nrf52/radio/nrf802154/nrf802154.c +++ b/cpu/nrf52/radio/nrf802154/nrf802154.c @@ -193,8 +193,8 @@ static int16_t _get_txpower(void) static void _set_txpower(int16_t txpower) { - if (txpower > 8) { - NRF_RADIO->TXPOWER = RADIO_TXPOWER_TXPOWER_Pos8dBm; + if (txpower > (int)RADIO_TXPOWER_TXPOWER_Max) { + NRF_RADIO->TXPOWER = RADIO_TXPOWER_TXPOWER_Max; } else if (txpower > 1) { NRF_RADIO->TXPOWER = (uint32_t)txpower; diff --git a/cpu/nrf52/radio/nrf802154/nrf802154_radio.c b/cpu/nrf52/radio/nrf802154/nrf802154_radio.c index 22f109be45..3b36f397f2 100644 --- a/cpu/nrf52/radio/nrf802154/nrf802154_radio.c +++ b/cpu/nrf52/radio/nrf802154/nrf802154_radio.c @@ -38,8 +38,8 @@ /* Set timer period to 16 us (IEEE 802.15.4 symbol time) */ #define TIMER_FREQ (62500UL) -#define TX_POWER_MIN (-40) /* in dBm */ -#define TX_POWER_MAX (8) /* in dBm */ +#define TX_POWER_MIN (-40) /* in dBm */ +#define TX_POWER_MAX ((int)RADIO_TXPOWER_TXPOWER_Max) /* in dBm */ /** * @brief Default nrf802154 radio shortcuts @@ -308,8 +308,8 @@ static int set_cca_threshold(ieee802154_dev_t *dev, int8_t threshold) static void _set_txpower(int16_t txpower) { DEBUG("[nrf802154]: Setting TX power to %i\n", txpower); - if (txpower > 8) { - NRF_RADIO->TXPOWER = RADIO_TXPOWER_TXPOWER_Pos8dBm; + if (txpower > (int)RADIO_TXPOWER_TXPOWER_Max) { + NRF_RADIO->TXPOWER = RADIO_TXPOWER_TXPOWER_Max; } else if (txpower > 1) { NRF_RADIO->TXPOWER = (uint32_t)txpower; From bfb7cbfa4d47ecadf8942bbd3d34d5ab69d6fe23 Mon Sep 17 00:00:00 2001 From: Benjamin Valentin Date: Thu, 5 Nov 2020 20:58:29 +0100 Subject: [PATCH 2/8] boards/nrf52: resolve netdev dependencies for all family members --- boards/common/nrf52/Makefile.dep | 12 ++++++------ .../{nrf52832/Makefile.dep => Makefile.nimble.dep} | 2 +- .../Makefile.dep => Makefile.nrf802154.dep} | 0 boards/common/nrf52/Makefile.nrfmin.dep | 5 +++++ 4 files changed, 12 insertions(+), 7 deletions(-) rename boards/common/nrf52/{nrf52832/Makefile.dep => Makefile.nimble.dep} (65%) rename boards/common/nrf52/{nrf52840/Makefile.dep => Makefile.nrf802154.dep} (100%) create mode 100644 boards/common/nrf52/Makefile.nrfmin.dep diff --git a/boards/common/nrf52/Makefile.dep b/boards/common/nrf52/Makefile.dep index 7983ffd731..327585d2b8 100644 --- a/boards/common/nrf52/Makefile.dep +++ b/boards/common/nrf52/Makefile.dep @@ -2,10 +2,10 @@ ifneq (,$(filter saul_default,$(USEMODULE))) USEMODULE += saul_nrf_temperature endif -ifneq (,$(findstring nrf52832, $(CPU_MODEL))) - # include common nrf52832 dependencies - include $(RIOTBOARD)/common/nrf52/nrf52832/Makefile.dep -else ifneq (,$(findstring nrf52840, $(CPU_MODEL))) - # include common nrf52840 dependencies - include $(RIOTBOARD)/common/nrf52/nrf52840/Makefile.dep +ifneq (,$(filter nrf52811xxaa nrf52820xxaa rf52833xxaa nrf52840xxaa,$(CPU_MODEL))) + # include dependencies for 802.15.4 radio + include $(RIOTBOARD)/common/nrf52/Makefile.nrf802154.dep +else + # include dependencies for BLE + include $(RIOTBOARD)/common/nrf52/Makefile.nimble.dep endif diff --git a/boards/common/nrf52/nrf52832/Makefile.dep b/boards/common/nrf52/Makefile.nimble.dep similarity index 65% rename from boards/common/nrf52/nrf52832/Makefile.dep rename to boards/common/nrf52/Makefile.nimble.dep index f2e7315787..a682d92a03 100644 --- a/boards/common/nrf52/nrf52832/Makefile.dep +++ b/boards/common/nrf52/Makefile.nimble.dep @@ -1,5 +1,5 @@ ifneq (,$(filter gnrc_netdev_default,$(USEMODULE))) - ifeq (,$(filter nrfmin,$(USEMODULE))) + ifeq (,$(filter nrfmin nrf802154,$(USEMODULE))) USEMODULE += nimble_netif endif endif diff --git a/boards/common/nrf52/nrf52840/Makefile.dep b/boards/common/nrf52/Makefile.nrf802154.dep similarity index 100% rename from boards/common/nrf52/nrf52840/Makefile.dep rename to boards/common/nrf52/Makefile.nrf802154.dep diff --git a/boards/common/nrf52/Makefile.nrfmin.dep b/boards/common/nrf52/Makefile.nrfmin.dep new file mode 100644 index 0000000000..f791e97d36 --- /dev/null +++ b/boards/common/nrf52/Makefile.nrfmin.dep @@ -0,0 +1,5 @@ +ifneq (,$(filter gnrc_netdev_default,$(USEMODULE))) + ifeq (,$(filter nimble_% nrf802154,$(USEMODULE))) + USEMODULE += nrfmin + endif +endif From ef96696bab10840fcca0f03e7d9d8c691e9f99a5 Mon Sep 17 00:00:00 2001 From: Benjamin Valentin Date: Thu, 5 Nov 2020 22:40:38 +0100 Subject: [PATCH 3/8] boards/common/e104-bt50xxa-tb: common board for Ebyte nRF52 breakouts --- boards/common/e104-bt50xxa-tb/Kconfig | 14 ++++++++++++++ boards/common/e104-bt50xxa-tb/Makefile | 3 +++ boards/common/e104-bt50xxa-tb/Makefile.dep | 5 +++++ boards/common/e104-bt50xxa-tb/Makefile.features | 7 +++++++ boards/common/e104-bt50xxa-tb/Makefile.include | 6 ++++++ .../e104-bt50xxa-tb}/board.c | 4 ++-- boards/common/e104-bt50xxa-tb/doc.txt | 6 ++++++ .../e104-bt50xxa-tb}/include/board.h | 4 ++-- .../e104-bt50xxa-tb}/include/gpio_params.h | 2 +- .../e104-bt50xxa-tb}/include/periph_conf.h | 8 ++++---- boards/e104-bt5010a-tb/Kconfig | 7 ++----- boards/e104-bt5010a-tb/Makefile | 3 +++ boards/e104-bt5010a-tb/Makefile.dep | 6 ++---- boards/e104-bt5010a-tb/Makefile.features | 8 +------- boards/e104-bt5010a-tb/Makefile.include | 5 +---- 15 files changed, 59 insertions(+), 29 deletions(-) create mode 100644 boards/common/e104-bt50xxa-tb/Kconfig create mode 100644 boards/common/e104-bt50xxa-tb/Makefile create mode 100644 boards/common/e104-bt50xxa-tb/Makefile.dep create mode 100644 boards/common/e104-bt50xxa-tb/Makefile.features create mode 100644 boards/common/e104-bt50xxa-tb/Makefile.include rename boards/{e104-bt5010a-tb => common/e104-bt50xxa-tb}/board.c (83%) create mode 100644 boards/common/e104-bt50xxa-tb/doc.txt rename boards/{e104-bt5010a-tb => common/e104-bt50xxa-tb}/include/board.h (92%) rename boards/{e104-bt5010a-tb => common/e104-bt50xxa-tb}/include/gpio_params.h (96%) rename boards/{e104-bt5010a-tb => common/e104-bt50xxa-tb}/include/periph_conf.h (88%) diff --git a/boards/common/e104-bt50xxa-tb/Kconfig b/boards/common/e104-bt50xxa-tb/Kconfig new file mode 100644 index 0000000000..1e6a27d1da --- /dev/null +++ b/boards/common/e104-bt50xxa-tb/Kconfig @@ -0,0 +1,14 @@ +# Copyright (c) 2020 Benjamin Valentin +# +# This file is subject to the terms and conditions of the GNU Lesser +# General Public License v2.1. See the file LICENSE in the top level +# directory for more details. + +config BOARD_COMMON_E104_BT50XXA_TB + bool + select BOARD_COMMON_NRF52 + select HAS_PERIPH_I2C + select HAS_PERIPH_SPI + select HAS_PERIPH_UART + +source "$(RIOTBOARD)/common/nrf52/Kconfig" diff --git a/boards/common/e104-bt50xxa-tb/Makefile b/boards/common/e104-bt50xxa-tb/Makefile new file mode 100644 index 0000000000..25fe337df7 --- /dev/null +++ b/boards/common/e104-bt50xxa-tb/Makefile @@ -0,0 +1,3 @@ +MODULE = boards_common_e104_bt50xxa_tb + +include $(RIOTBASE)/Makefile.base diff --git a/boards/common/e104-bt50xxa-tb/Makefile.dep b/boards/common/e104-bt50xxa-tb/Makefile.dep new file mode 100644 index 0000000000..7317b22d44 --- /dev/null +++ b/boards/common/e104-bt50xxa-tb/Makefile.dep @@ -0,0 +1,5 @@ +ifneq (,$(filter saul_default,$(USEMODULE))) + USEMODULE += saul_gpio +endif + +include $(RIOTBOARD)/common/nrf52/Makefile.dep diff --git a/boards/common/e104-bt50xxa-tb/Makefile.features b/boards/common/e104-bt50xxa-tb/Makefile.features new file mode 100644 index 0000000000..d41ae96de9 --- /dev/null +++ b/boards/common/e104-bt50xxa-tb/Makefile.features @@ -0,0 +1,7 @@ +# Put defined MCU peripherals here (in alphabetical order) +FEATURES_PROVIDED += periph_i2c +FEATURES_PROVIDED += periph_spi +FEATURES_PROVIDED += periph_rtt +FEATURES_PROVIDED += periph_uart + +include $(RIOTBOARD)/common/nrf52/Makefile.features diff --git a/boards/common/e104-bt50xxa-tb/Makefile.include b/boards/common/e104-bt50xxa-tb/Makefile.include new file mode 100644 index 0000000000..4c917458dd --- /dev/null +++ b/boards/common/e104-bt50xxa-tb/Makefile.include @@ -0,0 +1,6 @@ +# external programmer required +DEBUG_ADAPTER ?= jlink + +INCLUDES += -I$(RIOTBOARD)/common/e104-bt50xxa-tb/include + +include $(RIOTBOARD)/common/nrf52/Makefile.include diff --git a/boards/e104-bt5010a-tb/board.c b/boards/common/e104-bt50xxa-tb/board.c similarity index 83% rename from boards/e104-bt5010a-tb/board.c rename to boards/common/e104-bt50xxa-tb/board.c index f12a16aec9..f052b65071 100644 --- a/boards/e104-bt5010a-tb/board.c +++ b/boards/common/e104-bt50xxa-tb/board.c @@ -7,11 +7,11 @@ */ /** - * @ingroup boards_e104-bt5010a-tb + * @ingroup boards_common_e104-bt50xxa-tb * @{ * * @file - * @brief Board initialization for the E104-BT5010A Test Board + * @brief Board initialization for the E104-BT50xxA Test Board * * @author Benjamin Valentin * diff --git a/boards/common/e104-bt50xxa-tb/doc.txt b/boards/common/e104-bt50xxa-tb/doc.txt new file mode 100644 index 0000000000..45ee1ed771 --- /dev/null +++ b/boards/common/e104-bt50xxa-tb/doc.txt @@ -0,0 +1,6 @@ +/** + @defgroup boards_common_e104-bt50xxa-tb E104-BT50xxA-TB common code + @ingroup boards_common + @brief Support for EBYTE nRF52 module breakout boards + + */ diff --git a/boards/e104-bt5010a-tb/include/board.h b/boards/common/e104-bt50xxa-tb/include/board.h similarity index 92% rename from boards/e104-bt5010a-tb/include/board.h rename to boards/common/e104-bt50xxa-tb/include/board.h index ef3ac4fec1..058aadd643 100644 --- a/boards/e104-bt5010a-tb/include/board.h +++ b/boards/common/e104-bt50xxa-tb/include/board.h @@ -7,11 +7,11 @@ */ /** - * @ingroup boards_e104-bt5010a-tb + * @ingroup boards_common_e104-bt50xxa-tb * @{ * * @file - * @brief Board specific configuration for the E104-BT5010A Test Board + * @brief Board specific configuration for the E104-BT50xxA Test Board * * @author Benjamin Valentin */ diff --git a/boards/e104-bt5010a-tb/include/gpio_params.h b/boards/common/e104-bt50xxa-tb/include/gpio_params.h similarity index 96% rename from boards/e104-bt5010a-tb/include/gpio_params.h rename to boards/common/e104-bt50xxa-tb/include/gpio_params.h index 5beeceab94..1ef05f286d 100644 --- a/boards/e104-bt5010a-tb/include/gpio_params.h +++ b/boards/common/e104-bt50xxa-tb/include/gpio_params.h @@ -7,7 +7,7 @@ */ /** - * @ingroup boards_e104-bt5010a-tb + * @ingroup boards_common_e104-bt50xxa-tb * @{ * * @file diff --git a/boards/e104-bt5010a-tb/include/periph_conf.h b/boards/common/e104-bt50xxa-tb/include/periph_conf.h similarity index 88% rename from boards/e104-bt5010a-tb/include/periph_conf.h rename to boards/common/e104-bt50xxa-tb/include/periph_conf.h index 48a6614d37..33f8632ab9 100644 --- a/boards/e104-bt5010a-tb/include/periph_conf.h +++ b/boards/common/e104-bt50xxa-tb/include/periph_conf.h @@ -7,11 +7,11 @@ */ /** - * @ingroup boards_e104-bt5010a-tb + * @ingroup boards_common_e104-bt50xxa-tb * @{ * * @file - * @brief Peripheral configuration for the E104-BT5010A Test Board + * @brief Peripheral configuration for the E104-BT50xxA Test Board * * @author Benjamin Valentin * @@ -30,10 +30,10 @@ extern "C" { /** * @name Clock configuration - * The E104-BT5010A module does not have any external oscillators + * The E104-BT50xxA module does not have any external oscillators * @{ */ -#define CLOCK_HFCLK (0U) /* internal RC oscillator */ +#define CLOCK_HFCLK (1) /* external crystal */ #define CLOCK_LFCLK (0) /* internal RC oscillator */ /** @} */ diff --git a/boards/e104-bt5010a-tb/Kconfig b/boards/e104-bt5010a-tb/Kconfig index 6072ff6d69..b6127d2827 100644 --- a/boards/e104-bt5010a-tb/Kconfig +++ b/boards/e104-bt5010a-tb/Kconfig @@ -10,10 +10,7 @@ config BOARD config BOARD_E104_BT5010A_TB bool default y - select BOARD_COMMON_NRF52 + select BOARD_COMMON_E104_BT50XXA_TB select CPU_MODEL_NRF52810XXAA - select HAS_PERIPH_I2C - select HAS_PERIPH_SPI - select HAS_PERIPH_UART -source "$(RIOTBOARD)/common/nrf52/Kconfig" +source "$(RIOTBOARD)/common/e104-bt50xxa-tb/Kconfig" diff --git a/boards/e104-bt5010a-tb/Makefile b/boards/e104-bt5010a-tb/Makefile index 72ba6f3624..e3e754831f 100644 --- a/boards/e104-bt5010a-tb/Makefile +++ b/boards/e104-bt5010a-tb/Makefile @@ -1,2 +1,5 @@ MODULE = board + +DIRS = $(RIOTBOARD)/common/e104-bt50xxa-tb + include $(RIOTBASE)/Makefile.base diff --git a/boards/e104-bt5010a-tb/Makefile.dep b/boards/e104-bt5010a-tb/Makefile.dep index 7317b22d44..d5b015b176 100644 --- a/boards/e104-bt5010a-tb/Makefile.dep +++ b/boards/e104-bt5010a-tb/Makefile.dep @@ -1,5 +1,3 @@ -ifneq (,$(filter saul_default,$(USEMODULE))) - USEMODULE += saul_gpio -endif +USEMODULE += boards_common_e104_bt50xxa_tb -include $(RIOTBOARD)/common/nrf52/Makefile.dep +include $(RIOTBOARD)/common/e104-bt50xxa-tb/Makefile.dep diff --git a/boards/e104-bt5010a-tb/Makefile.features b/boards/e104-bt5010a-tb/Makefile.features index c8ce63bcd0..09529b5ad5 100644 --- a/boards/e104-bt5010a-tb/Makefile.features +++ b/boards/e104-bt5010a-tb/Makefile.features @@ -1,9 +1,3 @@ CPU_MODEL = nrf52810xxaa -# Put defined MCU peripherals here (in alphabetical order) -FEATURES_PROVIDED += periph_i2c -FEATURES_PROVIDED += periph_spi -FEATURES_PROVIDED += periph_rtt -FEATURES_PROVIDED += periph_uart - -include $(RIOTBOARD)/common/nrf52/Makefile.features +include $(RIOTBOARD)/common/e104-bt50xxa-tb/Makefile.features diff --git a/boards/e104-bt5010a-tb/Makefile.include b/boards/e104-bt5010a-tb/Makefile.include index a182868c3e..f3dda365ba 100644 --- a/boards/e104-bt5010a-tb/Makefile.include +++ b/boards/e104-bt5010a-tb/Makefile.include @@ -1,4 +1 @@ -# external programmer required -DEBUG_ADAPTER ?= jlink - -include $(RIOTBOARD)/common/nrf52/Makefile.include +include $(RIOTBOARD)/common/e104-bt50xxa-tb/Makefile.include From e03034eb8771f5e24994084d1f622db57be1f375 Mon Sep 17 00:00:00 2001 From: Benjamin Valentin Date: Thu, 5 Nov 2020 22:46:35 +0100 Subject: [PATCH 4/8] boards/e104-bt5011a-tb: add support for E104-BT5011A breakout board This adds support for the nRF52811 based E104-BT5011A break-out board. --- boards/e104-bt5011a-tb/Kconfig | 16 ++++++++++++ boards/e104-bt5011a-tb/Makefile | 5 ++++ boards/e104-bt5011a-tb/Makefile.dep | 3 +++ boards/e104-bt5011a-tb/Makefile.features | 3 +++ boards/e104-bt5011a-tb/Makefile.include | 1 + boards/e104-bt5011a-tb/doc.txt | 31 ++++++++++++++++++++++++ 6 files changed, 59 insertions(+) create mode 100644 boards/e104-bt5011a-tb/Kconfig create mode 100644 boards/e104-bt5011a-tb/Makefile create mode 100644 boards/e104-bt5011a-tb/Makefile.dep create mode 100644 boards/e104-bt5011a-tb/Makefile.features create mode 100644 boards/e104-bt5011a-tb/Makefile.include create mode 100644 boards/e104-bt5011a-tb/doc.txt diff --git a/boards/e104-bt5011a-tb/Kconfig b/boards/e104-bt5011a-tb/Kconfig new file mode 100644 index 0000000000..5f5134fecc --- /dev/null +++ b/boards/e104-bt5011a-tb/Kconfig @@ -0,0 +1,16 @@ +# Copyright (c) 2020 Benjamin Valentin +# +# This file is subject to the terms and conditions of the GNU Lesser +# General Public License v2.1. See the file LICENSE in the top level +# directory for more details. + +config BOARD + default "e104-bt5011a-tb" if BOARD_E104_BT5011A_TB + +config BOARD_E104_BT5011A_TB + bool + default y + select BOARD_COMMON_E104_BT50XXA_TB + select CPU_MODEL_NRF52811XXAA + +source "$(RIOTBOARD)/common/e104-bt50xxa-tb/Kconfig" diff --git a/boards/e104-bt5011a-tb/Makefile b/boards/e104-bt5011a-tb/Makefile new file mode 100644 index 0000000000..e3e754831f --- /dev/null +++ b/boards/e104-bt5011a-tb/Makefile @@ -0,0 +1,5 @@ +MODULE = board + +DIRS = $(RIOTBOARD)/common/e104-bt50xxa-tb + +include $(RIOTBASE)/Makefile.base diff --git a/boards/e104-bt5011a-tb/Makefile.dep b/boards/e104-bt5011a-tb/Makefile.dep new file mode 100644 index 0000000000..d5b015b176 --- /dev/null +++ b/boards/e104-bt5011a-tb/Makefile.dep @@ -0,0 +1,3 @@ +USEMODULE += boards_common_e104_bt50xxa_tb + +include $(RIOTBOARD)/common/e104-bt50xxa-tb/Makefile.dep diff --git a/boards/e104-bt5011a-tb/Makefile.features b/boards/e104-bt5011a-tb/Makefile.features new file mode 100644 index 0000000000..dd2fe05539 --- /dev/null +++ b/boards/e104-bt5011a-tb/Makefile.features @@ -0,0 +1,3 @@ +CPU_MODEL = nrf52811xxaa + +include $(RIOTBOARD)/common/e104-bt50xxa-tb/Makefile.features diff --git a/boards/e104-bt5011a-tb/Makefile.include b/boards/e104-bt5011a-tb/Makefile.include new file mode 100644 index 0000000000..f3dda365ba --- /dev/null +++ b/boards/e104-bt5011a-tb/Makefile.include @@ -0,0 +1 @@ +include $(RIOTBOARD)/common/e104-bt50xxa-tb/Makefile.include diff --git a/boards/e104-bt5011a-tb/doc.txt b/boards/e104-bt5011a-tb/doc.txt new file mode 100644 index 0000000000..21e4d4fab4 --- /dev/null +++ b/boards/e104-bt5011a-tb/doc.txt @@ -0,0 +1,31 @@ +/** +@defgroup boards_e104-bt5011a-tb E104-BT5011A Test Board +@ingroup boards +@brief Support for the Ebyte E104-BT5011A Test Board (nRF52811) + +## General information + +The E104-BT5011A Test Board is a cheap break-out board for the E104-BT5011A module. +It's based on the nRF52811 and by default comes with a Firmware that accepts AT +commands over UART, but it can be flashed with RIOT easily. + + - [Module Datasheet](http://www.ebyte.com/en/downpdf.aspx?id=1074) + - [Module Website](http://www.ebyte.com/en/product-view-news.aspx?id=1074) + +## Flashing the board + +To flash the board, you have to connect a SWD programmer to the pins labeled SWDIO and +SWCLK. Also make sure to connect GND. +P0.21 is Reset. + +## Accessing STDIO via UART + +The STDIO is directly accessible via the USB port. On a Linux host, it's +generally mapped to `/dev/ttyUSB0`. + +Use the `term` target to connect to the board serial port
+``` + make BOARD=e104-bt5011a-tb -C examples/hello-world term +``` + + */ From c27ea1afa1707a8461c66f5b4a4c07e947608519 Mon Sep 17 00:00:00 2001 From: Benjamin Valentin Date: Thu, 5 Nov 2020 23:11:38 +0100 Subject: [PATCH 5/8] examples, tests: add e104-bt5011a-tb to Makefile.ci --- examples/dtls-sock/Makefile.ci | 1 + examples/javascript/Makefile.ci | 1 + examples/lua_REPL/Makefile.ci | 1 + examples/suit_update/Makefile.ci | 1 + tests/bench_xtimer/Makefile | 1 + tests/gnrc_dhcpv6_client_6lbr/Makefile.ci | 2 ++ tests/gnrc_netif/Makefile.ci | 2 ++ tests/nimble_autoconn_ccnl/Makefile.ci | 1 + tests/nimble_autoconn_gnrc/Makefile.ci | 1 + tests/nimble_l2cap/Makefile.ci | 1 + tests/nimble_l2cap_server/Makefile.ci | 1 + tests/nimble_statconn_gnrc/Makefile.ci | 1 + tests/pkg_tinydtls_sock_async/Makefile.ci | 1 + tests/unittests/Makefile.ci | 1 + 14 files changed, 16 insertions(+) diff --git a/examples/dtls-sock/Makefile.ci b/examples/dtls-sock/Makefile.ci index bd5cd8c793..b2190a0c67 100644 --- a/examples/dtls-sock/Makefile.ci +++ b/examples/dtls-sock/Makefile.ci @@ -8,6 +8,7 @@ BOARD_INSUFFICIENT_MEMORY := \ calliope-mini \ cc2650-launchpad \ cc2650stk \ + e104-bt5011a-tb \ hifive1 \ hifive1b \ i-nucleo-lrwan1 \ diff --git a/examples/javascript/Makefile.ci b/examples/javascript/Makefile.ci index 3708e29680..1a4e2aad54 100644 --- a/examples/javascript/Makefile.ci +++ b/examples/javascript/Makefile.ci @@ -9,6 +9,7 @@ BOARD_INSUFFICIENT_MEMORY := \ cc2650-launchpad \ cc2650stk \ e104-bt5010a-tb \ + e104-bt5011a-tb \ hifive1 \ hifive1b \ i-nucleo-lrwan1 \ diff --git a/examples/lua_REPL/Makefile.ci b/examples/lua_REPL/Makefile.ci index 17d44fcf57..2b4d746a19 100644 --- a/examples/lua_REPL/Makefile.ci +++ b/examples/lua_REPL/Makefile.ci @@ -16,6 +16,7 @@ BOARD_INSUFFICIENT_MEMORY := \ cc2650-launchpad \ cc2650stk \ e104-bt5010a-tb \ + e104-bt5011a-tb \ e180-zg120b-tb \ ek-lm4f120xl \ esp8266-esp-12x \ diff --git a/examples/suit_update/Makefile.ci b/examples/suit_update/Makefile.ci index 772c0602b4..621176c6cc 100644 --- a/examples/suit_update/Makefile.ci +++ b/examples/suit_update/Makefile.ci @@ -6,6 +6,7 @@ BOARD_INSUFFICIENT_MEMORY := \ atmega328p \ b-l072z-lrwan1 \ e104-bt5010a-tb \ + e104-bt5011a-tb \ lsn50 \ msb-430 \ msb-430h \ diff --git a/tests/bench_xtimer/Makefile b/tests/bench_xtimer/Makefile index 35a472d3bd..54ed7e4698 100644 --- a/tests/bench_xtimer/Makefile +++ b/tests/bench_xtimer/Makefile @@ -24,6 +24,7 @@ LOW_MEMORY_BOARDS += \ cc2650-launchpad \ cc2650stk \ e104-bt5010a-tb \ + e104-bt5011a-tb \ derfmega128 \ feather-m0 \ feather-m0-lora \ diff --git a/tests/gnrc_dhcpv6_client_6lbr/Makefile.ci b/tests/gnrc_dhcpv6_client_6lbr/Makefile.ci index 321f5fd833..44b76da484 100644 --- a/tests/gnrc_dhcpv6_client_6lbr/Makefile.ci +++ b/tests/gnrc_dhcpv6_client_6lbr/Makefile.ci @@ -16,6 +16,8 @@ BOARD_INSUFFICIENT_MEMORY := \ cc2650-launchpad \ cc2650stk \ derfmega128 \ + e104-bt5010a-tb \ + e104-bt5011a-tb \ hifive1 \ hifive1b \ i-nucleo-lrwan1 \ diff --git a/tests/gnrc_netif/Makefile.ci b/tests/gnrc_netif/Makefile.ci index 510de453d8..37bc984ab2 100644 --- a/tests/gnrc_netif/Makefile.ci +++ b/tests/gnrc_netif/Makefile.ci @@ -16,6 +16,8 @@ BOARD_INSUFFICIENT_MEMORY := \ cc2650-launchpad \ cc2650stk \ derfmega128 \ + e104-bt5010a-tb \ + e104-bt5011a-tb \ hifive1 \ hifive1b \ i-nucleo-lrwan1 \ diff --git a/tests/nimble_autoconn_ccnl/Makefile.ci b/tests/nimble_autoconn_ccnl/Makefile.ci index 2db5b3eff7..4079597a0f 100644 --- a/tests/nimble_autoconn_ccnl/Makefile.ci +++ b/tests/nimble_autoconn_ccnl/Makefile.ci @@ -1,3 +1,4 @@ BOARD_INSUFFICIENT_MEMORY := \ e104-bt5010a-tb \ + e104-bt5011a-tb \ # diff --git a/tests/nimble_autoconn_gnrc/Makefile.ci b/tests/nimble_autoconn_gnrc/Makefile.ci index 2db5b3eff7..4079597a0f 100644 --- a/tests/nimble_autoconn_gnrc/Makefile.ci +++ b/tests/nimble_autoconn_gnrc/Makefile.ci @@ -1,3 +1,4 @@ BOARD_INSUFFICIENT_MEMORY := \ e104-bt5010a-tb \ + e104-bt5011a-tb \ # diff --git a/tests/nimble_l2cap/Makefile.ci b/tests/nimble_l2cap/Makefile.ci index 2db5b3eff7..4079597a0f 100644 --- a/tests/nimble_l2cap/Makefile.ci +++ b/tests/nimble_l2cap/Makefile.ci @@ -1,3 +1,4 @@ BOARD_INSUFFICIENT_MEMORY := \ e104-bt5010a-tb \ + e104-bt5011a-tb \ # diff --git a/tests/nimble_l2cap_server/Makefile.ci b/tests/nimble_l2cap_server/Makefile.ci index 2db5b3eff7..4079597a0f 100644 --- a/tests/nimble_l2cap_server/Makefile.ci +++ b/tests/nimble_l2cap_server/Makefile.ci @@ -1,3 +1,4 @@ BOARD_INSUFFICIENT_MEMORY := \ e104-bt5010a-tb \ + e104-bt5011a-tb \ # diff --git a/tests/nimble_statconn_gnrc/Makefile.ci b/tests/nimble_statconn_gnrc/Makefile.ci index 2db5b3eff7..4079597a0f 100644 --- a/tests/nimble_statconn_gnrc/Makefile.ci +++ b/tests/nimble_statconn_gnrc/Makefile.ci @@ -1,3 +1,4 @@ BOARD_INSUFFICIENT_MEMORY := \ e104-bt5010a-tb \ + e104-bt5011a-tb \ # diff --git a/tests/pkg_tinydtls_sock_async/Makefile.ci b/tests/pkg_tinydtls_sock_async/Makefile.ci index bd5cd8c793..b2190a0c67 100644 --- a/tests/pkg_tinydtls_sock_async/Makefile.ci +++ b/tests/pkg_tinydtls_sock_async/Makefile.ci @@ -8,6 +8,7 @@ BOARD_INSUFFICIENT_MEMORY := \ calliope-mini \ cc2650-launchpad \ cc2650stk \ + e104-bt5011a-tb \ hifive1 \ hifive1b \ i-nucleo-lrwan1 \ diff --git a/tests/unittests/Makefile.ci b/tests/unittests/Makefile.ci index c2324e90cc..ef79c4e285 100644 --- a/tests/unittests/Makefile.ci +++ b/tests/unittests/Makefile.ci @@ -27,6 +27,7 @@ BOARD_INSUFFICIENT_MEMORY := \ derfmega128 \ derfmega256 \ e104-bt5010a-tb \ + e104-bt5011a-tb \ e180-zg120b-tb \ ek-lm4f120xl \ esp8266-esp-12x \ From 345e0bf063047dbd961e8f4f0709a2d75b309d52 Mon Sep 17 00:00:00 2001 From: Benjamin Valentin Date: Fri, 6 Nov 2020 10:22:09 +0100 Subject: [PATCH 6/8] boards/e104-bt5010a-tb: default to nrfmin nimble is too large for the board. --- boards/e104-bt5010a-tb/Makefile.dep | 2 ++ 1 file changed, 2 insertions(+) diff --git a/boards/e104-bt5010a-tb/Makefile.dep b/boards/e104-bt5010a-tb/Makefile.dep index d5b015b176..45f77b84c5 100644 --- a/boards/e104-bt5010a-tb/Makefile.dep +++ b/boards/e104-bt5010a-tb/Makefile.dep @@ -1,3 +1,5 @@ USEMODULE += boards_common_e104_bt50xxa_tb +# use nrfmin for GNRC as nimble is too large for the board +include $(RIOTBOARD)/common/nrf52/Makefile.nrfmin.dep include $(RIOTBOARD)/common/e104-bt50xxa-tb/Makefile.dep From 5f4afe12f1790609fbb190baed44738d0c208092 Mon Sep 17 00:00:00 2001 From: Benjamin Valentin Date: Fri, 6 Nov 2020 11:14:45 +0100 Subject: [PATCH 7/8] examples, tests: add e104-bt5010a-tb to Makefile.ci --- examples/dtls-sock/Makefile.ci | 1 + tests/pkg_tinydtls_sock_async/Makefile.ci | 1 + 2 files changed, 2 insertions(+) diff --git a/examples/dtls-sock/Makefile.ci b/examples/dtls-sock/Makefile.ci index b2190a0c67..e049ad4f2e 100644 --- a/examples/dtls-sock/Makefile.ci +++ b/examples/dtls-sock/Makefile.ci @@ -8,6 +8,7 @@ BOARD_INSUFFICIENT_MEMORY := \ calliope-mini \ cc2650-launchpad \ cc2650stk \ + e104-bt5010a-tb \ e104-bt5011a-tb \ hifive1 \ hifive1b \ diff --git a/tests/pkg_tinydtls_sock_async/Makefile.ci b/tests/pkg_tinydtls_sock_async/Makefile.ci index b2190a0c67..e049ad4f2e 100644 --- a/tests/pkg_tinydtls_sock_async/Makefile.ci +++ b/tests/pkg_tinydtls_sock_async/Makefile.ci @@ -8,6 +8,7 @@ BOARD_INSUFFICIENT_MEMORY := \ calliope-mini \ cc2650-launchpad \ cc2650stk \ + e104-bt5010a-tb \ e104-bt5011a-tb \ hifive1 \ hifive1b \ From 0b83589bbc1ad9438714c5c023314adcd9096e47 Mon Sep 17 00:00:00 2001 From: Benjamin Valentin Date: Tue, 24 Nov 2020 23:09:42 +0100 Subject: [PATCH 8/8] boards/common/e104-bt50xxa-tb: enable software reset --- boards/common/e104-bt50xxa-tb/Makefile.dep | 7 +++++++ boards/common/e104-bt50xxa-tb/board.c | 9 +++++++++ .../common/e104-bt50xxa-tb/include/gpio_params.h | 14 ++++++++------ makefiles/pseudomodules.inc.mk | 1 + 4 files changed, 25 insertions(+), 6 deletions(-) diff --git a/boards/common/e104-bt50xxa-tb/Makefile.dep b/boards/common/e104-bt50xxa-tb/Makefile.dep index 7317b22d44..e3cbcd8cbe 100644 --- a/boards/common/e104-bt50xxa-tb/Makefile.dep +++ b/boards/common/e104-bt50xxa-tb/Makefile.dep @@ -2,4 +2,11 @@ ifneq (,$(filter saul_default,$(USEMODULE))) USEMODULE += saul_gpio endif +# used for software reset +ifneq (,$(filter board_software_reset,$(USEMODULE))) + FEATURES_REQUIRED += periph_gpio_irq +endif + +DEFAULT_MODULE += board_software_reset + include $(RIOTBOARD)/common/nrf52/Makefile.dep diff --git a/boards/common/e104-bt50xxa-tb/board.c b/boards/common/e104-bt50xxa-tb/board.c index f052b65071..0ecfbcbb2b 100644 --- a/boards/common/e104-bt50xxa-tb/board.c +++ b/boards/common/e104-bt50xxa-tb/board.c @@ -20,6 +20,9 @@ #include "cpu.h" #include "board.h" +#include "periph/gpio.h" + +extern void pm_reboot(void*); void board_init(void) { @@ -27,6 +30,12 @@ void board_init(void) LED_PORT->DIRSET = (LED_MASK); LED_PORT->OUTSET = (LED_MASK); + /* configure software RST button */ +#ifdef MODULE_BOARD_SOFTWARE_RESET + gpio_init_int(BTN0_PIN, BTN0_MODE, GPIO_FALLING, + pm_reboot, NULL); +#endif + /* initialize the CPU */ cpu_init(); } diff --git a/boards/common/e104-bt50xxa-tb/include/gpio_params.h b/boards/common/e104-bt50xxa-tb/include/gpio_params.h index 1ef05f286d..ae47cc6d2c 100644 --- a/boards/common/e104-bt50xxa-tb/include/gpio_params.h +++ b/boards/common/e104-bt50xxa-tb/include/gpio_params.h @@ -43,18 +43,20 @@ static const saul_gpio_params_t saul_gpio_params[] = .mode = GPIO_OUT, .flags = SAUL_GPIO_INVERTED, }, - { - .name = "BTN (RTS)", - .pin = BTN0_PIN, - .mode = BTN0_MODE, - .flags = SAUL_GPIO_INVERTED, - }, { .name = "BTN (DBG)", .pin = BTN1_PIN, .mode = BTN1_MODE, .flags = SAUL_GPIO_INVERTED, }, +#ifndef MODULE_BOARD_SOFTWARE_RESET + { + .name = "BTN (RST)", + .pin = BTN0_PIN, + .mode = BTN0_MODE, + .flags = SAUL_GPIO_INVERTED, + }, +#endif }; #ifdef __cplusplus diff --git a/makefiles/pseudomodules.inc.mk b/makefiles/pseudomodules.inc.mk index 022308340d..2189478957 100644 --- a/makefiles/pseudomodules.inc.mk +++ b/makefiles/pseudomodules.inc.mk @@ -6,6 +6,7 @@ PSEUDOMODULES += at_urc_isr_highest PSEUDOMODULES += at24c% PSEUDOMODULES += atomic_utils PSEUDOMODULES += base64url +PSEUDOMODULES += board_software_reset PSEUDOMODULES += can_mbox PSEUDOMODULES += can_pm PSEUDOMODULES += can_raw