Hello,
I am currently working on integrating Bluetooth functionality for the NXP 8997 chip with Android 13 on Toradex Verdin platform. I have encountered a few issues and have some questions regarding baudrate support.
Baudrate Support:
Firmware Compatibility:
Device Tree Settings:
I would appreciate any guidance or recommendations to resolve the baudrate issue and successfully run Bluetooth at a higher baudrate.
If you can share the firmware with 3M baudrate support for Toradex Verdin module that will be really helpful.
NOTE: Wifi is working as expected with the combo firmware used.
Thank you!
Hi @Christine_Li,
Yes, you can close this thread.
Thanks!!
Regards,
Rikin
Hi @Christine_Li ,
Thanks for your efforts.
I tried the parameters you suggested, but Bluetooth still doesn't seem to be working. I also tried changing "iSecondBaudrate" to both 1 and 0 without success.
I noticed that your config doesn't use the macro is_uart_port. We set is_uart_port = 1 to make Bluetooth work at a baud rate of 115200.
It seems like you might be using a different method/driver to get Bluetooth working. Could you please check my .config file and share yours? I've attached my .config file (path = out/target/product/evk_8mp/obj/KERNEL_OBJ/) for reference.
Hope we will get some fruitful outcome from this. Your continuous support is very helpful, thank you!
Regards,
Rikin
Hi, @rikinrshah
Thanks for your quick reply.
Please see attachment for my .config file. But this is for i.MX8MM because before I compiled my Android source code for I.MX8MM-EVK board. I am not sure whether it can be helpful for you.
Best regards,
Christine.
Hi @Christine_Li ,
Thanks for the .config file you provided. I tried to run Bluetooth in this settings too, but its still not working.
Just to narrow down my issue in one line,
I am facing an issue with updating the Bluetooth baud rate on my device. Currently, Bluetooth only works with a baud rate of 115200. Here are the details:
My questions are:
Any help or insights on resolving this issue would be greatly appreciated. Thank you!
Hi, @rikinrshah
Can you please try to download one of our Linux prebuilt image, and try to change baud rate to see whether has any HW issue on your board?
Are you using 88W8997 module? or your own designed board with 88W8997 chipset?
Best regards,
Christine.
Hi @Christine_Li ,
Thanks for your response.
1. No, I don't think so. I suspect it is a HW UART issue or the stty tool doesn't support 3M. Need to do some research and confirm.
-> I do not think that it would be a HW UART issue because it is working fine when we flash the Yocto image in it (Baud rate = 921600).
PS: We getting proper audio without glitches.
-> stty supports 3M baud rate. We confirmed this my updating the baud rate in the another board (mek_8qm) present with us.
2. As I know, we change the baud rate through this config file or change it in driver source code.
-> Can you please provide any information regarding where can we do changes in driver source code?
3. No, our FW should support 3M.
-> Okay, Noted!
4. There is no relationship with mlan.ko, mlan.ko is Wi-Fi driver, it has no relationship with BT UART baud rate.
-> Okay, Noted!
###Can you please try to download one of our Linux prebuilt image, and try to change baud rate to see whether has any HW issue on your board
-> Our Yocto linux is also working fine. Problem is with android.
###Are you using 88W8997 module? or your own designed board with 88W8997 chips
-> I am using Toradex Verdin IMX8MP.
Regards,
Rikin
Hi @Christine_Li ,
FYI, Below is the FW and ROM version of our BT firmware combo file:
1. FW version: 16.92.21.p84
2. ROM version: 00 00 02 04
Regards,
Rikin
Hi @Christine_Li ,
Can you please provide me your in use *.dtb?
It would be very much helpful for me.
Thanks,
Rikin
Hi, @rikinrshah
Please see my dts file in attachment.
And I also checked the readme located in "android_build/hardware/nxp/libbt", our default fw init baud rate is 115200, and baud rate you can set it by chaning baudrate_bt parameter in bt_vendor.conf
baudrate_fw_init: default bardrate when bluetooth fw active after download. The default value is 115200 in libbt. It's not necessary to configure this key in conf unless it need to choose other baudrate.
baudrate_bt: the baud rate expect to working on when bt running. The default value is 3000000 in libbt. It's not necessary to configure this key in conf unless it need to choose other baudrate.
My FW version is same with you:
FP92, 16.92.21.p84.4
Best regards,
Christine.
Hi @Christine_Li,
Thanks a lot for sharing the device tree file and quick response.
Your continuous support to us is really appreciated. This matters a lot.
Device tree file which you had shared is the one provided in the arch/arm64/boot/dts/freescale/... path.
But, I need the final .dtb file which is used in the hw for the test which you have done. Because, "bluetooth" node which you can see within uart1 is required for the yocto build where bluez stack is used and it uses the hci config way and not the direct UART port to read and write Bluetooth data. If you see "imx8mp-android.dtsi" is added for any android build which removes this "bluetooth" node. I want to confirm same by decoding the generated final dtb. And that is why I am requesting for final generated *.dtb. This will help us a lot.
On top of this, you have not set the "is_uart_port = 1" then how it send the data to the bluetooth module in Android OS because as I know and mention above, /dev/ttymcx0 in your case(/dev/ttymcx3 in my case) required to update baudrate to bluetooth module.
Same thing is done by the Marvell driver in yocto build to update baudrate once you load combo firmware. but, this is not possible in android build because of the reason mention earlier.
Data which you share help us a lot. And get us closer to our solution.
I hope that files which you have shared are from the android build just to make sure that we both on
same page.
Please share the below files so that we can debug it further by looking at your generated .dtb and .config file (in which BT is running properly):
1. .config file - out/target/product/evk_8mp/obj/KERNEL_OBJ/.config
2. final generated *.dtb file (the final in use .dtb file will be generated in this path) - out/target/product/evk_8mp/obj/
Just for your info, we have loaded yocto build on same hw and using the HCI method which I have mention earlier where marvell driver used where we are able to set baudrate of 921600 and able to play Music over A2DP profile also using ALSA utility so looks like issue possible on the imx UART driver which is used to configure baudrate in case of Android but at the same time, your resume give make different thought on the same.
Hi, @rikinrshah
Sure, I can provide the .dtb file, but it needs some time because I didn't compile IMX8MP Android source code locally. Before I compiled it for IMX8MM. I will compile it today for 8MP, and verify BT functions and baudrate, if it works well, I will share to you my .dtb file.
Before what I did is flashed the prebuilt image which is downloaded from our website.
And also is it possible for your HW to use Linux yocto build to change baud rate to 3M? or only can change to maxmum 921600?
Best regards,
Christine.
Hi @Christine_Li,
Thanks for your help throughout.
We are now able to set the baud rate to 3M and are also able to get proper audio without glitches.
Effective changes done:
1. Added assigned-clocks and assigned-clock-parents variables to uart4 node (BT node in my case) in imx8mp-verdin-wifi.dtsi file.
&uart4 { uart-has-rtscts; pinctrl-names = "default"; pinctrl-0 = <&pinctrl_bt_uart>; assigned-clocks = <&clk IMX8MP_CLK_UART4>; assigned-clock-parents = <&clk IMX8MP_SYS_PLL1_80M>; status = "okay"; };
2. Remove unnecessary macros from the bt_vendor.conf. Only kept the macros which we wanted to update from their respective default values.
mchar_port = /dev/ttymxc3 is_uart_port=1
Regards,
Rikin
Hi, @rikinrshah
Thanks for providing me this useful feedback and congratulations to the successful trial.
I will record this resolution and it is very useful for our future reference.
And would you mind close this thread for now?
Or anything else I can do for you on this case?
Best regards,
Christine.
Hi @Christine_Li ,
Yes correct, I am aware with the readme file. Thanks for the efforts.
Also, Are you sure that you are not using ```is_uart_port``` macro in your bt_vendor.conf file. Because that is very necessary in case of android build.
bt_vendor.conf file:
```
mchar_port = /dev/ttymxc3
#pFileName_helper = /vendor/firmware/mrvl/helper_uart_3000000.bin
#pFileName_image = /vendor/firmware/mrvl/uart8997_bt_v4.bin
#baudrate_dl_helper = 115200
#baudrate_dl_image = 115200
iSecondBaudrate = 0
baudrate_fw_init = 921600
baudrate_bt = 921600
is_uart_port=1
enable_download_fw=0
```
Hi, @rikinrshah
Yes, I am sure, there is no this parameter in my bt_vendor.conf.
Below is what I cat from my device (8MP-EVK) with Android 13:
evk_8mp:/vendor/etc/bluetooth # cat bt_vendor.conf
cat bt_vendor.conf
mchar_port = /dev/ttymxc0
#pFileName_helper = /vendor/firmware/mrvl/helper_uart_3000000.bin
#pFileName_image = /vendor/firmware/mrvl/uart8997_bt_v4.bin
#baudrate_dl_helper = 115200
#baudrate_dl_image = 3000000
iSecondBaudrate = 0
baudrate_fw_init = 3000000
baudrate_bt = 3000000
enable_download_fw=0
Best regards,
Christine.
Hi, @rikinrshah
I also tried on my local side, change to below, I will get music glitches.
C:\Users\nxf93258>adb shell
evk_8mp:/ # cat /vendor/etc/bluetooth/bt_vendor.conf
cat /vendor/etc/bluetooth/bt_vendor.conf
mchar_port = /dev/ttymxc0
#pFileName_helper = /vendor/firmware/mrvl/helper_uart_3000000.bin
#pFileName_image = /vendor/firmware/mrvl/uart8997_bt_v4.bin
#baudrate_dl_helper = 115200
#baudrate_dl_image = 3000000
iSecondBaudrate = 0
baudrate_fw_init = 115200
baudrate_bt = 115200
enable_download_fw=0
evk_8mp:/ #
I think it is because this line: baudrate_bt = 115200
So, I still insist that you need to change the baudrate_bt to 3000000. It should work.
If not work, would you mind to loop your host platform side supporter with us in an email loop to discuss further?
Best regards,
Christine.
Hi, @rikinrshah
Thanks for creating case to us.
Yes, 88W8997 can support 3M baud rate. And for your information, Bluetooth baud rate is related to UART, no relationship with SDIO or PCIe interface.
And also I checked the dts file: imx8mp-verdin-wifi.dtsi based on Linux kernel 6.1.36 on my side, it didn't mention max baud rate as below:
/* On-module Bluetooth */
&uart4 {
uart-has-rtscts;
pinctrl-names = "default";
pinctrl-0 = <&pinctrl_bt_uart>;
status = "okay";
};
Can you please let me know what is your Linux kernel version on your Android 13?
Because after Linux kernel version 6.1.22, we suggest to use our NXP own UART driver: btnxpuart.ko, not use the Linux default hciuart.ko driver.
For details, you can refer to below link:
Are you using Wi-Fi module or your designed board with our 88W8997 chipset?
May I ask your Wi-Fi/BT driver version and FW version?
Best regards,
Christine.
Thank you for your response.
I think the method you suggested works well with Yocto linux, but it won't work with Android as android systems handle hardware configuration and initialization differently than Linux. Also, we are not using the HCI for Bluetooth; instead, we are directly using /dev/ttymxc3 for Bluetooth communication.
[Note: We load the firmware using mlan.ko.]
The main issue I'm facing is that Bluetooth works fine at a 115200 baud rate. However, I get audio glitches when connected to Bluetooth, possibly due to the low baud rate. I tried updating the baud rate to 3M, but when I do, Bluetooth stops working. (I have also raised another ticket for this. For more details, you can check the link.)
I hope this clarifies my issue!
Regards,
Rikin
Hi, @rikinrshah
Thanks for your reply.
May I ask where do you mean the configuration file?
Can you please let me know the configuration file location on your board?
And also, please have a try with below parameters when you use combo FW:
mchar_port = /dev/ttymxc3
#pFileName_helper = /vendor/firmware/mrvl/helper_uart_3000000.bin
#pFileName_image = /vendor/firmware/mrvl/uart8997_bt_v4.bin
#baudrate_dl_helper = 115200
#baudrate_dl_image = 115200
iSecondBaudrate = 0
baudrate_fw_init = 3000000
baudrate_bt = 3000000
is_uart_port=1
enable_download_fw=0
I downloaded our default I.MX8MP-EVK prebuilt image based on Android13-Linux kernel 6.1.22, and insert the PCIE-UART AzureWave Module 276-MA (88W8997 chipset), after I connected BT headset with my I.MX8MP-EVK, I can listen music clearly on my BT headset.
Then I checked the default baud rate in the i.mx8mp-evk.dts file, I saw the default FW init baud rate is 3M.
That is why I request to have a try with changing the default baud rate of FW init.
Below is for your reference:
&uart3 { /* BT */
pinctrl-names = "default";
pinctrl-0 = <&pinctrl_uart3>;
assigned-clocks = <&clk IMX8MQ_CLK_UART3>;
assigned-clock-parents = <&clk IMX8MQ_SYS1_PLL_80M>;
fsl,uart-has-rtscts;
resets = <&modem_reset>;
status = "okay";
bluetooth {
compatible = "nxp,88w8997-bt";
fw-init-baudrate = <3000000>;
};
};
Best regards,
Christine.
Hi Christine,
Thank you for performing a test for us, you gesture is really appreciated!!
Happy to see that you are now able to understand our issue.
1. By configuration file I mean bt_vendor.conf file:
hardware/nxp/libbt/conf/nxp/evk_8mp/bt_vendor.conf
2. Configuration file path in the board:
/vendor/etc/bluetooth/bt_vendor.conf
I have also tried the parameters you recommend, but Bluetooth is not working, it stopped working and also doesn't allow me to configure the 3M baudrate.
As you mentioned the snippet related to &uart3 node where bluetooth node is provided but in android build the node is deleted. I have confirmed this by referring imx8mp-android.dtsi file.
As I know, in android for bluetooth communication hci interface is not used, instead they use tty for bluetooth communication. It is strange that you are able to configure 3M baudrate but i am not. Is there any other specification we need to change? or any other firmware we need to use, If yes, please share that FW with us, It would be really helpful.
Regards,
Rikin