boards: arm: add ruuvi_ruuvitag

Adds ARM based Ruuvtag baord. This board is based on the nRF52832.

Signed-off-by: the BASTION <thebasti0ncode@gmail.com>
This commit is contained in:
the BASTION 2020-06-17 14:26:14 +08:00 committed by Ioannis Glaropoulos
commit 3f5a32a7d4
12 changed files with 405 additions and 1 deletions

View file

@ -0,0 +1,10 @@
# Ruuvi-RuuviTag board configuration
# Copyright (c) 2020 Ruuvi Innovations Ltd (Oy)
# SPDX-License-Identifier: Apache-2.0
config BOARD_ENABLE_DCDC
bool "Enable DCDC mode"
select SOC_DCDC_NRF52X
default y
depends on BOARD_RUUVI_RUUVITAG

View file

@ -0,0 +1,6 @@
# Copyright (c) 2020 Ruuvi Innovations Ltd (Oy)
# SPDX-License-Identifier: Apache-2.0
config BOARD_RUUVI_RUUVITAG
bool "Ruuvi-RuuviTag"
depends on SOC_NRF52832_QFAA

View file

@ -0,0 +1,17 @@
# Ruuvi RuuviTag configuration
# Copyright (c) 2020 Ruuvi Innovations Ltd (Oy)
# SPDX-License-Identifier: Apache-2.0
if BOARD_RUUVI_RUUVITAG
config BOARD
default "ruuvi_ruuvitag"
config SPI
default y
config BT_CTLR
default BT
endif # BOARD_RUUVI_RUUVITAG

View file

@ -0,0 +1,7 @@
# Copyright (c) 2020 Ruuvi Innovations Ltd (Oy)
# SPDX-License-Identifier: Apache-2.0
board_runner_args(nrfjprog "--nrf-family=NRF52")
board_runner_args(jlink "--device=nrf52" "--speed=4000")
include(${ZEPHYR_BASE}/boards/common/nrfjprog.board.cmake)
include(${ZEPHYR_BASE}/boards/common/jlink.board.cmake)

Binary file not shown.

After

Width:  |  Height:  |  Size: 182 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 52 KiB

View file

