imx8mpevk can't receive file over bluetooth

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

imx8mpevk can't receive file over bluetooth

1,792 Views
Derek0902
Contributor II

Based on i.MX8MP-EVK And Linux 6.1.36_2.1.0 demo image

Hi,

I follow the UM11483 to enable AW-CM276MA-PUR Wi-Fi / Bluetooth module.

Then follow this page to transfer file over Bluetooth : 

https://community.nxp.com/t5/Wireless-Connectivity-Knowledge/How-to-Transfer-File-From-Linux-Platfor...

 

i.MX8MP-EVK can transfer file to my laptop, but can't receive file from my laptop.

How can I fix this problem?

 

Regards,

Derek Lin

0 Kudos
19 Replies

1,752 Views
Christine_Li
NXP TechSupport
NXP TechSupport

Hi, @Derek0902 

Please refer to my written documents about how to receive files using OBEX based on Linux.

After reading this doc, if still have any problem please let me know, we can discuss further.

 

Best regards,

Christine.

Tags (2)
0 Kudos

1,738 Views
Derek0902
Contributor II

Hi, @Christine_Li 

thanks for your help.

Now, my Bluetooth occurred some problem when I use laptop connect with evk.

Derek0902_0-1699952134297.png

How can I fix it ?

 

Regards,

Derek Lin

 

0 Kudos

1,727 Views
Christine_Li
NXP TechSupport
NXP TechSupport

Hi, @Derek0902 

From you given logs, it seems there is some error on host(Bluez) side. Bluez is an open Bluetooth stack for Linux platform, it is out of support.

1.You can remove the device from the connected device list.

2.Also you can rmmod Wi-Fi/Bluetooth driver, and insmod/modprobe again to have a try.

3.How about reboot your whole host Linux MPU?

4.If still doesn't work, please share your whole detailed steps and your logs, we discuss together further.

 

Best regards,

Christine.

 

Tags (1)
0 Kudos

1,711 Views
Derek0902
Contributor II

Hi, @Christine_Li 

It still have the same problem.

Here is my step :

I followed the  IMXLXYOCTOUG to build the image and my BSP version is 6.1.36_2.1.0 .

1. Modified the local.conf  

 

 

$ nano /opt/yocto/imx-6.1.36-2.1.0-build/build_fsl-imx-xwayland/conf/local.conf

 

 

Derek0902_0-1700048897759.png

2. Build an image

 

 

$ bitbake imx-image-full

 

 

 3.  Flashing an SD card image

 

$ zstdcat <image_name>.wic.zst | sudo dd of=/dev/sd<partition> bs=1M conv=fsync

 

4. Load Wi-Fi / Bluetooth module (use default parameter in wifi_mod_para.conf)

 

$ modprobe moal mod_para=nxp/wifi_mod_para.conf

 

 5. Load Bluetooth UART driver & Enable Bluetooth

 

$ modprobe btnxpuart
$ hciconfig hci0 up

 

6. Use bluetoothctl to connect my ubuntu laptop

7. Check Bluetooth status and found a2dp error

I have tried rebooting device and removing Bluetooth device from device list both laptop and evk, it still can not work.

But I found that there is no /dev/ttymxc0, only /dev/ttymxc1 and /dev/ttymxc2.

Maybe the UART used by Bluetooth is not enabled?

 

By the way, I originally used the demo image to test Bluetooth. 

Now, I use the image built by myself. 

 

 

Regards,

Derek Lin

 

0 Kudos

1,700 Views
Christine_Li
NXP TechSupport
NXP TechSupport

Hi, @Derek0902 

The reason you could not see /tty/mxc0 is we compile Bluetooth driver into Linux kernel BSP as a module: btnxpuart.ko

You can find this .ko file after compiled Linux kernel BSP.

For your reference, my compiled directory is: /linux-source-code/6.1.36-2.1.0/linux-imx/drivers/bluetooth/btnxpuart.ko

Christine_Li_0-1700104959247.png

