xref: /btstack/port/zephyr/README.md (revision 87521db17403b35edbf887b6a9e0e8e6d0798701)
1# BTstack Port for Zephyr RTOS
2
3## Overview
4
5This port targets any platform supported by Zephyr that either contains a built-in Bluetooth Controller
6or is connected to an external Controller via one of the supported Zephyr HCI Transports drivers (see `zephyr/drivers/bluetooth/hci`)
7
8## Status
9
10Tested with nRF52 DK (PCA10040) and nRF52840 DK (PC10056) boards only. It uses the fixed static random BD ADDR stored in NRF_FICR, which will not compile on non nRF SoCs.
11
12
13## Building and Running
14
15The first step needs to done once. Step two is needed every time to setup the environment.
16
17### 1. Build Environment Preconditions
18
19Follow the getting started [guide](https://docs.zephyrproject.org/latest/develop/getting_started/index.html)
20until you are able to build an example.
21
22Then update the `ZEPHYR_ROOT` variable in `env.sh` to point to your `zephyrproject`. Defaults to `~/zephyrproject`
23
24
25### 2. Prepare the build environmet
26
27To setup your environment to build a BTstack example, run the provided setup in `env.sh`.
28
29```sh
30source env.sh
31```
32
33### 3. Build Example
34
35You can build an example using:
36```sh
37west build -b nrf52840dk_nrf52840
38```
39
40`nrf52840dk_nrf52840` selected the Nordic nRF52840 DK. For the older nRF52 DK with nRF52832, you can specify nrf52dk_nrf52832.
41To get a list of all supported Zephyr targets, run `west boards`
42
43To change zephyr platform settings use:
44```sh
45west build -b nrf52840dk_nrf52840 -t menuconfig
46```
47
48To build a different example, e.g. the `gatt_streamer_server`, set the EXAMPLE environment variable:
49```sh
50EXAMPLE=gatt_streamer_server west build -b nrf52840dk_nrf52840
51```
52
53### 4. Flash Example
54
55To flash a connected board:
56```sh
57west flash
58```
59
60
61## TODO
62
63- Read NRF_FICR on Nordic SoCs
64- Allow/document use of Zephyr HCI Drivers
65
66
67