@ -0,0 +1,186 @@
.. _ruuvi_ruuvitag:
ruuvi-ruuvitag
##############
Overview
********
RuuviTag is an advanced battery-operated open-source Bluetooth
enabled sensor beacon platform capable of sending temperature, humidity,
pressure, and motion information over Bluetooth Low Energy.
.. figure:: img/ruuvitag.jpg
:width: 442px
:align: center
:alt: RUUVI RuuviTag
RUUVI RuuviTag (Credit: https://ruuvi.com/)
More information about the board can be found at the
`ruuvitag website`_.
Hardware
********
RuuviTag's have the following physical features:
* Nordic Semiconductor nRF52832 System-on-Chip
* STMicroelectronics LIS2DH12 accelerometer
* Bosch BME 280 temperature + relative air humidity + air pressure sensor
* NFC™-A tag antenna
* 1000mAh CR2477 battery
* 2 buttons
* 1 Green LED
* 1 Red LED
* IP67 Enclosure
* Long range RF antenna
Supported Features
==================
+-----------+------------+----------------------+
| Interface | Controller | Driver/Component |
+===========+============+======================+
| ADC | on-chip | adc |
+-----------+------------+----------------------+
| CLOCK | on-chip | clock_control |
+-----------+------------+----------------------+
| FLASH | on-chip | flash |
+-----------+------------+----------------------+
| GPIO | on-chip | gpio |
+-----------+------------+----------------------+
| MPU | on-chip | arch/arm |
+-----------+------------+----------------------+
| NVIC | on-chip | arch/arm |
+-----------+------------+----------------------+
| RADIO | on-chip | Bluetooth |
+-----------+------------+----------------------+
| RTC | on-chip | system clock |
+-----------+------------+----------------------+
| SPI | on-chip | spi |
+-----------+------------+----------------------+
| UART | on-chip | serial |
+-----------+------------+----------------------+
| WDT | on-chip | watchdog |
+-----------+------------+----------------------+
| Humidity, | on-board | bme280 |
| Temp & Air| | |
| Pressure | | |
+-----------+------------+----------------------+
| Acc | on-board | lis2dh12 |
+-----------+------------+----------------------+
Connections and IOs
===================
LED
---
* LED0 (red) = P0.17
* LED1 (green) = P0.19
Push buttons
------------
* BUTTON0 = SW1 = P0.13
Pin descriptions
----------------
.. figure:: img/pinout.jpg
:width: 442px
:align: center
:alt: RUUVI Pinout
* 2 = P0.29 = SPI_SCK
* 3 = P0.28 = SPI_MISO
* 10 = P0.04 = GPIO (can be used as a GPIO / ADC pin)
* 11 = P0.05 = GPIO (can be used as a GPIO / ADC pin)
* 12 = P0.25 = SPI_MOSI
* 13 = P0.19 = LED2 (green) / GPIO (can be used as a GPIO pin but the LED will blink)
* 14 = P0.17 = LED1 (red) / GPIO (can be used as a GPIO pin but the LED will blink)
* 15 = P0.13 = Button / GPIO (can be used as a GPIO pin)
* 16 = GND (Battery's negative contact)
* 17 = Battery's positive contact
* 18 = Battery's positive contact
* 19 = SWDIO
* 20 = SWDCLK
* 21 = P0.18 = SWO / GPIO (can be used as a GPIO pin)
* 22 = P0.21 = Reset / GPIO (can be used as a GPIO pin if no need to reset the device)
* 23 = GND (Battery's negative contact)
* 24 = P0.31 = GPIO (can be used as a GPIO / ADC pin)
* 25 = P0.30 = GPIO (can be used as a GPIO / ADC pin)
GPIO = General Purpose Input Output pin
P1 = Standard 10-pin ARM Cortex debug connector (on RuuviTag Rev.B1-B5)
* 1 = VDD
* 2 = SWDIO
* 3 = GND (Battery's negative contact)
* 4 = SWDCLK
* 5 = GND (Battery's negative contact)
* 6 = SWO
* 7 = No Connect
* 8 = No Connect
* 9 = GND (Battery's negative contact)
* 10 = Reset
P1 = TC2030 TagConnect (on RuuviTag Rev.B6)
* 1 = Battery's positive contact
* 2 = SWDIO
* 3 = Reset
* 4 = SWDCLK
* 5 = GND (Battery's negative contact)
* 6 = SWO
Programming and Debugging
*************************
Flashing
========
Build and flash applications as usual (see :ref:`build_an_application` and
:ref:`application_run` for more details).
The easiest way to flash Zephyr onto a RuuviTag requires an external Ruuvi DEVKIT. More information about the board can be found at the
`ruuvitag devkit`_.
Once your tag is conencted to the DEVKIT and conencted to your PC, build and flash the application in the usual way.
.. zephyr-app-commands::
:zephyr-app: samples/basic/blinky
:board: ruuvi_ruuvitag
:goals: build flash
Advanced users may want to program the RuuviTag without the DEVKIT, this can be achieved via the SWDIO and SWDCLK pins located on the back of the RuuviTag.
Debugging
=========
If using the Ruuvi DEVKIT refer to the :ref:`nordic_segger` page to learn about debugging Nordic boards with a
Segger IC.
Testing the LEDs and buttons on the RuuviTag
********************************************
There are 2 samples that allow you to test that the buttons (switches) and LEDs on
the board are working properly with Zephyr:
* :ref:`blinky-sample`
* :ref:`button-sample`
You can build and flash the examples to make sure Zephyr is running correctly on
your board. The button and LED definitions can be found in :file:`boards/arm/ruuvi_ruuvitag/ruuvi_ruuvitag.dts`.
References
**********
.. target-notes::
.. _ruuvitag website: https://ruuvi.com
.. _ruuvitag datasheet: https://ruuvi.com/files/ruuvitag-tech-spec-2019-7.pdf
.. _ruuvitag devkit: https://lab.ruuvi.com/devshield/

View file

@ -0,0 +1,139 @@
/*
* Copyright (c) 2020 Ruuvi Innovations Ltd (Oy)
*
* SPDX-License-Identifier: Apache-2.0
*/
/dts-v1/;
#include <nordic/nrf52832_qfaa.dtsi>
/ {
model = "Ruuvi RuuviTag";
compatible = "ruuvi,ruuvitag";
chosen {
zephyr,console = &uart0;
zephyr,shell-uart = &uart0;
zephyr,uart-mcumgr = &uart0;
zephyr,bt-mon-uart = &uart0;
zephyr,bt-c2h-uart = &uart0;
zephyr,sram = &sram0;
zephyr,flash = &flash0;
zephyr,code-partition = &slot0_partition;
};
/* These aliases are provided for compatibility with samples */
aliases {
led0 = &led0;
led1 = &led1;
sw0 = &button0;
};
leds {
compatible = "gpio-leds";
led0: led_0 {
gpios = <&gpio0 17 GPIO_ACTIVE_LOW>;
label = "Red LED 0";
};
led1: led_1 {
gpios = <&gpio0 19 GPIO_ACTIVE_LOW>;
label = "Green LED 1";
};
};
buttons {
compatible = "gpio-keys";
button0: button_0 {
gpios = <&gpio0 13 (GPIO_PULL_UP | GPIO_ACTIVE_LOW)>;
label = "Push button switch 0";
};
};
};
&adc {
status = "okay";
};
&gpiote {
status = "okay";
};
&gpio0 {
status = "okay";
};
&uart0 {
status = "okay";
compatible = "nordic,nrf-uart";
current-speed = <115200>;
tx-pin = <5>;
rx-pin = <4>;
cts-pin = <31>;
rts-pin = <30>;
};
&spi0 {
compatible = "nordic,nrf-spi";
status = "okay";
sck-pin = <29>;
mosi-pin = <25>;
miso-pin = <28>;
cs-gpios = <&gpio0 3 0>, <&gpio0 8 0>;
bme280@0 {
compatible = "bosch,bme280";
reg = <0>;
spi-max-frequency = <10000000>;
label= "BME280";
};
lis2dh12: lis2dh12@1 {
compatible = "st,lis2dh", "st,lis2dh12";
reg = <1>;
spi-max-frequency = <10000000>;
irq-gpios = <&gpio0 2 GPIO_ACTIVE_HIGH>, <&gpio0 6 GPIO_ACTIVE_HIGH>;
label = "LIS2DH12-ACCEL";
};
};
&flash0 {
/*
* For more information, see:
* http://docs.zephyrproject.org/latest/guides/dts/index.html#flash-partitions
*/
partitions {
compatible = "fixed-partitions";
#address-cells = <1>;
#size-cells = <1>;
boot_partition: partition@0 {
label = "mcuboot";
reg = <0x00000000 0xc000>;
};
slot0_partition: partition@c000 {
label = "image-0";
reg = <0x0000C000 0x32000>;
};
slot1_partition: partition@3e000 {
label = "image-1";
reg = <0x0003E000 0x32000>;
};
scratch_partition: partition@70000 {
label = "image-scratch";
reg = <0x00070000 0xa000>;
};
/*
* The flash starting at 0x0007a000 and ending at
* 0x0007ffff (sectors 122-127) is reserved for use
* by the application.
* Storage partition will be used by FCB/LittleFS/NVS
* if enabled.
*/
storage_partition: partition@7a000 {
label = "storage";
reg = <0x0007a000 0x00006000>;
};
};
};

View file

@ -0,0 +1,18 @@
identifier: ruuvi_ruuvitag
name: Ruuvi-RuuviTag
type: mcu
arch: arm
toolchain:
- zephyr
- gnuarmemb
- xtools
ram: 64
flash: 512
supported:
- ble
- adc
- gpio
- spi
- counter
- nvs
- watchdog

View file

@ -0,0 +1,19 @@
# Copyright (c) 2020 Ruuvi Innovations Ltd (Oy)
# SPDX-License-Identifier: Apache-2.0
CONFIG_SOC_SERIES_NRF52X=y
CONFIG_SOC_NRF52832_QFAA=y
CONFIG_BOARD_RUUVI_RUUVITAG=y
# Enable MPU
CONFIG_ARM_MPU=y
# Enable RTT
CONFIG_USE_SEGGER_RTT=y
# Enable GPIO
CONFIG_GPIO=y
# additional board options
# set y to disable R button
CONFIG_GPIO_AS_PINRESET=n

View file

@ -351,6 +351,7 @@ riscv RISC-V Foundation
rockchip Fuzhou Rockchip Electronics Co., Ltd
rohm ROHM Semiconductor Co., Ltd
roofull Shenzhen Roofull Technology Co, Ltd
ruuvi Ruuvi Innovations Ltd (Oy)
samsung Samsung Semiconductor
samtec Samtec/Softing company
sancloud Sancloud Ltd

View file

@ -48,7 +48,8 @@
defined(CONFIG_BOARD_BL652_DVK) || \
defined(CONFIG_BOARD_BL654_DVK) || \
defined(CONFIG_BOARD_DEGU_EVK) || \
defined(CONFIG_BOARD_ADAFRUIT_FEATHER_NRF52840)
defined(CONFIG_BOARD_ADAFRUIT_FEATHER_NRF52840) || \
defined(CONFIG_BOARD_RUUVI_RUUVITAG)
#include <hal/nrf_saadc.h>
#define ADC_DEVICE_NAME DT_LABEL(DT_INST(0, nordic_nrf_saadc))