Because you are using the Image built by yourself, and Bluetooth driver is not including your Image, so you need to copy this .ko  to your board, then modprobe or insmod it.

Then Bluetooth can work as expected.

 

Best regards,

Christine.

0 Kudos

1,693 Views
Derek0902
Contributor II

Hi @Christine_Li ,

Did you mean I need to compile btnxpuart again?

I found my Bluetooth kernel source at this path.

Derek0902_1-1700108984417.png

Is there any user manual about compiling BSP?

I just know how to bitbake an image.

 

But the btnxpuart.ko was already exist on board.

Derek0902_0-1700108703963.png

I can find ttymxc0 in dmesg, but  use hciattach no /dev/ttymxc0 appear..

Derek0902_0-1700110337246.png

 

Regards,

Derek Lin

 

0 Kudos

1,672 Views
Christine_Li
NXP TechSupport
NXP TechSupport

Hi, @Derek0902 

Great, then can you insmod or modprobe btnxpuart.ko successfully?

Can you please help to provide your full logs for further tracking?

 

Best regards,

Christine.

0 Kudos

1,666 Views
Derek0902
Contributor II

Hi @Christine_Li ,

 

Sorry, I think the problem may occur on my ubuntu laptop.

Because I use my smart phone Bluetooth can connect to board.

It also can transfer and receive file correctly.

 

But I use my smart phone can connect to laptop too.

Is there any setting on Bluetooth for laptop?

 

Regards,

Derek Lin

 

 

0 Kudos

1,652 Views
Christine_Li
NXP TechSupport
NXP TechSupport

Hi, @Derek0902 

I am so sorry, I am not familiar with your laptop side environment.

But for our side, there is no limitations whether remote side is phone or laptop.

Anyway, it is good news to know that we can work fine with your phone.

 

Best regards,

Christine.

0 Kudos

1,647 Views
Derek0902
Contributor II

Hi, @Christine_Li 

I have found the problem.

When the imx8mpevk boot from SD card.

1. Load Wi-Fi / Bluetooth module

$ modprobe moal mod_para=nxp/wifi_mod_para.conf

2. Load Bluetooth UART driver 

$ modprobe btnxpuart

3. Check hci0

$ hciconfig hci0 up
$ hciconfig -a

4. The service classes is only audio

5. I follow the release note to enter this command

class.png

 

$ /usr/bin/pulseaudio --start --log-target=syslog

6. The service classes appear Rendering and Capturing

螢幕擷取畫面 2023-11-16 173129.png

Now all problems have been fixed.

But I don't know what this command do.

Are there any method that can change the Service Classes?

 

Regards,

Derek Lin

 

0 Kudos

1,617 Views
Christine_Li
NXP TechSupport
NXP TechSupport

Hi, @Derek0902 

Thanks for sharing your solution about this case.

But it looks very strange, as I know there is no relationship between OBEX (File Transferring via Bluetooth Based on the Obex Protocol)  and Pulseaudio.

From my side, I have to say sorry because I could not explain the reason. But we can record your solution as a workaround when we meet this kind of issue.

Thanks again for sharing your discovery.

 

Best regards,

Christine.

0 Kudos

1,612 Views
Derek0902
Contributor II

Hi @Christine_Li ,

When you connect Bluetooth and transfer file successfully what Service Classes display in " hciconfig -a "? 

In my case, it need to appear Rendering and Capturing in Service Classes of hciconfig. The Bluetooth can work correctly.

To change Services Classes, there are two methods here :

1. This is found in release note, I don't what it mean..

 

$ /usr/bin/pulseaudio --start --log-target=syslog

 

 

2. Use hciconfig to change classes value

 

$ hciconfig hci0 class 0x2c0000

 

bluetooth_service_list.png

Service Classes : Rendering, Capturing, Audio (value = 0x040000 + 0x080000 + 0x200000 = 0x2c0000)

 

Regards,

Derek Lin

0 Kudos

1,603 Views
Christine_Li
NXP TechSupport
NXP TechSupport

