Hello,
We want to use the SC16IS752IPW,128 (I2C to UART) to drive the LBEE5CJ1XK-687 Bluetooth module (based on NXP IW416). We can see /dev/ttySC0 and /dev/ttySC1, but after running "modprobe btnxpuart", there is no response. Using "hciattach /dev/ttySC0 any 115200 flow" results in the following error.
What could be the reason for this? Below is our modified dts. Is there any mistake in our setup?
Solved! Go to Solution.
Hi, @Leo-Yang
After discussed internally, for you, because you are using sc16is752's I2C to UART, there is no UART node default in the device tree. And at the same time, sc16is752 generates 2 tty devices: ttySC0 and ttySC1. So it is difficult to indicate and bind which tty UART device to Bluetooth. That is why when using modprobe command, could not load Bluetooth driver successfully.
So for you using case, we suggest you use hciattach command to load, not modprobe command.
And for your information, if you feel this command is too complex or not convenient, you can write a load script together with Wi-Fi's driver when your host platform whole device boot-up.
Please let me know if you have any other concerns on this case.
If no other questions or concerns, please help to mark it as solution, so that we can close this case. Thanks.
Best regards,
Christine.
Hi, @Leo-Yang
May I know your Linux kernel version?
Our Bluetooth driver has been change to btnxpuart after Linux 6.1.22. You can refer to this link:
And also can you please provide me the list of /dev/tty* on your device?
At the same time, I will also check the detailed dts you shared.
Best regards,
Christine.
Hi @Christine_Li,
Thank you for your reply. We are using the i.MX Linux Yocto Project BSP 6.6.3_1.0.0 Release.
Below is the list of /dev/tty* devices you requested:
Best regards,
Leo
Hi, @Leo-Yang
Are you sure the ttySC0 or ttySC1 is for Bluetooth?
Have you tried ttySC1? and how about ttymxc0-3?
And also, I saw your screenshot you are using modprobe hci_uart. When you use modprobe btnxpuart, there is nothing output? Can you please provide me dmesg logs?
In your device, can you find btnxpuart.ko file?
Can you please try with 3M baudrate to see whether it works?
Are you using our I.Mx8MP-EVK? Or your own designed board with our i.MX8MP chip?
Best regards,
Christine.
Hi Christine,
Sorry for the late reply. Below are my responses based on your questions.
root@imx8mpevk:~# modprobe moal mod_para=nxp/wifi_mod_para.conf
[ 119.352970] mlan: loading out-of-tree module taints kernel.
[ 119.382201] wlan: Loading MWLAN driver
[ 119.386264] wlan: Register to Bus Driver...
[ 119.391061] vendor=0x02DF device=0x9159 class=0 function=1
[ 119.396710] Attach moal handle ops, card interface type: 0x108
[ 119.402608] rps set to 0 from module param
[ 119.408523] SDIW416: init module param from usr cfg
[ 119.413493] card_type: SDIW416, config block: 0
[ 119.418077] cfg80211_wext=0xf
[ 119.421060] max_vir_bss=1
[ 119.423685] cal_data_cfg=none
[ 119.426665] ps_mode = 1
[ 119.429125] auto_ds = 1
[ 119.431579] host_mlme=enable
[ 119.434472] fw_name=nxp/sdiouartiw416_combo_v0.bin
[ 119.439294] SDIO: max_segs=128 max_seg_size=65535
[ 119.444012] rx_work=1 cpu_num=4
[ 119.447173] Enable moal_recv_amsdu_packet
[ 119.451213] Attach mlan adapter operations.card_type is 0x108.
[ 119.457452] wlan: Enable TX SG mode
[ 119.460980] wlan: Enable RX SG mode
[ 119.468934] Request firmware: nxp/sdiouartiw416_combo_v0.bin
[ 119.733327] Wlan: FW download over, firmwarelen=583644 downloaded 575272
[ 120.996906] WLAN FW is active
[ 120.999886] on_time is 120999070000
[ 121.033939] VDLL image: len=8372
[ 121.037286] FW country code WW does not match with US
[ 121.042590] fw_cap_info=0x187ccf03, dev_cap_mask=0xffffffff
[ 121.048199] max_p2p_conn = 8, max_sta_conn = 8
[ 121.070819] Register NXP 802.11 Adapter mlan0
[ 121.078739] Register NXP 802.11 Adapter uap0
[ 121.087496] Register NXP 802.11 Adapter wfd0
[ 121.092642] wlan: version = SDIW416---16.92.21.p119.2-MM6X16437.p3-GPL-(FP92)
[ 121.107687] wlan: Register to Bus Driver Done
[ 121.112385] wlan: Driver loaded successfully
root@imx8mpevk:~# modprobe btnxpuart
root@imx8mpevk:~# hciattach /dev/ttymxc0 any 115200 flow
[ 157.912067] Bluetooth: HCI UART driver ver 2.3
[ 157.916555] Bluetooth: HCI UART protocol H4 registered
[ 157.921726] Bluetooth: HCI UART protocol BCSP registered
[ 157.927145] Bluetooth: HCI UART protocol LL registered
[ 157.932306] Bluetooth: HCI UART protocol ATH3K registered
[ 157.937843] Bluetooth: HCI UART protocol Three-wire (H5) registered
[ 157.944216] Bluetooth: HCI UART protocol QCA registered
Device setup complete
root@imx8mpevk:~# [ 158.175929] kauditd_printk_skb: 14 callbacks suppressed
[ 158.175944] audit: type=1334 audit(1695209461.496:14): prog-id=13 op=LOAD
[ 158.188096] audit: type=1334 audit(1695209461.504:15): prog-id=14 op=LOAD
[ 159.964849] Bluetooth: hci0: command 0x1003 tx timeout
[ 159.964849] Bluetooth: hci0: Opcode 0x1003 failed: -110
root@imx8mpevk:~# hciconfig hci0 up
[ 171.196848] Bluetooth: hci0: command 0x1003 tx timeout
[ 171.196852] Bluetooth: hci0: Opcode 0x1003 failed: -110
Can't init device hci0: Connection timed out (110)
root@imx8mpevk:~# hciconfig -a
hci0: Type: Primary Bus: UART
BD Address: 00:00:00:00:00:00 ACL MTU: 0:0 SCO MTU: 0:0
DOWN
RX bytes:0 acl:0 sco:0 events:0 errors:0
TX bytes:8 acl:0 sco:0 commands:2 errors:0
Features: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00
Packet type: DM1 DH1 HV1
Link policy:
Link mode: PERIPHERAL ACCEPT
root@imx8mpevk:~#
Best regards,
Leo
Hi, @Leo-Yang
1.Can you please check on your board what is your voltage for UART_RTS, UART_CTS, UART_TXD, and UART_RXD?
I checked our I.MX8MP's schematics it is 1.8V:
Below is cut from Murata 1XK:
2. Please confirm your device tree with your designed board HW connections is correctly related, and also the GPIO number. Otherwise, you can send to me your HW schematics, I can check it for you. For security, please send to my private email: christine.li@nxp.com instead of posting here the public community.
3.Please check your UART_RTS, UART_CTS, UART_TXD, and UART_RXD connected correctly.
Best regards,
Christine.
Hi Christine,
Our hardware engineers believe there are no issues with the wiring. If you have any doubts, I will send you the HW schematics later. Additionally, we are using /dev/ttymxc0 for testing, and the device tree is configured as follows. The same error message appears.
&uart1 {
pinctrl-names = "default";
pinctrl-0 = <&pinctrl_uart1>;
fsl,dte-mode;
status = "okay";
assigned-clocks = <&clk IMX8MP_CLK_UART1>;
assigned-clock-parents = <&clk IMX8MP_SYS_PLL1_80M>;
uart-has-rtscts;
bluetooth {
compatible = "nxp,88w8987-bt";
fw-init-baudrate = <115200>;
pinctrl-names = "default";
pinctrl-0 = <&pinctrl_modem_bt>;
device-wakeup-gpios = <&gpio4 23 GPIO_ACTIVE_HIGH>;
reset-gpios = <&gpio3 21 GPIO_ACTIVE_LOW>;
};
};
pinctrl_uart1: uart1grp {
fsl,pins = <
MX8MP_IOMUXC_SAI2_RXFS__UART1_DTE_RX 0x140
MX8MP_IOMUXC_SAI2_RXC__UART1_DTE_TX 0x140
MX8MP_IOMUXC_SAI2_TXFS__UART1_DTE_RTS 0x140
MX8MP_IOMUXC_UART3_TXD__UART1_DTE_CTS 0x140
>;
};
pinctrl_modem_bt: modem_bt_grp {
fsl,pins = <
MX8MP_IOMUXC_SAI2_RXD0__GPIO4_IO23 0x10
MX8MP_IOMUXC_SAI5_RXD0__GPIO3_IO21 0x10
>;
};
Best regards,
Leo
Hi, @Leo-Yang
Can you please try without setting it into dce-mode?
And also make sure below part is correct?
I saw there is UART3_TXD keyword.
If still faile, I need your schematics of 8MP board to check further.
Best regards,
Christine.
&uart1 {
pinctrl-names = "default";
pinctrl-0 = <&pinctrl_uart1>;
fsl,dte-mode;
status = "okay";
assigned-clocks = <&clk IMX8MP_CLK_UART1>;
assigned-clock-parents = <&clk IMX8MP_SYS_PLL1_80M>;
uart-has-rtscts;
bluetooth {
compatible = "nxp,88w8987-bt";
fw-init-baudrate = <115200>;
pinctrl-names = "default";
pinctrl-0 = <&pinctrl_modem_bt>;
device-wakeup-gpios = <&gpio4 23 GPIO_ACTIVE_HIGH>;
reset-gpios = <&gpio3 21 GPIO_ACTIVE_LOW>;
};
};
pinctrl_uart1: uart1grp {
fsl,pins = <
MX8MP_IOMUXC_SAI2_RXFS__UART1_DTE_RX 0x140
MX8MP_IOMUXC_SAI2_RXC__UART1_DTE_TX 0x140
MX8MP_IOMUXC_SAI2_TXFS__UART1_DTE_RTS 0x140
MX8MP_IOMUXC_UART3_TXD__UART1_DTE_CTS 0x140
>;
};
pinctrl_modem_bt: modem_bt_grp {
fsl,pins = <
MX8MP_IOMUXC_SAI2_RXD0__GPIO4_IO23 0x10
MX8MP_IOMUXC_SAI5_RXD0__GPIO3_IO21 0x10
>;
};
Hi, @Leo-Yang
Please request your HW colleague help to check below connection directions:
According to LBEE5CJ1XK datasheet, GPIO_9 reset state is output, but in your schematics, this pin connected to 1.8_BT_UART_TX, and according to SC16IS752 datasheet, TXA signal direction is also output. I think the signal is opposite. The same issue is on 1.8_BT_UART_RX.
So, please help request your HW colleague to double confirm. If I am wrong, please do not hesitate to correct me.
Best regards,
Christine.
Hi @Christine_Li ,
pinctrl_uart1: uart1grp {
fsl,pins = <
MX8MP_IOMUXC_SAI2_RXC__UART1_DCE_RX 0x140 //AJ16
MX8MP_IOMUXC_SAI2_RXFS__UART1_DCE_TX 0x140 //AH17
MX8MP_IOMUXC_SAI2_TXFS__UART1_DCE_CTS 0x140 //AJ7
MX8MP_IOMUXC_UART3_TXD__UART1_DCE_RTS 0x140 //AJ4
>;
};
According to the LBEE5CJ1XK datasheet, we should refer to Table 7: Pin Descriptions, so you are probably wrong.
We want to confirm whether the setting compatible = "nxp,88w8987-bt"; is correct? As previously mentioned, after we ran modprobe btnxpuart, no messages were output.
Best regards,
Leo
Hi, @Leo-Yang
I double checked LBEE5CJ1XK 's datasheet, yes, you are right.
GPIO_9(UART_RXD) and GPIO_10(UART_TXD) connection is correct in your schematics according to Table 7. Sorry for the misunderstandings and confusion.
I found a typo; it should be "MX8MP_IOMUXC_SAI2_TXFS__UART1_DCE_CTS 0x140 //AJ17."
==>
1.Do you meanSAI2_TXFS__UART1, especially the "__" is typo?
2.After you correct it, does it work well on your side?
Best regards,
Christine.
Hi @Christine_Li ,
Sorry, I expressed myself incorrectly. What I meant was that there was a typo in my last post.
MX8MP_IOMUXC_SAI2_TXFS__UART1_DCE_CTS 0x140 //AJ7 -> AJ17
The situation is still the same and has not improved.
Best regards,
Leo
Hi, @Leo-Yang
Thanks for your explanation.
Can you please check this part:
pinctrl_uart1: uart1grp {
fsl,pins = <
MX8MP_IOMUXC_SAI2_RXC__UART1_DCE_RX 0x140 //AJ16
MX8MP_IOMUXC_SAI2_RXFS__UART1_DCE_TX 0x140 //AH17
MX8MP_IOMUXC_SAI2_TXFS__UART1_DCE_CTS 0x140 //AJ17
MX8MP_IOMUXC_UART3_TXD__UART1_DCE_RTS 0x140 //AJ4
>;
};
Especially the last line?
I saw for other configurations, you are using SAI2, only the last line is UART3. I suggest you to double check this part.
Or if you can share to me your 8MP-board schematics, will check it for further details.
Best regards,
Christine.
Hi @Christine_Li ,
Sorry, it seems that there was an internal communication issue on our side. We have modified the sc16is752 interrupts, and it can work now.
interrupts = <15 IRQ_TYPE_LEVEL_LOW>; //old
interrupts = <18 IRQ_TYPE_LEVEL_HIGH>; //new
Additionally, I would like to ask if the btnxpuart can only be used with the native UART, and whether it cannot be used with an expanded UART? This is because we ended up using hciattach /dev/ttySC0 any 115200 flow to drive Bluetooth.
Thank you very much for your assistance.
Best regards,
Leo
Hi, @Leo-Yang
Thanks for sharing me this good news. Very glad to hear that with hciattach method, Bluetooth can work now.
For btnxpuart driver, in theory, I think if indicate it in device tree, it should also work even with expanded UART interface.
Have you tried with native uart1 and modprobe btnxpuart can work?
But with sc16is752 expanded UART interface, modprobe btnxpuart doesn't work. Right?
I need to check our btnxpuart driver source code to see what is the relationship between which UART interface and btnxpuart driver.
Best regards,
Christine.
Hi, @Leo-Yang
After discussed internally, for you, because you are using sc16is752's I2C to UART, there is no UART node default in the device tree. And at the same time, sc16is752 generates 2 tty devices: ttySC0 and ttySC1. So it is difficult to indicate and bind which tty UART device to Bluetooth. That is why when using modprobe command, could not load Bluetooth driver successfully.
So for you using case, we suggest you use hciattach command to load, not modprobe command.
And for your information, if you feel this command is too complex or not convenient, you can write a load script together with Wi-Fi's driver when your host platform whole device boot-up.
Please let me know if you have any other concerns on this case.
If no other questions or concerns, please help to mark it as solution, so that we can close this case. Thanks.
Best regards,
Christine.
Hi @Christine_Li ,
Thank you for helping me confirm the btnxpuart issue. After successfully setting up the sc16is752 expanded UART interface, we didn't test the native uart1 part anymore. However, previously, we used the EVK with the AW-CM358MA, and modprobe btnxpuart worked.
Thanks again for your assistance.
Best regards,
Leo