Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

AIROC™ Wi-Fi and Wi-Fi Bluetooth Combos Forum Discussions

WIFI-01
Level 2
Level 2
10 replies posted 10 sign-ins 5 replies posted

主控平台是stm157 linux5.4, 目前加载系统自带的hci_uart.ko 加载固件的时候超时 wifi功能正常,但是有蓝牙设备出来。模组是cyw43438的模组。帮忙看下 .

谢谢。

[root@100:~]# cp -r bcm43438a1.hcd /lib/firmware/brcm/BCM43430A1.hcd
[root@100:~]# ls -l /lib/firmware/brcm/BCM43430A1.hcd
-rw------- 1 root root 33664 Feb 7 15:54 /lib/firmware/brcm/BCM43430A1.hcd
[root@100:~]#
[root@100:~]#

[root@100:~]# echo 0 > /sys/class/rfkill/rfkill1/state
[root@100:~]#
[root@100:~]#
[root@100:~]# echo 1 > /sys/class/rfkill/rfkill1/state
[root@100:~]#
[root@100:~]#
[root@100:~]#
[root@100:~]# insmod hci_uart.ko
[ 242.383223] Bluetooth: HCI UART driver ver 2.3
[ 242.386241] Bluetooth: HCI UART protocol H4 registered
[ 242.392495] Bluetooth: HCI UART protocol BCSP registered
[ 242.396903] Bluetooth: HCI UART protocol LL registered
[ 242.402009] Bluetooth: HCI UART protocol ATH3K registered
[ 242.407350] Bluetooth: HCI UART protocol Three-wire (H5) registered
[ 242.419884] Bluetooth: HCI UART protocol Intel registered
[ 242.431427] hci_uart_bcm serial0-0: serial0-0 supply vbat not found, using dummy regulator
[ 242.434557] Bluetooth: HCI UART protocol Broadcom registered
[ 242.448011] Bluetooth: HCI UART protocol QCA registered
[ 242.451981] Bluetooth: HCI UART protocol AG6XX registered
[ 242.459467] hci_uart_bcm serial0-0: serial0-0 supply vddio not found, using dummy regulator
[ 242.461506] Bluetooth: HCI UART protocol Marvell registered
[root@100ask:~]# [ 242.859958] Bluetooth: hci0: BCM: chip id 94
[ 242.863263] Bluetooth: hci0: BCM: features 0x2e
[ 242.868568] Bluetooth: hci0: BCM43430A1
[ 242.871312] Bluetooth: hci0: BCM43430A1 (001.002.009) build 0000
[ 245.129207] Bluetooth: hci0: command 0x1a1a tx timeout
[ 253.289132] Bluetooth: hci0: BCM: Patch command 1a1a failed (-110)
[ 253.293861] Bluetooth: hci0: BCM: Patch failed (-110)
[ 255.369133] Bluetooth: hci0: command 0x0c03 tx timeout
[ 263.529199] Bluetooth: hci0: BCM: Reset failed (-110)

[root@100ask:~]#
[root@100ask:~]# hciconfig
hci0: Type: Primary Bus: UART
BD Address: 00:00:00:00:00:00 ACL MTU: 0:0 SCO MTU: 0:0
DOWN
RX bytes:1411 acl:0 sco:0 events:163 errors:0
TX bytes:33820 acl:0 sco:0 commands:165 errors:0

 

0 Likes
18 Replies
Owen_Zhang123
Moderator
Moderator
Moderator
500 solutions authored 250 sign-ins 1000 replies posted

请检查一下rfkill是否对应的是蓝牙的上电指令?

另外,请量一下BT_REG_ON上的信号有没有起来。

0 Likes

您好 感谢支持。

    BT_REG_ON一直是3.3v 。这两个好像没起到什么作用echo 0 > /sys/class/rfkill/rfkill1/state echo 1 > /sys/class/rfkill/rfkill1/state。

0 Likes

请检查一下linux设备里是否能看到响应的串口,类似ttyS0,ttyS1这样的串口。

BT_REG_ON一直是高也是有问题的,这个脚应该是主控去拉的。

0 Likes

您好

