-
Notifications
You must be signed in to change notification settings - Fork 8.4k
Bluetooth: Host: Fix monitor UART selection #80633
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
Conversation
|
I don't know if it's right to treat zephyr/doc/build/dts/api/api.rst Lines 397 to 398 in 124aae3
At the very least, we should only grab it if Is there a way to ensure only one driver grabs a DT device? |
Some wild thinking: Wouldn't it be better if we made it so btmon is not enabled by a kconfig, but rather by the presence of the |
|
@alwa-nordic all good points. Admittedly I was looking for a quick fix here for the fact that I realized none of the Silabs boards set a Either way, we do have issue independent of this PR, since if you go and set Bluetooth logs to use BT_MONITOR it does not disable UART_CONSOLE, which means that you get both drivers on most boards enabled and trying to use the same device. |
44209a3 to
29f8c00
Compare
I've updated the PR accordingly, and I think this may be a worthwhile short-term improvement. Longer term (post-4.0) we could look into enabling these Kconfig options based on the existence of DT chosen properties. |
78c583d to
edcc069
Compare
Most boards set zephyr,bt-mon-uart to point at the same device as zephyr,console. It's still useful to have the possibility of having these as two different devices, however it's useful to fall back to the UART console in case a dedicated monitor UART hasn't been specified. This also ensures that the fallback only happens if the console UART isn't enabled, but a DT chosen property exists for it. Additionally, we now get a user friendly error in case the Bluetooth UART monitor feature has been enabled in Kconfig but there isn't a suitable UART available for it in devicetree. Signed-off-by: Johan Hedberg <[email protected]>
edcc069 to
6ca3e27
Compare
Most boards set zephyr,bt-mon-uart to point at the same device as zephyr,console. It's still useful to have the possibility of having these as two different devices, however it's also useful to fall back to the UART console in case a dedicated monitor UART hasn't been specified.
This also ensures that the fallback only happens if the console UART isn't enabled, but a DT chosen property exists for it. Additionally, we now get a user friendly error in case the Bluetooth UART monitor feature has been enabled in Kconfig but there isn't a suitable UART available for it in devicetree.