chengkai15 opened a new issue, #21478: URL: https://github.com/apache/nuttx/issues/21478
### 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: - [DISCUSS]: https://lists.apache.org/thread/c6pl46o5l1ngb2zb3qtotq38o30h6v4b - [VOTE]: https://lists.apache.org/thread/9fy6bog3dcw3do5d8wd0yyvlpkjrhxpn (open until 9 November 2026, 00:00 UTC) This issue tracks the work for option 1B of the vote, and will be updated with the result. ### 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#APPS-PR, #NUTTX-PR | | 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 for AutoPTS; automated tests in CI (BSWorld or a virtual controller) | AutoPTS GAP/GATT/SM test cases; 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 (HCI or L2CAP) is question 2 of the vote; steps 2 and 3 follow its result. ### 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 - [x] I have verified before submitting the report. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