Hi, @Derek0902 

It is a good question.

I checked the document I have shared to you recording how to receive files using OBEX Protocol, the Services Classes showing only Audio.

So it is very strange on your laptop side, it could not send to I.MX8MP.

You mentioned, it can work well with your Phone. Is your phone IOS or Android platform?

How about your laptop?

Maybe there are some limitations on OS?

Best regards,

Christine.

 

0 Kudos

1,547 Views
Derek0902
Contributor II

Hi @Christine_Li 

My phone is Google Pixel 8 Pro and it is Android platform.

My laptop is ubuntu.

I also have tried windows laptop. It can receive file, but it can not transfer file. Because evk can't connect laptop with OBEX.

 

BTW,

I have another question that how can I auto load wifi/bluetooth module after rebooting ?

Whenever I want to modify the BSP and run new tests. I need to modprobe wifi / bluetooth module again.

 

Regards,

Derek Lin

0 Kudos

1,521 Views
Christine_Li
NXP TechSupport
NXP TechSupport

Hi, @Derek0902 

Thanks for your feedback.

From your feedback, I think there is some relationship with remote platform. Then What is your using scenario? For you end using, prefer to transfer file with Ubuntu or Windows or Android Phone?

We can discuss separately.

For auto load Wi-Fi/Bluetooth module after rebooting, it is a customized requirement. You can realize it by writing a script to load automatically. Because we need to load firmware when loading driver, and firmware is located in file system. It results in loading driver in U-Boot phase is not possible. 

Best regards,

Christine.

0 Kudos

1,447 Views
Derek0902
Contributor II

Hi @Christine_Li ,

 

1. I think as long as it is a device that can transfer files via Bluetooth. All devices must able to transfer to and from evk.

 

2. Have you tested the transfer speed of Bluetooth? It need to take about 10~12 minute to transfer 100MB .bin test file. 

 

3. If there are a lot of evk which needed to enable Wi-Fi / Bluetooth, I cannot build in pre-build image and flash to emmc or sd card to make it work, right? Isn't there any other way to modify it in BSP?

 

Thanks & Regards,

Derek Lin

0 Kudos

1,428 Views
Christine_Li
NXP TechSupport
NXP TechSupport

Hi, @Derek0902 

Thanks for your feedback.

1.Yes, you are right. In theory, it is possible, and also according to your work around. Can you please use with the current work around(set the Service Class)?

2. Have you tested the transfer speed of Bluetooth?

=>No, I didn't test it before. But for transfer file, we don't suggest use Bluetooth to transfer file. It is very slow. You can think about Wi-Fi Direct to transfer file. The speed is really higher than Bluetooth. 

3.You can build it into Linux BSP. But because Wi-Fi FW is located to file system. It needs to load Wi-Fi Firmware when loading Wi-Fi driver.  So you still need to load Wi-Fi driver after Linux OS boot up. That is why I suggest you to write a load Wi-Fi Driver script to implement auto loading driver process. And use Linux OS load your script automatically such as put the loading process in the file seems like init.rc.

 

Best regards,

Christine.

0 Kudos

1,344 Views
Derek0902
Contributor II

Hi @Christine_Li ,

1. Yes, I can. I would use this method to solve it fist. If there are any problems, I will come back for inquiries.

2. You are right! I just want to test some functions here.I don’t think anyone will use Bluetooth transmission. 

3. I modified the rc.local in yocto project. Now, it can auto load the firmware and driver when it boot up after flash the image. Thanks for your advice.

Derek0902_1-1701060899409.png

There are no problems now. You can close this post, thanks. 

 

Regards,

Derek Lin

0 Kudos

1,337 Views
Christine_Li
NXP TechSupport
NXP TechSupport

Hi, @Derek0902 

Great job and thank you so much for your sharing.

Sure, I will close this thread for now and please feel free to create a new once you have any other queries.

Have a nice day~

 

Best regards,

Christine.

0 Kudos