zephyrproject-rtos / zephyr

Primary Git Repository for the Zephyr Project. Zephyr is a new generation, scalable, optimized, secure RTOS for multiple hardware architectures.
https://docs.zephyrproject.org
Apache License 2.0
10.87k stars 6.62k forks source link

Blueooth: Controller Response COMMAND DISALLOWED #30808

Closed LingaoM closed 3 years ago

LingaoM commented 3 years ago

Describe the bug

Use nrf52832 as controller, use nrf52840 as host, use H4 transport layer.

* Booting Zephyr OS build zephyr-v2.4.0-1367-g7d16ab50d738

[00:00:02.807,769] bt_hci_core: HW Platform: Nordic Semiconductor (0x0002) [00:00:02.807,800] bt_hci_core: HW Variant: nRF52x (0x0002) [00:00:02.807,800] bt_hci_core: Firmware: Standard Bluetooth controller (0x00) Version 2.4 Build 99 [00:00:02.825,592] bt_hci_core: Identity: e4:0c:5e:e9:04:9a (random) [00:00:02.825,592] bt_hci_core: HCI: version 5.2 (0x0b) revision 0x0000, manufacturer 0x05f1 [00:00:02.825,622] bt_hci_core: LMP: version 5.2 (0x0b) subver 0xffff [00:00:09.433,471] bt_mesh_health_cli.health_cli_init: primary 1 [00:00:09.433,776] bt_mesh_prov_device: Device UUID: 3a2b2d51-f1a3-47ad-bb49-7c23c85219b3 [00:00:09.438,903] bt_hci_core: opcode 0x200b status 0x0c [00:00:09.438,903] bt_mesh_adv: starting scan failed (err -5)

I did not modify any code in the host or controller. This problem occurs from time to time. However, if the host and controller are in the same chip, the problem is not found.

cvinayak commented 3 years ago

Please provide details to reproduce like the commit, samples, configuration, build steps used, flashing steps and test procedure.

carlescufi commented 3 years ago

@LingaoM could you please pinpoint the exact HCI command that is getting command disallowed? This could be the set random address one, which would be different from what you analyzed. EDIT: This is actually failing on Set Scan Parameters, so this looks like a bug in the Host itself, not Mesh or the Controller.

carlescufi commented 3 years ago

@LingaoM could you please provide additional information here?

LingaoM commented 3 years ago

Sorry for the delay, I think it may be that the controller is not reset, and the host is running on another board, resulting in an inconsistent state.

carlescufi commented 3 years ago

Sorry for the delay, I think it may be that the controller is not reset, and the host is running on another board, resulting in an inconsistent state.

The Host should always start with an HCI Reset command after a Host reset, and that should soft-reset the controller. Any other additional information you can provide?

LingaoM commented 3 years ago

Sorry, i can't provide more effective information.

LingaoM commented 3 years ago

It is worth mentioning that I use auto pts to capture this problem, and it is probabilistic. If the host / controller is on the same chip, the same problem is not found.

carlescufi commented 3 years ago

[00:00:09.438,903] bt_mesh_adv: starting scan failed (err -5)

This has likely been fixed by #31532, please reopen if that's not the case.