现在的位置: 首页 > 综合 > 正文

tiny210针对USI_WM-BN-BM-04的bluetooth的配置过程

2018年02月15日 ⁄ 综合 ⁄ 共 2191字 ⁄ 字号 评论关闭

 

1.1硬件配置:

USI_WM-BN-BM-04EVB板为usb转串口模式的,在实际过程中,直接采用USI_WM-BN-BM-04的串口与cpu的串口1相连:

 

BT

CPU

说明

RTS

CTS(UART1)

这个四个脚都需要上拉,不然会状态不稳定(调试过程中发现)

CTS

RTS(UART1)

RXD

TXD(UART1)

TXD

RXD(UART1)

BT_RST_N(in)

GPIO(out)

BTRESET脚,由cpu的一个gpio控制

BT_REG_ON(in)

GPIOout

BT的电源控制脚,由cpu的一个gpio控制

BT_HOST_WAKE(out)

GPIOin

BT的唤醒主机中断脚,cpu使用io口中断输入

BT_WAKE(in)

GPIOout

主机唤醒BT脚,由cpu的一个gpio控制

目前

BT_RST_N(in)

GPIO(out)

BT_REG_ON(in)

GPIOout

BT_HOST_WAKE(out)

GPIOin

BT_WAKE(in)

GPIOout

未调试。

 

1.2
内核配置:

1.2.1
串口驱动配置

      
使用官方的串口驱动。

 

1.2.2蓝牙内核配置

1 bt1)

Networking support --->

      
Bluetooth subsystem support --->

2 bt2)

Networking support --->

      
Bluetooth subsystem support --->

             
Bluetooth device drivers --->

3 bt3)

Networking support --->

      
RF switch subsystem support --->

 

1.2.3针对于RFKILL的说明

因为在创建android服务的时候才创建了rfkill0这个节点,然后就是节点里有个statetype,是在android中的蓝牙的硬件抽象层中要打开的,而这个有权限,所以后来在创建的时候就给他最高的权限了。具体在net/rfkill/core.c中,有个rfkill_dev_attrs,然后只要把修改为__ATTR(state,
S_IRWXUGO, rfkill_state_show, rfkill_state_store),
_ATTR(type, S_IRWXUGO, rfkill_type_show, NULL)这样android系统在打开蓝牙的时候,就不会出现权限的问题。

 

1.3
系统配置

1.3.1目前采用的是tiny210官方发布的可以支持蓝牙的android文件系统编译,所以基本上没有修改

(这个可以参照网路上相关文献,虽然我没成功

      
类似的在\android-4.0.3_r1\device\friendly-arm\mini210下的BoardConfig.mk中添加:

BOARD_HAVE_BLUETOOTH := true

http://blog.csdn.net/eastmoon502136/article/details/7846796)。

 

1.3.2系统配置驱动固件

1

BCM4330B1_002.001.003.0833.0931_CL2.hcd(_WM-BN-BM-04_Bluetooth_FW_v002.001.003.0833.0931.hcd)改名并放在data目录下:

/data/WM-BN-BM-04.hcd

/data/BCM4329B1.hcd

2usih4_arm
改名为usih并放在/system/bin/目录下

/system/bin/usih

 

1.3.3启动配置文件修改

1)在
init.mini210.rc
下添加:(vi init.mini210.rc

# permissions for bluetooth.

   
chown bluetooth bluetooth /efs/bluetooth

   
chown bluetooth bluetooth ro.bt.bdaddr_path

   
chown bluetooth bluetooth /dev/s3c2410_serial1

   
chmod 0600 /dev/s3c2410_serial1

   
chmod 0660 /sys/class/rfkill/rfkill0/state

   
chown bluetooth bluetooth /sys/class/rfkill/rfkill0/state

   
chown bluetooth bluetooth /sys/class/rfkill/rfkill0/type

service hciattach /system/bin/usih -n /dev/s3c2410_serial1 WM-BN-BM-04 921600
flow

    
user root

    
disabled

    
oneshot

 

2/system/etc
init.mini210.sh
最后一行添加:(vi /system/etc/init.mini210.sh

usih -a 0001000000 -l 010101 -n -u -d 5000 -y -f /data/WM-BN-BM-04.hcd /dev/s3c2410_serial1
WM-BN-BM-04 921600 flow

 

 

经过以上的配置整个系统应该就支持USI_WM-BN-BM-04bt

抱歉!评论已关闭.