1.. zephyr:board:: bt510
2
3Overview
4********
5
6The Sentrius™ BT510 Sensor is a battery powered, Bluetooth v5 Long Range integrated sensor that uses a Nordic Semiconductor nRF52840 ARM Cortex-M4F CPU.
7
8The sensor has the following features:
9
10* :abbr:`ADC (Analog to Digital Converter)`
11* CLOCK
12* FLASH
13* :abbr:`GPIO (General Purpose Input Output)`
14* :abbr:`I2C (Inter-Integrated Circuit)`
15* :abbr:`MPU (Memory Protection Unit)`
16* :abbr:`NVIC (Nested Vectored Interrupt Controller)`
17* :abbr:`PWM (Pulse Width Modulation)`
18* RADIO (Bluetooth Low Energy and 802.15.4)
19* :abbr:`RTC (nRF RTC System Clock)`
20* Segger RTT (RTT Console)
21* :abbr:`UART (Universal Asynchronous Receiver-Transmitter)`
22* :abbr:`WDT (Watchdog Timer)`
23
24.. figure:: img/bt510_back.jpg
25     :align: center
26     :alt: Sentrius BT510 Sensor, rear view
27
28     Sentrius BT510 Sensor, rear view
29
30More information about the board can be found at the
31`Sentrius BT510 website`_.
32
33Hardware
34********
35
36Supported Features
37==================
38
39The BT510 Sensor supports the following
40hardware features:
41
42+-----------+------------+----------------------+
43| Interface | Controller | Driver/Component     |
44+===========+============+======================+
45| ADC       | on-chip    | adc                  |
46+-----------+------------+----------------------+
47| CLOCK     | on-chip    | clock_control        |
48+-----------+------------+----------------------+
49| FLASH     | on-chip    | flash                |
50+-----------+------------+----------------------+
51| GPIO      | on-chip    | gpio                 |
52+-----------+------------+----------------------+
53| I2C(M)    | on-chip    | i2c                  |
54+-----------+------------+----------------------+
55| MPU       | on-chip    | arch/arm             |
56+-----------+------------+----------------------+
57| NVIC      | on-chip    | arch/arm             |
58+-----------+------------+----------------------+
59| PWM       | on-chip    | pwm                  |
60+-----------+------------+----------------------+
61| RADIO     | on-chip    | Bluetooth,           |
62|           |            | ieee802154           |
63+-----------+------------+----------------------+
64| RTC       | on-chip    | system clock         |
65+-----------+------------+----------------------+
66| RTT       | Segger     | console              |
67+-----------+------------+----------------------+
68| UART      | on-chip    | serial               |
69+-----------+------------+----------------------+
70| WDT       | on-chip    | watchdog             |
71+-----------+------------+----------------------+
72
73Connections and IOs
74===================
75
76LED
77---
78
79Two LEDs are visible through the BT510 housing lid.
80
81* LED_1A (green) = P0.22
82* LED_1B (red) = P0.20
83
84Push button
85------------
86
87The BT510 housing lid also acts as a push button.
88
89* BUTTON_1 = SW1 = P1.10
90
91Magnetoresistive sensor
92-----------------------
93
94The BT510 incorporates a Honeywell SM351LT magnetoresistive sensor. Refer to the `Honeywell SM351LT datasheet`_ for further details.
95
96* MAG = P1.14
97
98Accelerometer
99-------------
100
101The BT510 incorporates an I2C ST Microelectronics LIS2DH accelerometer. Refer to the `ST Microelectronics LIS2DH datasheet`_ for further details.
102
103* SDA = P0.26
104* SCL = P0.27
105* INT_1 = P1.05
106* INT_2 = P1.12
107
108Temperature Sensor
109------------------
110
111The BT510 incorporates an I2C Silabs SI7055 temperature sensor. Refer to the `Silabs 7055 datasheet`_ for further details.
112
113* SDA = P0.26
114* SCL = P0.27
115
116Programming and Debugging
117*************************
118
119Applications for the ``bt510`` board configuration can be built, flashed, and
120debugged in the usual way. See :ref:`build_an_application` and
121:ref:`application_run` for more details on building and running.
122
123The BT510 features a TagConnect 10 way socket for connection of a
124programmer/debugger, refer to `TagConnect TC2050 product page`_
125for details of an appropriate TagConnect cable.
126
127A non-standard layout is used to include access to the sensor debug UART.
128
129+-----------+------------+----------------------+
130| Pin No.   | Name       | Description          |
131+===========+============+======================+
132| 1         | Vcc        | Power Supply, 3.3V   |
133+-----------+------------+----------------------+
134| 2         | SWDIO      | SWD Data             |
135+-----------+------------+----------------------+
136| 3         | RXD        | Debug UART RX Data   |
137+-----------+------------+----------------------+
138| 4         | SWDCLK     | SWD Clock            |
139+-----------+------------+----------------------+
140| 5         | TM         | Spare GPIO           |
141+-----------+------------+----------------------+
142| 6         | SWO        | SWD Output           |
143+-----------+------------+----------------------+
144| 7         | N/C        | Not Connected        |
145+-----------+------------+----------------------+
146| 8         | TXD        | Debug UART TX Data   |
147+-----------+------------+----------------------+
148| 9         | GND        | Ground               |
149+-----------+------------+----------------------+
150| 10        | RESET      | Reset, Active Low    |
151+-----------+------------+----------------------+
152
153Connectivity to the programmer/debugger must be modified to match
154the pinout shown above.
155
156Ezurio provide the USB-SWD programming board (750-03239) that supports
157this connector layout, refer to the `USB SWD Programmer product page`_
158.
159
160Flashing
161========
162
163To connect the BT510 board for programming or debugging using the USB-SWD programming
164board, on the programming board set SW6 to the supply out position and SW5 to the 3V3
165position, ensure there is a jumper on J35 and that SW1 is in the debug position, then
166connect the BT510 to the board using the Tag-Connect cable via J3:
167
168.. figure:: img/bt510_prog.jpg
169     :align: center
170     :alt: Sentrius BT510 Sensor connected to programming board
171
172     Sentrius BT510 Sensor connected to programming board
173
174Then build and flash applications as usual (see :ref:`build_an_application` and
175:ref:`application_run` for more details). For example, to flash:
176
177.. code-block:: console
178
179   $ ninja flash
180
181Here is an example for the :zephyr:code-sample:`hello_world` application.
182
183First, run your favorite terminal program to listen for output.
184
185NOTE: On the BT510, the UART lines are at TTL levels and must be passed through
186an appropriate line driver circuit for translation to RS232 levels. Refer to the `MAX3232 datasheet`_
187for a suitable driver IC. The USB-SWD programming board has an in-built UART connected
188to the BT510 acting as a USB CDC port, on Linux and Windows 10 this driver should be
189installed automatically, for Windows 7, the MBED driver is required to use the serial
190port - see the `MBED Serial Driver`_ link for details and how to install the driver.
191
192.. code-block:: console
193
194   $ minicom -D <tty_device> -b 115200
195
196Replace :code:`<tty_device>` with the port where the bt510 can be found. For example, under Linux, :code:`/dev/ttyACM0`.
197
198Then build and flash the application in the usual way.
199
200.. zephyr-app-commands::
201   :zephyr-app: samples/hello_world
202   :board: bt510
203   :goals: build flash
204
205Note that an external debugger is required to perform application flashing.
206
207Debugging
208=========
209
210The ``bt510`` board does not have an on-board J-Link debug IC
211as some nRF5x development boards, however, instructions from the
212:ref:`nordic_segger` page also apply to this board, with the additional step
213of connecting an external debugger. The USB-SWD programmer board has a CMSIS debugger
214compatible interface and debugging can be performed using pyocd, openocd or any other
215applications that support the CMSIS interface.
216
217Testing Bluetooth on the BT510
218***********************************
219Many of the Bluetooth examples will work on the BT510.
220Try them out:
221
222* :zephyr:code-sample:`ble_peripheral`
223* :zephyr:code-sample:`bluetooth_eddystone`
224* :zephyr:code-sample:`bluetooth_ibeacon`
225
226
227Testing the LEDs and buttons on the BT510
228*****************************************
229
230There are 2 samples that allow you to test that the buttons (switches) and LEDs on
231the board are working properly with Zephyr:
232
233* :zephyr:code-sample:`blinky`
234* :zephyr:code-sample:`button`
235
236You can build and flash the examples to make sure Zephyr is running correctly on
237your board. The button, LED and sensor device definitions can be found in
238:zephyr_file:`boards/ezurio/bt510/bt510.dts`.
239
240
241References
242**********
243
244.. target-notes::
245
246.. _Sentrius BT510 website: https://www.ezurio.com/iot-devices/iot-sensors/bt510-bluetooth-5-long-range-ip67-multi-sensor
247.. _TagConnect TC2050 product page: https://www.tag-connect.com/product/tc2050-idc-050
248.. _USB SWD Programmer product page: https://www.ezurio.com/wireless-modules/programming-kits/usb-swd-programming-kit
249.. _MAX3232 datasheet: https://www.ti.com/lit/ds/symlink/max3232.pdf
250.. _Silabs 7055 datasheet: https://www.silabs.com/documents/public/data-sheets/Si7050-1-3-4-5-A20.pdf
251.. _ST Microelectronics LIS2DH datasheet: https://www.st.com/resource/en/datasheet/lis2dh.pdf
252.. _Honeywell SM351LT datasheet: https://sensing.honeywell.com/honeywell-sensing-nanopower-series-datasheet-50095501-c-en.pdf
253.. _MBED Serial Driver: https://os.mbed.com/docs/mbed-os/v6.8/program-setup/windows-serial-driver.html
254