回答

收藏

飞凌嵌入式ElfBoard ELF1板卡-开发板适配之蓝牙

其他 其他 713 人阅读 | 0 人回复 | 2025-03-03

添加驱动
RTL8723DU还具备蓝牙功能,现在我们添加ELF 1开发板对RTL8723DU蓝牙功能的支持。
一、RTL8723DU蓝牙驱动在ELF 1开发板资料包\02-Linux 源代码\ 02-1 驱动源码\08_realtek\bluetooth\rtkbt中

将这几个文件复制到内核源码的drivers/bluetooth/目录下。
另外在ELF 1开发板资料包\02-Linux 源代码\ 02-1 驱动源码\08_realtek\bluetooth\firmware下还有RTL8723DU的蓝牙固件:

需要复制到开发板根文件系统的lib/firmware/目录下,RTL8723DU在初始化过程中,会加载此固件,我们的文件系统已经放好了这两个固件文件,这里不再添加。
二、更改drivers/bluetooth/下Makefile文件
打开drivers/bluetooth/Makefile文件,添加如下内容:
obj-$(CONFIG_BT_HCIBTUSB_RTLBTUSB) := rtk_btusb.o
rtk_btusb-objs := rtk_bt.o rtk_misc.o rtk_coex.o

打开drivers/bluetooth/Kconfig文件,添加如下内容:
config BT_HCIBTUSB_RTLBTUSB
        tristate "Realtek HCI USB driver support"
        depends on USB
        help
        Realtek Bluetooth HCI USB driver.
        This driver is required if you want to use Realtek Bluetooth
        device with USB interface.
        Say Y here to compile support for Bluetooth USB devices into the
        kernel or say M to compile it as module (rtk_btusb).
效果如下:

三、内核配置
在以下路径,添加下图配置:
Networking support
-> Bluetooth subsystem support

在以下路径,添加下图配置:
Networking support
-> Bluetooth subsystem support
-> Bluetooth device drivers

在以下路径,添加下图配置:
Device Drivers
-> Input device support
-> Miscellaneous devices

在以下路径,添加下图配置:
Device Drivers
-> HID support

通过make menuconfig修改的内容写入到了.config文件,当使用make imx6ull_elf1_defconfig配置内核源码时,.config文件会被覆盖,因此,需要替换原有的imx6ull_elf1_defconfig。
elf@ubuntu:~/work/linux-imx-imx_4.1.15_2.0.0_ga$ cp .config arch/arm/configs/imx6ull_elf1_defconfig

编译测试
编译内核、设备树和模块并拷贝到开发板:
elf@ubuntu:~/work/linux-imx-imx_4.1.15_2.0.0_ga$ ./build.sh
elf@ubuntu:~/work/linux-imx-imx_4.1.15_2.0.0_ga$ scp arch/arm/boot/zImage   root@172.16.0.175:/run/media/mmcblk1p1/
elf@ubuntu:~/work/linux-imx-imx_4.1.15_2.0.0_ga$ scp .tmp/rootfs/modules.tar.bz2 root@172.16.0.175:/
在开发板中解压modules.tar.bz2
root@ELF1:~# tar xvf /modules.tar.bz2
进行sync操作后重启开发板:

编译之后,将镜像加载到开发板,测试方法参考《01-0 ELF1、ELF1S开发板_快速启动手册_V1》“3.1.19 蓝牙测试”章节。

分享到:
回复

使用道具 举报

您需要登录后才可以回帖 注册/登录

本版积分规则

关闭

站长推荐上一条 /3 下一条