user1820451
user1820451

Reputation: 173

bcm43xx_init Initialization timed out with buildroot raspberry pi 3 hciattach

I am trying to get the Bluetooth to work in Raspberry Pi 3.

I am using buildroot with:

  1. BlueZ 5.45 ( changed the package to get the latest)
  2. Not using systemd, but I run bluetoothd because the bluez script is for systemd.
  3. In buildroot I enabled the bt firmware.
  4. I can see the hci_uart.ko file and the Bluetooth firmware hcd file
  5. I removed the console=ttyAMA0,115200 from cmdline.txt
  6. I added rfkill for busybox but I only see the wifi interface, no Bluetooth interface.

running:

hciattach /dev/ttyAMA0 bcm43xx 921600 noflow -

output showed:

bcm43xx_init
Initialization timed out

tried 115200, the same.

Notes:

  1. When using BlueZ 3 I am getting invalid id
  2. I read that it is somehow related to BlueZ version so I did take the latest

All the above was taken after deep search.

So what I am missing here?

How can I get the Bluetooth to start running in my Raspberry Pi 3 with buildroot as image creator?

Thank you all!

Upvotes: 2

Views: 6900

Answers (2)

user1820451
user1820451

Reputation: 173

The main problem is that buildroot adds the pi3-miniuart-bt overlay in config.txt.

To remove it we need to remove if from the post-image.sh script as parameter to the above script.

In raspberry pi 3 the ttyAMA0 was assigned to bluetooth and the pi3-miniuart-bt restored it back to be serial com port, which disconnects the bluetooth again.

To summarize the steps in buildroot.

  1. Add the bluetooth firmware.
  2. Add bluez 5 utils.
  3. Change the package from bluez 5.44 to 5.45
  4. Add the above sleep. (delete the .stamp_build in bluez to build it again)
  5. remove the /dev/ttyAMA0 from cmdline.txt

After building, check on the target (pi3)

  1. the BCM4343 hcd firmware
  2. hci_uart.ko should be there

hci_uart is not running in case of busybox init (only in systemd) so just modprobe hci_uart. run lsmod to see that it is running.

To start the service and load the firmware, use hciattach:

hciattach /dev/ttyAMA0 bcm43xx 921600 noflow -

Start the bluetoothd daemon:

/usr/libexec/bluetooth/bluetoothd &

Power up the bluetooth hardware using bluetoothctl (power on and agent on). Now you should see it using hcitool dev.

Again, if you don't remove the overlay you will get timeout.

That it. the hci device should be seen now. you can see it using:

  1. rfkill list ( install it from busybox-menuconfig)
  2. hciconfig -a

The above steps does not get the console to work properly on the Pi 3 but this is a different story.

Upvotes: 4

Peter Korsgaard
Peter Korsgaard

Reputation: 696

As described in the commit adding the firmware, you unfortunately need to patch bluez5_utils to get the firmware to work:

https://git.buildroot.net/buildroot/commit/?id=1f94f1aaab2e786542a83327358570a828d68f45

Upvotes: 2

Related Questions