linux4wilc / firmware

Firmware binaries for Microchip ATWILC Wireless Devices (ATWILC1000 & ATWILC3000)
https://www.microchip.com/wwwproducts/en/ATWILC1000
Other
16 stars 9 forks source link

Bluetooth failed after scan with WILC3000 SHIELD: tx timeout #12

Closed aurelien9 closed 4 years ago

aurelien9 commented 4 years ago

Description

I am trying to use the WILC3000 shield with Wifi and Bluetooth. I am using a raspberry cm3+ and I build the OS with yocto (zeus branch). I compiled the last version of the wilc-sdio driver directly into the kernel. Wifi is working well in SDIO mode but I have some trouble to make the Bluetooth working. I have connected RX and TX pins of the WILC3000 to UART0 of the cm3+ (pin 14 & 15).

Problem

I am able to flash the firmware to the module with the following commands:

# echo BT_POWER_UP > /dev/wilc_bt
[   31.898268] at_pwr_dev: open()
[   31.898488] AT PWR: bt_power_up
[   31.898600] Device already up. request source is BT
[   31.899270] at_pwr_dev: close()
# echo BT_FW_CHIP_WAKEUP > /dev/wilc_bt
[   36.508998] at_pwr_dev: open()
[   36.509159] at_pwr_dev: close()
# echo BT_DOWNLOAD_FW > /dev/wilc_bt
[   59.894277] at_pwr_dev: open()
[   59.894436] AT PWR: bt_download_fw
[   59.894554] Bluetooth firmware: /wilc3000_ble_firmware.bin
[   59.899602] Downloading BT firmware size = 58700 ...
[   59.947157] Starting BT firmware
[   60.062409] BT Start Succeeded
[   60.062644] at_pwr_dev: close()
# echo BT_FW_CHIP_ALLOW_SLEEP > /dev/wilc_bt
[   36.508998] at_pwr_dev: open()
[   36.509159] at_pwr_dev: close()

After that, I attach my serial port:

# hciattach ttyAMA0 any 115200 noflow
[  114.276782] Bluetooth: HCI UART driver ver 2.3
[  114.276969] Bluetooth: HCI UART protocol H4 registered
[  114.277236] Bluetooth: HCI UART protocol Three-wire (H5) registered
[  114.277766] Bluetooth: HCI UART protocol Broadcom registered
[  114.473695] Bluetooth: BNEP (Ethernet Emulation) ver 1.3
[  114.473920] Bluetooth: BNEP filters: protocol multicast
[  114.474113] Bluetooth: BNEP socket layer initialized
[  114.509280] Bluetooth: RFCOMM TTY layer initialized
[  114.509493] Bluetooth: RFCOMM socket layer initialized
[  114.509678] Bluetooth: RFCOMM ver 1.11
# hciconfig hci0 up

At this point, everything is working as expected. I can switch the module up and down as many time I want.

But when I try to make a scan (or any command to get bt information from the module), I have the following error:

# bluetoothctl
[bluetooth]# scan on
[CHG] Controller XX:XX:XX:XX:XX Discovering: yes
[  213.752228] Bluetooth: hci0: command 0x200c tx timeout
[  213.752245] Bluetooth: hci0: failed to disable LE scan: status 0x1f

After that, the module stop working, if I try to make it up or down I have the following error:

[  272.072240] Bluetooth: hci0: command 0x1003 tx timeout
[  274.152240] Bluetooth: hci0: command 0x1001 tx timeout
[  276.232233] Bluetooth: hci0: command 0x1009 tx timeout

The module does not respond anymore.

Does someone already experienced this issue ?

It looks like the firmware on the module encountered a problem. I have checked with a scope and all TX messages are good but after the scan command I do not have any RX message.
I have nothing on the debug UART (except the message when I download the module).

Thank you in advance for your response.

Aurélien

AdhamAbozaeid commented 4 years ago

Hi @aurelien9 I can't reproduce this problem on my setup. Please open a support ticket on salesforce http://microchipsupport.force.com/

aurelien9 commented 4 years ago

Thank you for your answer but I solved the problem. It was due to the UART0 of the raspberry compute module. I changed to the UART1 (miniuart) and it works now. I also think that my wire were to long and so the signal was bad.

AdhamAbozaeid commented 4 years ago

Thanks for the updates!