-
Notifications
You must be signed in to change notification settings - Fork 6.1k
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
driver: bluetooth: hci: Add NXP BT module support on RT1170 EVKB #70815
driver: bluetooth: hci: Add NXP BT module support on RT1170 EVKB #70815
Conversation
358acad
to
d202eaf
Compare
d202eaf
to
7f5f360
Compare
7f5f360
to
9475d5c
Compare
My comments have been addressed, I lack the experience to ACK the functionality though. Probably someone with Bluetooth driver knowledge should take a look. |
boards/nxp/mimxrt1170_evk/mimxrt1170_evk_mimxrt1176_cm7_B.overlay
Outdated
Show resolved
Hide resolved
480a66d
to
0587066
Compare
config BT_H4_NXP_CTLR | ||
bool "NXP Bluetooth Controller" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wouldn't it make sense to add the following here:
default y
depends on DT_HAS_NXP_BT_HCI_UART_ENABLED
Then you can remove any explicit enablement in the app Kconfig overlays.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
...and then it'll also be easier for me to do the conversion as part of #72323
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wouldn't it make sense to add the following here:
default y depends on DT_HAS_NXP_BT_HCI_UART_ENABLED
Then you can remove any explicit enablement in the app Kconfig overlays.
Sorry, the dependency cannot be added.
The Bluetooth controller is module, it can work with any MCU with UART peripheral.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@lylezhu2012 I'm not sure I follow. Even in the case that you describe, those MCUs that have this peripheral connected will still need to have the appropriate devicetree node with compatible = "nxp,bt-hci-uart";
, won't they? If not, what is the purpose of the devicetree node?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
compatible = "nxp,bt-hci-uart";
is the devicetree node required by NXP Bluetooth Controller. If you want to use NXP Bluetooth Controller, you need to add the devicetree node with compatible = "nxp,bt-hci-uart";
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@lylezhu2012 the compatible strings are used to associate devicetree nodes with drivers. Which driver implements this compatible? You're adding the hci_nxp_setup.c
extension driver in this same PR where you add the devicetree binding and compatible, so it seems natural to assume that these go together, even though the c-file currently doesn't #define DT_DRV_COMPAT nxp_bt_hci_uart
(which I assumed was primarily because it only supports a single instance at the moment).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, nxp,bt-hci-uart
is used for driver hci_nxp_setup.c.
@lylezhu2012 the compatible strings are used to associate devicetree nodes with drivers. Which driver implements this compatible? You're adding the
hci_nxp_setup.c
extension driver in this same PR where you add the devicetree binding and compatible, so it seems natural to assume that these go together, even though the c-file currently doesn't#define DT_DRV_COMPAT nxp_bt_hci_uart
(which I assumed was primarily because it only supports a single instance at the moment).
Yes. Currently, only one instance can be supported.
And I have a question, if does Bluetooth Host support multiple instance? I mean can we call bt_enable
multiple times to enable multiple Bluetooth Host?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes,
nxp,bt-hci-uart
is used for driver hci_nxp_setup.c.
So in that case you should be able to apply my proposal wrt default
and depends on
. If there isn't a node with that compatible string it doesn't make sense to enable the driver.
And I have a question, if does Bluetooth Host support multiple instance? I mean can we call
bt_enable
multiple times to enable multiple Bluetooth Host?
Not right now. This may become possible at some point in the future, especially thanks to #72323. With that PR you could quite easily construct a host that supports multiple controllers, or an app which exposes multiple controllers over different HCI transports.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So in that case you should be able to apply my proposal wrt
default
anddepends on
. If there isn't a node with that compatible string it doesn't make sense to enable the driver.
Updated.
0587066
to
8d48cb5
Compare
8d48cb5
to
bf10a1d
Compare
Fix conflict issue. |
@lylezhu2012 could you make it also work on MIMXRT1040-EVK, as that's the one you suggested (in #67145) and we bought. |
There is a pin conflict on MIMXRT1040-EVK. If PCM pins for handsfree (or AG) are configured by soldering 0 ohm resistors, the board cannot be flashed. So for BR cases, I do not recommend using MIMXRT1040-EVK. MIMXRT1170-EVKB does not have this limitation. That's why I made this PR to support MIMXRT1170-EVKB. |
We don't really care about the PCM data, it's only for testing that the ACL links and L2CAP channel still work. We could still test, e.g. RFCOMM or A2DP with all-zeroes PCM data. That board can also be useful to test LE.
Can you share where in the official documentation I can find this information? |
Got it. I can enable it after the PR merged.
No. We flashed it internally by adding an extra circuit. Or, remove the module manually. |
|
Implement UART firmware download driver for NXP BT module. Only support Murata 2EL M.2 module on RT1170EVKB. And only one instance can be supported now. Signed-off-by: Lyle Zhu <lyle.zhu@nxp.com>
Add Kconfig.nxp to support NXP Bluetooth Chipset. Current only NXP IW612 Chipset (BT_NXP_NW612) has been supported. Add modules/hal_nxp/bt_controller/CMakeLists.txt to determine whether any firmware is selected, and check whether the firmware exists. If the firmware exists, copy the firmware to the temporary folder ${ZEPHYR_BINARY_DIR}/include/ generated/bt_nxp_ctlr_fw.h. OR, raise a fatal error. In file hci_nxp_setup.c, includes the temporary file bt_nxp_ctlr_fw.h. Signed-off-by: Lyle Zhu <lyle.zhu@nxp.com>
Overlay sram when BT is enabled on board MIMXRT1170 EVKB. Select NXP NW612 chipset. Signed-off-by: Lyle Zhu <lyle.zhu@nxp.com>
Add `fetch Binary Blobs` section to guide how to fetch binary blobs. Signed-off-by: Lyle Zhu <lyle.zhu@nxp.com>
Use zephyr_blobs_verify to check the blob file is valid or not. The function zephyr_blobs_verify will check if the file exists. And it checks if the file is valid. Signed-off-by: Lyle Zhu <lyle.zhu@nxp.com>
Overlay sram when BT is enabled on board MIMXRT1170 EVKB. Select NXP NW612 chipset for Handsfree_ag example Signed-off-by: Lyle Zhu <lyle.zhu@nxp.com>
bf10a1d
to
e0695f2
Compare
@jori-nordic , I saw that 72323 has been merged. And I updated the PR to support it. Please help review it. |
Will do. I don't have the HW though so I can only try building 👍 |
Sure. Please. I have tested it locally. |
Implement UART firmware download driver for NXP BT module.
Only support Murata 2EL M.2 Module on RT1170 EVKB.