From d5690ee4cdc2288b32c14990452fabf8143d1d7f Mon Sep 17 00:00:00 2001 From: Benjamin Valentin Date: Thu, 9 Jul 2020 21:41:39 +0200 Subject: [PATCH] boards/e104-bt5010a-tb: add support for the E104-BT5010A Test Board This adds support for the nRF52810 based E104-BT5010A break-out board. --- boards/e104-bt5010a-tb/Kconfig | 19 ++++ boards/e104-bt5010a-tb/Makefile | 2 + boards/e104-bt5010a-tb/Makefile.dep | 5 + boards/e104-bt5010a-tb/Makefile.features | 9 ++ boards/e104-bt5010a-tb/Makefile.include | 4 + boards/e104-bt5010a-tb/board.c | 32 +++++++ boards/e104-bt5010a-tb/doc.txt | 31 +++++++ boards/e104-bt5010a-tb/include/board.h | 64 +++++++++++++ boards/e104-bt5010a-tb/include/gpio_params.h | 65 +++++++++++++ boards/e104-bt5010a-tb/include/periph_conf.h | 97 ++++++++++++++++++++ examples/javascript/Makefile.ci | 1 + examples/lua_REPL/Makefile.ci | 1 + examples/suit_update/Makefile.ci | 1 + tests/bench_xtimer/Makefile | 1 + tests/nimble_autoconn_ccnl/Makefile.ci | 3 + tests/nimble_autoconn_gnrc/Makefile.ci | 3 + tests/nimble_l2cap/Makefile.ci | 3 + tests/nimble_l2cap_server/Makefile.ci | 3 + tests/nimble_statconn_gnrc/Makefile.ci | 3 + tests/unittests/Makefile.ci | 1 + 20 files changed, 348 insertions(+) create mode 100644 boards/e104-bt5010a-tb/Kconfig create mode 100644 boards/e104-bt5010a-tb/Makefile create mode 100644 boards/e104-bt5010a-tb/Makefile.dep create mode 100644 boards/e104-bt5010a-tb/Makefile.features create mode 100644 boards/e104-bt5010a-tb/Makefile.include create mode 100644 boards/e104-bt5010a-tb/board.c create mode 100644 boards/e104-bt5010a-tb/doc.txt create mode 100644 boards/e104-bt5010a-tb/include/board.h create mode 100644 boards/e104-bt5010a-tb/include/gpio_params.h create mode 100644 boards/e104-bt5010a-tb/include/periph_conf.h create mode 100644 tests/nimble_autoconn_ccnl/Makefile.ci create mode 100644 tests/nimble_autoconn_gnrc/Makefile.ci create mode 100644 tests/nimble_l2cap/Makefile.ci create mode 100644 tests/nimble_l2cap_server/Makefile.ci create mode 100644 tests/nimble_statconn_gnrc/Makefile.ci diff --git a/boards/e104-bt5010a-tb/Kconfig b/boards/e104-bt5010a-tb/Kconfig new file mode 100644 index 0000000000..6072ff6d69 --- /dev/null +++ b/boards/e104-bt5010a-tb/Kconfig @@ -0,0 +1,19 @@ +# 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-bt5010a-tb" if BOARD_E104_BT5010A_TB + +config BOARD_E104_BT5010A_TB + bool + default y + select BOARD_COMMON_NRF52 + select CPU_MODEL_NRF52810XXAA + select HAS_PERIPH_I2C + select HAS_PERIPH_SPI + select HAS_PERIPH_UART + +source "$(RIOTBOARD)/common/nrf52/Kconfig" diff --git a/boards/e104-bt5010a-tb/Makefile b/boards/e104-bt5010a-tb/Makefile new file mode 100644 index 0000000000..72ba6f3624 --- /dev/null +++ b/boards/e104-bt5010a-tb/Makefile @@ -0,0 +1,2 @@ +MODULE = board +include $(RIOTBASE)/Makefile.base diff --git a/boards/e104-bt5010a-tb/Makefile.dep b/boards/e104-bt5010a-tb/Makefile.dep new file mode 100644 index 0000000000..7317b22d44 --- /dev/null +++ b/boards/e104-bt5010a-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/e104-bt5010a-tb/Makefile.features b/boards/e104-bt5010a-tb/Makefile.features new file mode 100644 index 0000000000..c8ce63bcd0 --- /dev/null +++ b/boards/e104-bt5010a-tb/Makefile.features @@ -0,0 +1,9 @@ +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 diff --git a/boards/e104-bt5010a-tb/Makefile.include b/boards/e104-bt5010a-tb/Makefile.include new file mode 100644 index 0000000000..a182868c3e --- /dev/null +++ b/boards/e104-bt5010a-tb/Makefile.include @@ -0,0 +1,4 @@ +# external programmer required +DEBUG_ADAPTER ?= jlink + +include $(RIOTBOARD)/common/nrf52/Makefile.include diff --git a/boards/e104-bt5010a-tb/board.c b/boards/e104-bt5010a-tb/board.c new file mode 100644 index 0000000000..f12a16aec9 --- /dev/null +++ b/boards/e104-bt5010a-tb/board.c @@ -0,0 +1,32 @@ +/* + * 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. + */ + +/** + * @ingroup boards_e104-bt5010a-tb + * @{ + * + * @file + * @brief Board initialization for the E104-BT5010A Test Board + * + * @author Benjamin Valentin + * + * @} + */ + +#include "cpu.h" +#include "board.h" + +void board_init(void) +{ + /* initialize the boards LEDs */ + LED_PORT->DIRSET = (LED_MASK); + LED_PORT->OUTSET = (LED_MASK); + + /* initialize the CPU */ + cpu_init(); +} diff --git a/boards/e104-bt5010a-tb/doc.txt b/boards/e104-bt5010a-tb/doc.txt new file mode 100644 index 0000000000..6324094b67 --- /dev/null +++ b/boards/e104-bt5010a-tb/doc.txt @@ -0,0 +1,31 @@ +/** +@defgroup boards_e104-bt5010a-tb E104-BT5010A Test Board +@ingroup boards +@brief Support for the Ebyte E104-BT5010A Test Board (nRF52810) + +## General information + +The E104-BT5010A Test Board is a cheap break-out board for the E104-BT5010A module. +It's based on the nRF52810 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=832) + - [Module Website](http://www.ebyte.com/en/product-view-news.aspx?id=832) + +## 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-bt5010a-tb -C examples/hello-world term +``` + + */ diff --git a/boards/e104-bt5010a-tb/include/board.h b/boards/e104-bt5010a-tb/include/board.h new file mode 100644 index 0000000000..ef3ac4fec1 --- /dev/null +++ b/boards/e104-bt5010a-tb/include/board.h @@ -0,0 +1,64 @@ +/* + * 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. + */ + +/** + * @ingroup boards_e104-bt5010a-tb + * @{ + * + * @file + * @brief Board specific configuration for the E104-BT5010A Test Board + * + * @author Benjamin Valentin + */ + +#ifndef BOARD_H +#define BOARD_H + +#include "board_common.h" + +#ifdef __cplusplus +extern "C" { +#endif + +/** + * @name LED pin configuration + * @{ + */ +#define LED0_PIN GPIO_PIN(0, 30) +#define LED1_PIN GPIO_PIN(0, 31) + +#define LED_PORT (NRF_P0) +#define LED0_MASK (1 << 30) +#define LED1_MASK (1 << 31) +#define LED_MASK (LED0_MASK | LED1_MASK) + +#define LED0_ON (LED_PORT->OUTCLR = LED0_MASK) +#define LED0_OFF (LED_PORT->OUTSET = LED0_MASK) +#define LED0_TOGGLE (LED_PORT->OUT ^= LED0_MASK) + +#define LED1_ON (LED_PORT->OUTCLR = LED1_MASK) +#define LED1_OFF (LED_PORT->OUTSET = LED1_MASK) +#define LED1_TOGGLE (LED_PORT->OUT ^= LED1_MASK) +/** @} */ + +/** + * @name Button pin configuration + * @{ + */ +#define BTN0_PIN GPIO_PIN(0, 21) +#define BTN0_MODE GPIO_IN_PU +#define BTN1_PIN GPIO_PIN(0, 29) +#define BTN1_MODE GPIO_IN_PU +/** @} */ + +#ifdef __cplusplus +} +#endif + +#endif /* BOARD_H */ +/** @} */ diff --git a/boards/e104-bt5010a-tb/include/gpio_params.h b/boards/e104-bt5010a-tb/include/gpio_params.h new file mode 100644 index 0000000000..5beeceab94 --- /dev/null +++ b/boards/e104-bt5010a-tb/include/gpio_params.h @@ -0,0 +1,65 @@ +/* + * 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. + */ + +/** + * @ingroup boards_e104-bt5010a-tb + * @{ + * + * @file + * @brief Board specific configuration of direct mapped GPIOs + * + * @author Benjamin Valentin + */ + +#ifndef GPIO_PARAMS_H +#define GPIO_PARAMS_H + +#include "board.h" +#include "saul/periph.h" + +#ifdef __cplusplus +extern "C" { +#endif + +/** + * @brief GPIO pin configuration + */ +static const saul_gpio_params_t saul_gpio_params[] = +{ + { + .name = "LED (link)", + .pin = LED0_PIN, + .mode = GPIO_OUT, + .flags = SAUL_GPIO_INVERTED, + }, + { + .name = "LED (data)", + .pin = LED1_PIN, + .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, + }, +}; + +#ifdef __cplusplus +} +#endif + +#endif /* GPIO_PARAMS_H */ +/** @} */ diff --git a/boards/e104-bt5010a-tb/include/periph_conf.h b/boards/e104-bt5010a-tb/include/periph_conf.h new file mode 100644 index 0000000000..48a6614d37 --- /dev/null +++ b/boards/e104-bt5010a-tb/include/periph_conf.h @@ -0,0 +1,97 @@ +/* + * 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. + */ + +/** + * @ingroup boards_e104-bt5010a-tb + * @{ + * + * @file + * @brief Peripheral configuration for the E104-BT5010A Test Board + * + * @author Benjamin Valentin + * + */ + +#ifndef PERIPH_CONF_H +#define PERIPH_CONF_H + +#include "periph_cpu.h" +#include "cfg_rtt_default.h" +#include "cfg_timer_default.h" + +#ifdef __cplusplus +extern "C" { +#endif + +/** + * @name Clock configuration + * The E104-BT5010A module does not have any external oscillators + * @{ + */ +#define CLOCK_HFCLK (0U) /* internal RC oscillator */ +#define CLOCK_LFCLK (0) /* internal RC oscillator */ +/** @} */ + +/** + * @name SPI configuration + * @{ + */ +static const spi_conf_t spi_config[] = { + { + .dev = NRF_SPIM0, + .sclk = GPIO_PIN(0, 26), + .mosi = GPIO_PIN(0, 27), + .miso = GPIO_PIN(0, 28), + }, +}; +#define SPI_NUMOF ARRAY_SIZE(spi_config) +/** @} */ + +/** + * @name I2C configuration + * @{ + */ +static const i2c_conf_t i2c_config[] = { + { + .dev = NRF_TWIM0, + .scl = GPIO_PIN(0, 6), + .sda = GPIO_PIN(0, 7), + .speed = I2C_SPEED_NORMAL + } +}; +#define I2C_NUMOF ARRAY_SIZE(i2c_config) +/** @} */ + +/** + * @name UART configuration + * @{ + */ +static const uart_conf_t uart_config[] = { + { /* Mapped to USB virtual COM port */ + .dev = NRF_UARTE0, + .rx_pin = GPIO_PIN(0,14), + .tx_pin = GPIO_PIN(0,18), +#ifdef MODULE_PERIPH_UART_HW_FC + .rts_pin = GPIO_UNDEF, + .cts_pin = GPIO_UNDEF, +#endif + .irqn = UARTE0_UART0_IRQn, + }, +}; + +#define UART_0_ISR (isr_uart0) + +#define UART_NUMOF ARRAY_SIZE(uart_config) +/** @} */ + +#ifdef __cplusplus +} +#endif + +#endif /* PERIPH_CONF_H */ +/** @} */ diff --git a/examples/javascript/Makefile.ci b/examples/javascript/Makefile.ci index cf65ced6c3..1013d6a9fb 100644 --- a/examples/javascript/Makefile.ci +++ b/examples/javascript/Makefile.ci @@ -8,6 +8,7 @@ BOARD_INSUFFICIENT_MEMORY := \ calliope-mini \ cc2650-launchpad \ cc2650stk \ + e104-bt5010a-tb \ hifive1 \ hifive1b \ i-nucleo-lrwan1 \ diff --git a/examples/lua_REPL/Makefile.ci b/examples/lua_REPL/Makefile.ci index a9bcae0de7..1f29777222 100644 --- a/examples/lua_REPL/Makefile.ci +++ b/examples/lua_REPL/Makefile.ci @@ -14,6 +14,7 @@ BOARD_INSUFFICIENT_MEMORY := \ cc2538dk \ cc2650-launchpad \ cc2650stk \ + e104-bt5010a-tb \ ek-lm4f120xl \ esp8266-esp-12x \ esp8266-olimex-mod \ diff --git a/examples/suit_update/Makefile.ci b/examples/suit_update/Makefile.ci index 0ef84d7eba..67ec0f98e9 100644 --- a/examples/suit_update/Makefile.ci +++ b/examples/suit_update/Makefile.ci @@ -5,6 +5,7 @@ BOARD_INSUFFICIENT_MEMORY := \ arduino-uno \ atmega328p \ b-l072z-lrwan1 \ + e104-bt5010a-tb \ lsn50 \ msb-430 \ msb-430h \ diff --git a/tests/bench_xtimer/Makefile b/tests/bench_xtimer/Makefile index d64617dba6..634fda091e 100644 --- a/tests/bench_xtimer/Makefile +++ b/tests/bench_xtimer/Makefile @@ -22,6 +22,7 @@ LOW_MEMORY_BOARDS += \ cc1352-launchpad \ cc2650-launchpad \ cc2650stk \ + e104-bt5010a-tb \ derfmega128 \ feather-m0 \ feather-m0-wifi \ diff --git a/tests/nimble_autoconn_ccnl/Makefile.ci b/tests/nimble_autoconn_ccnl/Makefile.ci new file mode 100644 index 0000000000..2db5b3eff7 --- /dev/null +++ b/tests/nimble_autoconn_ccnl/Makefile.ci @@ -0,0 +1,3 @@ +BOARD_INSUFFICIENT_MEMORY := \ + e104-bt5010a-tb \ + # diff --git a/tests/nimble_autoconn_gnrc/Makefile.ci b/tests/nimble_autoconn_gnrc/Makefile.ci new file mode 100644 index 0000000000..2db5b3eff7 --- /dev/null +++ b/tests/nimble_autoconn_gnrc/Makefile.ci @@ -0,0 +1,3 @@ +BOARD_INSUFFICIENT_MEMORY := \ + e104-bt5010a-tb \ + # diff --git a/tests/nimble_l2cap/Makefile.ci b/tests/nimble_l2cap/Makefile.ci new file mode 100644 index 0000000000..2db5b3eff7 --- /dev/null +++ b/tests/nimble_l2cap/Makefile.ci @@ -0,0 +1,3 @@ +BOARD_INSUFFICIENT_MEMORY := \ + e104-bt5010a-tb \ + # diff --git a/tests/nimble_l2cap_server/Makefile.ci b/tests/nimble_l2cap_server/Makefile.ci new file mode 100644 index 0000000000..2db5b3eff7 --- /dev/null +++ b/tests/nimble_l2cap_server/Makefile.ci @@ -0,0 +1,3 @@ +BOARD_INSUFFICIENT_MEMORY := \ + e104-bt5010a-tb \ + # diff --git a/tests/nimble_statconn_gnrc/Makefile.ci b/tests/nimble_statconn_gnrc/Makefile.ci new file mode 100644 index 0000000000..2db5b3eff7 --- /dev/null +++ b/tests/nimble_statconn_gnrc/Makefile.ci @@ -0,0 +1,3 @@ +BOARD_INSUFFICIENT_MEMORY := \ + e104-bt5010a-tb \ + # diff --git a/tests/unittests/Makefile.ci b/tests/unittests/Makefile.ci index ee863e23c8..5b3a9feacd 100644 --- a/tests/unittests/Makefile.ci +++ b/tests/unittests/Makefile.ci @@ -22,6 +22,7 @@ BOARD_INSUFFICIENT_MEMORY := \ cc2650stk \ derfmega128 \ derfmega256 \ + e104-bt5010a-tb \ ek-lm4f120xl \ esp8266-esp-12x \ esp8266-olimex-mod \