rtl8821cs BT调试过程

rtl8821cs BT调试过程
1,添加到/linux-4.1.15/drivers/bluetooth rtl8821驱动代码
hci_h4.c hci_ldisc.c hci_rtk_h5.c hci_uart.h rtk_coex.c rtk_coex.h

2,修改config file:添加如下代码
config BT_HCIUART_3WIRE
bool “Three-wire UART (H5) protocol support”
depends on BT_HCIUART
help
The HCI Three-wire UART Transport Layer makes it possible to
user the Bluetooth HCI over a serial port interface. The HCI
Three-wire UART Transport Layer assumes that the UART
communication may have bit errors, overrun errors or burst
errors and thereby making CTS/RTS lines unnecessary.

Say Y here to compile support for Three-wire UART protocol.

3,修改makefile
hci_uart-y := hci_ldisc.o
hci_uart-$ (CONFIG_BT_HCIUART_H4) += hci_h4.o
hci_uart-$ (CONFIG_BT_HCIUART_BCSP) += hci_bcsp.o
hci_uart-$ (CONFIG_BT_HCIUART_RTKH5) += hci_rtk_h5.o rtk_coex.o

4,配置menuconfig
Networking support —> Bluetooth subsystem support —>Bluetooth device drivers —>
< m > HCI UART driver
[ * ] UART (H4) protocol support
[ ] BCSP protocol support
[ * ] Realtek H5 protocol support

5,make zImage -j16
6,make modules -j16

代码下载:
https://download.csdn.net/download/ruslan1/11275293
https://download.csdn.net/download/ruslan1/11351253

运行脚本:
#!/bin/sh
insmod /lib/modules/hci_uart.ko
./rtk_hciattach -n -s 115200 ttymxc2 rtk_h5&
sleep 3
/etc/init.d/bluetooth start
hciconfig hci0 up
echo “BT init Finshed!”

你可能感兴趣的:(技术)