Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

wireless/bluetooth: decoupling bt_driver_s and bt_buf_s #3754

Merged
merged 4 commits into from May 31, 2021

Conversation

anchao
Copy link
Contributor

@anchao anchao commented May 21, 2021

Summary

wireless/bluetooth: decoupling bt_driver_s and bt_buf_s
serial/uart/h4: add bt h4 uart serial driver
arch/sim: remove BT uart implement
wirelss/bluetooth/bt_buf: add ISO buffer type

Feature request by : #3543

Impact

bluetooth uart driver module

Testing

bluetooth uart h4 devcie with 3rd stack running on userspace

Signed-off-by: chao.an <anchao@xiaomi.com>
Signed-off-by: chao.an <anchao@xiaomi.com>
@anchao
Copy link
Contributor Author

anchao commented May 21, 2021

Error: /home/runner/work/incubator-nuttx/incubator-nuttx/nuttx/arch/arm/src/nrf52/nrf52_sdc.c:309:2: error: Mixed case identifier found
Error: /home/runner/work/incubator-nuttx/incubator-nuttx/nuttx/arch/arm/src/nrf52/nrf52_sdc.c:318:2: error: Mixed case identifier found
Error: /home/runner/work/incubator-nuttx/incubator-nuttx/nuttx/arch/arm/src/nrf52/nrf52_sdc.c:329:2: error: Mixed case identifier found
Error: /home/runner/work/incubator-nuttx/incubator-nuttx/nuttx/arch/arm/src/nrf52/nrf52_sdc.c:338:2: error: Mixed case identifier found
Error: /home/runner/work/incubator-nuttx/incubator-nuttx/nuttx/arch/arm/src/nrf52/nrf52_sdc.c:347:2: error: Mixed case identifier found
Error: Process completed with exit code 1.

Mixed case found by style check, ignore

Copy link
Contributor

@protobits protobits left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for this, it will help proper BLE stack architecture and support different host stacks as we've been discussing.
I made some brief comments. My main concern is if this was tested under the different controller/host stacks we're supporting (nuttx's, nimBLE and using nordic's SDC) as this is touching all of these simultaneously.

wireless/bluetooth/bt_hcicore.c Show resolved Hide resolved
drivers/serial/uart_bth4.c Outdated Show resolved Hide resolved
drivers/serial/Kconfig Outdated Show resolved Hide resolved
boards/sim/sim/sim/configs/btuart/defconfig Outdated Show resolved Hide resolved
arch/arm/src/nrf52/nrf52_sdc.c Outdated Show resolved Hide resolved
arch/arm/src/nrf52/nrf52_sdc.c Outdated Show resolved Hide resolved
arch/arm/src/nrf52/nrf52_sdc.c Outdated Show resolved Hide resolved
@anchao anchao force-pushed the 21052101 branch 3 times, most recently from d0d577e to db55233 Compare May 25, 2021 05:40
@anchao anchao requested a review from protobits May 25, 2021 05:40
@anchao anchao force-pushed the 21052101 branch 3 times, most recently from a99645c to 4b13ddb Compare May 25, 2021 12:16
Copy link
Contributor

@protobits protobits left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good. Only small change requested.
BTW, have you tested with nimBLE (sim:nimble)? You mention third party stack but don't know which do you refer?

arch/arm/src/nrf52/nrf52_sdc.c Outdated Show resolved Hide resolved
Signed-off-by: chao.an <anchao@xiaomi.com>
Signed-off-by: chao.an <anchao@xiaomi.com>
@anchao
Copy link
Contributor Author

anchao commented May 25, 2021

Looks good. Only small change requested.
BTW, have you tested with nimBLE (sim:nimble)? You mention third party stack but don't know which do you refer?

