[FEATURE] Zephyr Bluetooth host (zblue): roadmap and tracking
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 5/5
- Estimated time
- Over a week
- Newbie friendliness
- 25/100
- Issue type
- Feature
- Clarity
- Clearly specified
- Activity status
- Active
- Tech stack
- c
- Domain
- embedded-iot
Research direction
Start with the in-progress draft PRs apache/nuttx-apps#3977 and apache/nuttx#21479, then read the Step 1 plan and its verification criteria. The first deliverable is the unmodified Zephyr host port in nuttx-apps under wireless/bluetooth/zblue, including the porting layer and simulator build. The roadmap spans multiple patch series and depends on a vote and later design decisions; this tracking issue does not identify a self-contained newcomer task.
Written by the indexing model from the issue text.
Description
Is your feature request related to a problem? Please describe.
NuttX has no Bluetooth host with BR/EDR today. The native stack
(wireless/bluetooth, net/bluetooth) is an early-stage LE host, and
NimBLE in nuttx-apps supports LE only. Products that need BR/EDR
profiles (HFP, A2DP, AVRCP, ...) together with LE cannot use NuttX
without a third-party stack.
#20686 proposed an adapted Zephyr host in the kernel tree. After the
review there and the DISCUSS thread on dev@, the integration model was
put to a vote:
Option 1B passed, with 2B (L2CAP boundary) as the long-term direction.
This issue tracks the work for it.
Describe the solution you'd like
The Zephyr Bluetooth host is integrated in three steps. Each step is a
separate patch series, reviewed and tested on its own, and the stack is
usable after each step.
Step 1: unmodified Zephyr host in nuttx-apps (in progress)
The host is added to nuttx-apps under wireless/bluetooth/zblue, in the
same way as NimBLE: the Zephyr source is downloaded from a Zephyr
release (CONFIG_ZBLUE_REF) and is not modified. The NuttX code is a
porting layer (Zephyr kernel services on POSIX threads, HCI on the
existing /dev/ttyHCIx transport) and the build files. Fixes to the
host, including security fixes, go to Zephyr and are picked up by
changing the release. It is an optional stack: CONFIG_ZBLUE excludes
CONFIG_WIRELESS_BLUETOOTH_HOST and CONFIG_NIMBLE, and nothing changes
for them.
| PR | Repository | Content | Verified by | Status |
|---|---|---|---|---|
| 1 | apps + nuttx | Porting layer, HCI over /dev/ttyHCIx, Zephyr Kconfig resolution, Make and CMake builds, LE core (advertising, scanning, connections, GATT), PSA crypto through apps/crypto/mbedtls, zblue_peripheral example; sim:zblue, documentation, CI build. Simulator only. |
sim with a USB controller: scan, connect, GATT discovery and read, reconnect | draft: apache/nuttx-apps#3977, #21479 |
| 2 | apps | SMP (LE Secure Connections), privacy, ECC | pairing with a phone, encrypted link, resolvable private address | planned |
| 3 | apps | Persistent storage: Zephyr settings with a file backend on the NuttX file system | bonds and identity kept after reboot | planned |
| 4 | apps | bt shell: the upstream Bluetooth shell as an NSH command |
scan, connect, GATT and pairing from the shell | planned |
| 5 | apps | BR/EDR: L2CAP BR, SDP, RFCOMM, HFP, A2DP (with SBC), AVRCP, HID, selected by CONFIG_BT_*; classic commands in the shell |
pairing, SPP, HFP call and A2DP streaming with a phone or headset | planned |
| 6 | nuttx + apps | Targets other than the simulator: initialized iterable RAM sections of the host (net_buf pools) in .data, through the iterable section support in include/nuttx/linker; port iterable sections mapped to <nuttx/iterable_sections.h> |
build and run on a board with an on-chip or UART controller | planned |
| 7 | apps (+ nuttx) | Tests: the upstream Bluetooth tester (BTP) as an NSH application, driven by AutoPTS on hardware and by BSWorld scenarios with sim:zblue (H4 to a virtual controller) in CI |
AutoPTS GAP/GATT/SM test cases; BSWorld CI job | planned |
Order: 1, then 2; 3 and 4 after 2, in any order; 5 after 3 and 4. 6
can start after 1. 7 after 4. Board configurations are added or
updated with each PR.
Step 2: lower host layers in the kernel
HCI core, connection management and L2CAP move into the kernel and
replace wireless/bluetooth and net/bluetooth, without losing the
existing functions, and keeping existing applications and tools
(btsak, Bluetooth sockets) working. Controller drivers stay as they
are. Details will be proposed on dev@ before this step starts.
Step 3: userspace host on the kernel sockets
The userspace host uses the kernel through the socket interface
(L2CAP and management sockets, as with Linux and BlueZ) and drops its
own copy of the layers moved in step 2. Profiles, services, the shell
and tools stay in userspace, which keeps them out of the kernel in
protected and kernel builds.
The long-term kernel/user boundary is the L2CAP boundary (2B in the
vote); steps 2 and 3 move towards it.
Describe alternatives you've considered
- Adapted Zephyr host in the kernel tree, maintained as NuttX code
(option 1A, #20686). - Whole host in userspace, kernel limited to the HCI transport (option
2A of the vote). - Extending the native NuttX stack or NimBLE: both are LE only, so
BR/EDR and its profiles would have to be written from scratch.
Verification
- I have verified before submitting the report.
- Dominant language
- C
- Stars
- 4.1k
- Forks
- 1.8k
- Avg merge
- 1d 3h
- Merged PRs (30d)
- 833
Getting set up
- No Dockerfile or Docker Compose file
- Has a pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from apache/nuttx
-
Arch: all Arch: arm Area: Build system OS: Linux Type: Bug
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
apache/nuttx#19435 · 9 comments ·
Maintainers usually reply within 1 day
-
Arch: all OS: Linux Type: Bug
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
apache/nuttx#16249 · 7 comments ·
Maintainers usually reply within 1 day
-
Arch: all Area: Networking OS: Linux
Difficulty 4/5 3-5 days Newbie friendliness 48/100
Maintainers usually reply within 1 day
-
Type: Enhancement
Difficulty 4/5 3-5 days Newbie friendliness 22/100
apache/nuttx#21581 · 1 comment ·
Maintainers usually reply within 1 day
Similar issues
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 85/100
Maintainers usually reply within 1 day
-
SPIDevice selects an active-high device as soon as it is createdPossibly taken @mikeysklar claimed this today. Open
Difficulty 2/5 1-3 hours Newbie friendliness 73/100
adafruit/circuitpython#11869 ·
Maintainers usually reply within 1 day
-
Difficulty 1/5 Under an hour Newbie friendliness 78/100
gnif/LookingGlass#1352 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
Maintainers usually reply within 1 day
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
kovidgoyal/kitty#10862 ·
Maintainers usually reply within 1 day