这个串口接口是有的  [root@100:~]# ls /dev/ttySTM1
/dev/ttySTM1

0 Likes

请把你的工具链发过来,我们这边编译一个mbt的工具,试试看通过mbt发送指令是否可以。

0 Likes

您好

工具链下面链接下载一下  gcc是这个arm-buildroot-linux-gnueabihf-gcc

链接:https://pan.baidu.com/s/1VHVVl46tmdfgYEaxa8mm6A
提取码:wqaf
--来自百度网盘超级会员V6的分享

0 Likes

您好

这个是系统用的蓝牙源码

0 Likes

BT_REG_ON也不是一直高 加载hci_uart.ko才变高

0 Likes
Zhengbao_Zhang
Moderator
Moderator
Moderator
First comment on KBA 10 questions asked 5 questions asked

hello:

  可以做一个测试, 我提供一个工具,chip的reg on上电后,其他和蓝牙相关的任何程序都不跑。

然后用我们这个工具做一下reset看是否可以正常返回, 用于测试uart口是否可以正常通信。

rename to mbt, 执行下面的操作, 我们平常测试,只是上电reset会有正常返回值:

Usage: mbt reset

Command: ./mbt reset
tx:
01 03 0c 00
rx: (7 bytes)
04 0e 04 01 03 0c 00

0 Likes
Zhengbao_Zhang
Moderator
Moderator
Moderator
First comment on KBA 10 questions asked 5 questions asked

类似于这样:

Usage: mbt reset /dev/ttyUSBx

The example below sends HCI_Reset command to the device and processes the HCI
Command Complete event (BLUETOOTH SPECIFICATION Version 4.1 [Vol 2], Section
7.3.2 for details).

/home/test/test$ ./mbt reset /dev/ttyUSB1
Opened port /dev/ttyUSB1
writing
01 03 0c 00
received 7
04 0e 04 01 03 0c 00
exiting.

0 Likes

您好 感谢支持。

我再确认下串口是tty几再用mbt 工具验证一下,发现系统不加载hcd固件 蓝牙也是正常  不知道有没有什么风险 不加载可以吗,附件是完整的日志,如果替换43438的hcd到相应的目录则会加载固件超时就是开始问的问题。

谢谢。

 

0 Likes

您好  用你提供的工具测试了 没回复成功,但是用./brcm_patchram_plus --enable_hci --no2bytes --tosleep 200000 --baudrate 115200 --patchram bcm43438a1.hcd /dev/ttySTM2 &有跑起来  但是蓝牙hci设备没出来,再帮忙看看。附件是完整日志。现在有控制BT_REG_ON拉低拉高复位  设备节点也确定是这个/dev/ttySTM2 

谢谢

[root@100:~]# ./mbt_test reset /dev/ttySTM2
Opened port /dev/ttySTM2
writing
01 03 0c 00
writing
01 03 0c 00
writing
01 03 0c 00
writing
01 03 0c 00
writing
01 03 0c 00
writing
01 03 0c 00
[22:47:47:091][root@100ask:~]#
[22:47:56:406][root@100ask:~]# ./brcm_patchram_plus --enable_hci --no2bytes --tosleep 200000 --baudrate 115200 --patchram bcm43438a1.hcd /dev/ttySTM2 &
[22:48:00:135][1] 521
[22:48:00:147][root@100ask:~]# option enable_hci
[22:48:00:147]option no2bytes
[22:48:00:147]option tosleep with arg 200000
[22:48:00:148]option baudrate with arg 115200
[22:48:00:167]option patchram with arg bcm43438a1.hcd
[22:48:00:167]/dev/ttySTM2
[22:48:00:167]writing
[22:48:00:168]01 03 0c 00
[22:48:04:160]writing
[22:48:04:160]01 03 0c 00
[22:48:04:160]received 7
[22:48:04:161]04 0e 04 01 03 0c 00
[22:48:04:161]writing
[22:48:04:161]01 2e fc 00
[22:48:04:161]received 7
[22:48:04:161]04 0e 04 01 2e fc 00
[22:48:04:352]writing
[22:48:04:352]01 4c fc 46 00 17 21 00 42 52 43 4d 63 66 67 53
[22:48:04:353]00 00 00 00 32 00 00 00 01 01 04 90 65 00 00 00
[22:48:04:364]03 06 ac 1f 12 a1 43 43 00 01 1c 42 17 21 00 00
[22:48:04:368]00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
[22:48:04:368]00 00 00 00 00 00 00 fe 00 00
[22:48:04:369]received 7
[22:48:04:369]04 0e 04 01 4c fc 00
[22:48:04:369]writing