we are using the zephyr(BLE+MESH) and bluedroid(BT) dual-mode host stack solution, and test case include BLE(peripheral/central),MESH(provisioner),BT(a2dp/avrcp/spp/etc)

    7       100 FIFO     Task    --- Waiting  Signal    00000000 065504 004084   6.2%  fluorided
    9       100 FIFO     pthread --- Waiting  Semaphore 00000000 065536 007700  11.7%  bt_stack_manager_thread 0x58c33ee0
   10       246 FIFO     pthread --- Waiting  Semaphore 00000000 065536 001232   1.8%  alarm_deprecated 0
   11       246 FIFO     pthread --- Waiting  Semaphore 00000000 065536 003760   5.7%  alarm_default_ca 0x58c537f8
   12       246 FIFO     pthread --- Waiting  Semaphore 00000000 065536 003312   5.0%  alarm_dispatcher 0x58c537c8
   13       100 FIFO     pthread --- Waiting  Semaphore 00000000 065536 004208   6.4%  bt_jni_thread 0x58c371e0
   14       246 FIFO     pthread --- Waiting  Semaphore 00000000 065536 003172   4.8%  bt_hci_thread 0x58c385c0
   15       246 FIFO     pthread --- Waiting  Semaphore 00000000 065536 002720   4.1%  bt_rx_thread 0
   16       246 FIFO     pthread --- Waiting  Semaphore 00000000 065536 010032  15.3%  bt_main_thread 0x58c3c220
   17       246 FIFO     pthread --- Waiting  MQ empty  00000000 065536 003172   4.8%  bt_a2dp_sink_worker_thread 0x58c429c0
   18       246 FIFO     pthread --- Waiting  Semaphore 00000000 065536 001648   2.5%  uipc-main 0x58c435e0
   21       227 FIFO     Kthread --- Waiting  Semaphore 00000000 008096 001136  14.0%  BT TX  0x58c34270
   22       228 FIFO     Kthread --- Waiting  Semaphore 00000000 008096 001216  15.0%  BT RX  0x58c34270
   23       230 FIFO     Kthread --- Waiting  Semaphore 00000000 008096 000992  12.2%  BT ECC  0x58c34270
   24       228 FIFO     Kthread --- Waiting  Semaphore 00000000 008096 001488  18.3%  BT Driver  0x58c34270

@protobits
Copy link
Contributor

Looks good. Only small change requested.
BTW, have you tested with nimBLE (sim:nimble)? You mention third party stack but don't know which do you refer?

we are using the zephyr(BLE+MESH) and bluedroid(BT) dual-mode host stack solution, and test case include BLE(peripheral/central),MESH(provisioner),BT(a2dp/avrcp/spp/etc)

    7       100 FIFO     Task    --- Waiting  Signal    00000000 065504 004084   6.2%  fluorided
    9       100 FIFO     pthread --- Waiting  Semaphore 00000000 065536 007700  11.7%  bt_stack_manager_thread 0x58c33ee0
   10       246 FIFO     pthread --- Waiting  Semaphore 00000000 065536 001232   1.8%  alarm_deprecated 0
   11       246 FIFO     pthread --- Waiting  Semaphore 00000000 065536 003760   5.7%  alarm_default_ca 0x58c537f8
   12       246 FIFO     pthread --- Waiting  Semaphore 00000000 065536 003312   5.0%  alarm_dispatcher 0x58c537c8
   13       100 FIFO     pthread --- Waiting  Semaphore 00000000 065536 004208   6.4%  bt_jni_thread 0x58c371e0
   14       246 FIFO     pthread --- Waiting  Semaphore 00000000 065536 003172   4.8%  bt_hci_thread 0x58c385c0
   15       246 FIFO     pthread --- Waiting  Semaphore 00000000 065536 002720   4.1%  bt_rx_thread 0
   16       246 FIFO     pthread --- Waiting  Semaphore 00000000 065536 010032  15.3%  bt_main_thread 0x58c3c220
   17       246 FIFO     pthread --- Waiting  MQ empty  00000000 065536 003172   4.8%  bt_a2dp_sink_worker_thread 0x58c429c0
   18       246 FIFO     pthread --- Waiting  Semaphore 00000000 065536 001648   2.5%  uipc-main 0x58c435e0
   21       227 FIFO     Kthread --- Waiting  Semaphore 00000000 008096 001136  14.0%  BT TX  0x58c34270
   22       228 FIFO     Kthread --- Waiting  Semaphore 00000000 008096 001216  15.0%  BT RX  0x58c34270
   23       230 FIFO     Kthread --- Waiting  Semaphore 00000000 008096 000992  12.2%  BT ECC  0x58c34270
   24       228 FIFO     Kthread --- Waiting  Semaphore 00000000 008096 001488  18.3%  BT Driver  0x58c34270

Great! Any chance support for these stacks can be upstreamed into NuttX? I think this relates to the discussion about which would be a good stack to adopt.

@xiaoxiang781216
Copy link
Contributor

@v01d can we merge this patch first? Other bluetooth stack can be upstreamed later.

@protobits
Copy link
Contributor

Sure, my comment about the bluetooth stack is unrelated to this PR.

@protobits protobits merged commit 99bfd35 into apache:master May 31, 2021
@Ouss4 Ouss4 added this to To-Add in Release Notes - 10.2 Oct 11, 2021
@jerpelea jerpelea moved this from To-Add to fixes in Release Notes - 10.2 Oct 13, 2021
@jerpelea jerpelea moved this from fixes to Added in Release Notes - 10.2 Oct 22, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
No open projects
Development

Successfully merging this pull request may close these issues.

None yet

4 participants