1.. zephyr:board:: ruuvi_ruuvitag
2
3Overview
4********
5
6RuuviTag is an advanced battery-operated open-source Bluetooth
7enabled sensor beacon platform capable of sending temperature, humidity,
8pressure, and motion information over Bluetooth Low Energy.
9
10More information about the board can be found at the
11`ruuvitag website`_.
12
13Hardware
14********
15
16RuuviTag's have the following physical features:
17
18* Nordic Semiconductor nRF52832 System-on-Chip
19* STMicroelectronics LIS2DH12 accelerometer
20* Bosch BME 280 temperature + relative air humidity + air pressure sensor
21* NFC™-A tag antenna
22* 1000mAh CR2477 battery
23* 2 buttons
24* 1 Green LED
25* 1 Red LED
26* IP67 Enclosure
27* Long range RF antenna
28
29Supported Features
30==================
31
32+-----------+------------+----------------------+
33| Interface | Controller | Driver/Component     |
34+===========+============+======================+
35| ADC       | on-chip    | adc                  |
36+-----------+------------+----------------------+
37| CLOCK     | on-chip    | clock_control        |
38+-----------+------------+----------------------+
39| FLASH     | on-chip    | flash                |
40+-----------+------------+----------------------+
41| GPIO      | on-chip    | gpio                 |
42+-----------+------------+----------------------+
43| MPU       | on-chip    | arch/arm             |
44+-----------+------------+----------------------+
45| NVIC      | on-chip    | arch/arm             |
46+-----------+------------+----------------------+
47| RADIO     | on-chip    | Bluetooth            |
48+-----------+------------+----------------------+
49| RTC       | on-chip    | system clock         |
50+-----------+------------+----------------------+
51| SPI       | on-chip    | spi                  |
52+-----------+------------+----------------------+
53| UART      | on-chip    | serial               |
54+-----------+------------+----------------------+
55| WDT       | on-chip    | watchdog             |
56+-----------+------------+----------------------+
57| Humidity, | on-board   | bme280               |
58| Temp & Air|            |                      |
59| Pressure  |            |                      |
60+-----------+------------+----------------------+
61| Acc       | on-board   | lis2dh12             |
62+-----------+------------+----------------------+
63
64Connections and IOs
65===================
66
67LED
68---
69
70* LED0 (red) = P0.17
71* LED1 (green) = P0.19
72
73Push buttons
74------------
75
76* BUTTON0 = SW1 = P0.13
77
78Pin descriptions
79----------------
80
81.. figure:: img/pinout.jpg
82     :align: center
83     :alt: RUUVI Pinout
84
85* 2 = P0.29 = SPI_SCK
86* 3 = P0.28 = SPI_MISO
87* 10 = P0.04 = GPIO (can be used as a GPIO / ADC pin)
88* 11 = P0.05 = GPIO (can be used as a GPIO / ADC pin)
89* 12 = P0.25 = SPI_MOSI
90* 13 = P0.19 = LED2 (green) / GPIO (can be used as a GPIO pin but the LED will blink)
91* 14 = P0.17 = LED1 (red) / GPIO (can be used as a GPIO pin but the LED will blink)
92* 15 = P0.13 = Button / GPIO (can be used as a GPIO pin)
93* 16 = GND (Battery's negative contact)
94* 17 = Battery's positive contact
95* 18 = Battery's positive contact
96* 19 = SWDIO
97* 20 = SWDCLK
98* 21 = P0.18 = SWO / GPIO (can be used as a GPIO pin)
99* 22 = P0.21 = Reset / GPIO (can be used as a GPIO pin if no need to reset the device)
100* 23 = GND (Battery's negative contact)
101* 24 = P0.31 = GPIO (can be used as a GPIO / ADC pin)
102* 25 = P0.30 = GPIO (can be used as a GPIO / ADC pin)
103
104GPIO = General Purpose Input Output pin
105
106P1 = Standard 10-pin ARM Cortex debug connector (on RuuviTag Rev.B1-B5)
107
108* 1 = VDD
109* 2 = SWDIO
110* 3 = GND (Battery's negative contact)
111* 4 = SWDCLK
112* 5 = GND (Battery's negative contact)
113* 6 = SWO
114* 7 = No Connect
115* 8 = No Connect
116* 9 = GND (Battery's negative contact)
117* 10 = Reset
118
119P1 = TC2030 TagConnect (on RuuviTag Rev.B6)
120
121* 1 = Battery's positive contact
122* 2 = SWDIO
123* 3 = Reset
124* 4 = SWDCLK
125* 5 = GND (Battery's negative contact)
126* 6 = SWO
127
128
129Programming and Debugging
130*************************
131
132Flashing
133========
134
135Build and flash applications as usual (see :ref:`build_an_application` and
136:ref:`application_run` for more details).
137
138The easiest way to flash Zephyr onto a RuuviTag requires an external Ruuvi DEVKIT. More information about the board can be found at the
139`ruuvitag devkit`_.
140
141Once your tag is connected to the DEVKIT and connected to your PC, build and flash the application in the usual way.
142
143.. zephyr-app-commands::
144   :zephyr-app: samples/basic/blinky
145   :board: ruuvi_ruuvitag
146   :goals: build flash
147
148Advanced 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.
149
150Debugging
151=========
152
153If using the Ruuvi DEVKIT refer to the :ref:`nordic_segger` page to learn about debugging Nordic boards with a
154Segger IC.
155
156Testing the LEDs and buttons on the RuuviTag
157********************************************
158
159There are 2 samples that allow you to test that the buttons (switches) and LEDs on
160the board are working properly with Zephyr:
161
162* :zephyr:code-sample:`blinky`
163* :zephyr:code-sample:`button`
164
165You can build and flash the examples to make sure Zephyr is running correctly on
166your board. The button and LED definitions can be found in :file:`boards/ruuvi//ruuvi_ruuvitag/ruuvi_ruuvitag.dts`.
167
168References
169**********
170
171.. target-notes::
172
173.. _ruuvitag website: https://ruuvi.com
174.. _ruuvitag datasheet: https://ruuvi.com/files/ruuvitag-tech-spec-2019-7.pdf
175.. _ruuvitag devkit: https://lab.ruuvi.com/devshield/
176