0 Likes
Zhengbao_Zhang
Moderator
Moderator
Moderator
First comment on KBA 10 questions asked 5 questions asked

hello:

      brcm_patchram 和mbt功能是接近的,现在看上去download firmware成功了, 需要再确认的是你的firmware是否是从module maker那边拿到的匹配版本,如果firmware错误也会有问题。 而且个人觉得download firmware这些动作不会影响到hciconfig interface的创建,这个需要中间层自己去运行,比如create一个interface和目前的controller匹配这样。

0 Likes

您好 

固件是没问题的,是原厂提供的,其他平台上用过没问题,download firmware是成功了吗  但是没有hci设备出来接下来需要如何移植 如果用brcm_patchram。

谢谢。

0 Likes
Zhengbao_Zhang
Moderator
Moderator
Moderator
First comment on KBA 10 questions asked 5 questions asked

换言之,hci0的创建时在驱动insmod的时候创建的,需要将这部分patch download的工作在hciuart的startup的时候调试ok,应该就可以了。

[ 242.461506] Bluetooth: HCI UART protocol Marvell registered
[root@100ask:~]# [ 242.859958] Bluetooth: hci0: BCM: chip id 94
[ 242.863263] Bluetooth: hci0: BCM: features 0x2e
[ 242.868568] Bluetooth: hci0: BCM43430A1
[ 242.871312] Bluetooth: hci0: BCM43430A1 (001.002.009) build 0000
[ 245.129207] Bluetooth: hci0: command 0x1a1a tx timeout
[ 253.289132] Bluetooth: hci0: BCM: Patch command 1a1a failed (-110)
[ 253.293861] Bluetooth: hci0: BCM: Patch failed (-110)
[ 255.369133] Bluetooth: hci0: command 0x0c03 tx timeout
[ 263.529199] Bluetooth: hci0: BCM: Reset failed (-110)

0 Likes
Zhengbao_Zhang
Moderator
Moderator
Moderator
First comment on KBA 10 questions asked 5 questions asked

建议的模式时这样:

我觉着在download firmware的时候我们需要115200 的baud rate, 这个时候如果使用hci的default的代码,可能会存在rate不匹配的情况。 所以可以这样做,建议先上电后,用:

./brcm_patchram_plus --enable_hci --no2bytes --tosleep 200000 --baudrate 115200 --patchram bcm43438a1.hcd /dev/ttySTM2 &

这部分的动作就是指定--baudrate 115200 波特率,指定uart dev。

这个download成功。

在hci的代码中,将这部分直接return success,看是否可以跑起来。

[ 242.868568] Bluetooth: hci0: BCM43430A1
[ 242.871312] Bluetooth: hci0: BCM43430A1 (001.002.009) build 0000
[ 245.129207] Bluetooth: hci0: command 0x1a1a tx timeout
[ 253.289132] Bluetooth: hci0: BCM: Patch command 1a1a failed (-110)
[ 253.293861] Bluetooth: hci0: BCM: Patch failed (-110)

0 Likes

您好  目前蓝牙起来了,完整日志见附件。另外想请教下

1、现在brcm_patchram_plus 没加-d参数但是日志打印非常多的十六进制hci cmd,可以不显示这些打印吗, 打印log有点太多

2、有什么命令可以看hcd固件版本号吗

谢谢。

0 Likes
Zhengbao_Zhang
Moderator
Moderator
Moderator
First comment on KBA 10 questions asked 5 questions asked

可以看下:

brcm_patchram_plus  --help 里面是否有log level设置。

版本信息可以通过vendor specific 的一些command 读取出来, 比如read_version.

可以要求支持你们的vendor帮忙用cytool 测试下。

0 Likes