Hi everyone,
my setup: Linux 4.14rc2, bluez 5.47. SoC + Qualcomm BT chip, connected via UART.
The default speed of the UART is 115200 bps, which is obviously slow, need 3M bps.
I already found out, how to do it: send a HCI command
0x01 0x48 0xFC 0x01 0x0E
In other words: OGF=0x3F, OCF=0x0048, plen=1, pdata=0xE
...and reset the UART after 300 millis with new speed.
This is possible via 'hcitool', but it breaks running instances of btattach...
I would like to make btattach to do it for me at startup. Is there a way to configure it?
It seems that hciattach had this possibility, but dunno if not already deprecated in bluez 5.47 and how to use it.
Thanks for any suggestions!!
Libor
Hi Marcel,
I tried to log what's going on both in case of my btattach-kill-btattach wo=
rkaround case, and in case i run only 'btattach -P qca' and bluetoothd is n=
ot working afterwards. You can find the logs at
http://stuff.krakonos.org/files/btmonSee.tar.bz2
I'm not really able to understand the output myself :(
Thank you for further comments,
Libor
-----Urspr=FCngliche Nachricht-----
Von: Marcel Holtmann [mailto:[email protected]]=20
Gesendet: Mittwoch, 18. Oktober 2017 16:31
An: Libor Peltan <[email protected]>
Cc: [email protected]
Betreff: Re: UART baud rate to 3M within btattach
Hi Libor,
> Thank you Marcel, your suggestion solved my issue:
>=20
> I had to compile the kernel with CONFIG_BT_HCIUART_QCA.
> I must also call following at the bootup:
>=20
> btattach -S 3000000 -P qca
> sleep 1
> killall btattach
> sleep 1
> btattach -S 3000000 -P h4
> bluetoothd
>=20
> ...otherwise bluetoothd doesn't work (=3Dfinds 0 adapters).
> But I'm glad to have this workaround :)
actually only one btattach command should be needed. If this doesn't work, =
we should fix hci_qca.c to support it. Since after loading the firmware and=
configuring the UART speed, the QCA protocol will automatically run H4. No=
need to kill btattach and restart it with a different protocol.
Can you share "btmon -w trace.log" traces?
Regards
Marcel
Hi Libor,
> Thank you Marcel, your suggestion solved my issue:
>
> I had to compile the kernel with CONFIG_BT_HCIUART_QCA.
> I must also call following at the bootup:
>
> btattach -S 3000000 -P qca
> sleep 1
> killall btattach
> sleep 1
> btattach -S 3000000 -P h4
> bluetoothd
>
> ...otherwise bluetoothd doesn't work (=finds 0 adapters).
> But I'm glad to have this workaround :)
actually only one btattach command should be needed. If this doesn't work, we should fix hci_qca.c to support it. Since after loading the firmware and configuring the UART speed, the QCA protocol will automatically run H4. No need to kill btattach and restart it with a different protocol.
Can you share "btmon -w trace.log" traces?
Regards
Marcel
Thank you Marcel, your suggestion solved my issue:
I had to compile the kernel with CONFIG_BT_HCIUART_QCA.
I must also call following at the bootup:
btattach -S 3000000 -P qca
sleep 1
killall btattach
sleep 1
btattach -S 3000000 -P h4
bluetoothd
...otherwise bluetoothd doesn't work (=3Dfinds 0 adapters).
But I'm glad to have this workaround :)
Libor
-----Urspr=FCngliche Nachricht-----
Von: Marcel Holtmann [mailto:[email protected]]=20
Gesendet: Mittwoch, 18. Oktober 2017 14:14
An: Libor Peltan <[email protected]>
Cc: [email protected]
Betreff: Re: UART baud rate to 3M within btattach
Hi Libor,
> I call 'btattach -P h4', because ath3k and qca options would simply reply=
'protocol not supported'.
>=20
> My point is how to send the HCI command inside, or before btattach launch=
.
that is done by the different protocols drivers. Use a kernel that has supp=
ort for ath3k or qca. Otherwise you can not do it. It designed that the ker=
nel does the UART handling and the setup (including firmware loading etc.).
Regards
Marcel
Hi Libor,
> I call 'btattach -P h4', because ath3k and qca options would simply reply 'protocol not supported'.
>
> My point is how to send the HCI command inside, or before btattach launch.
that is done by the different protocols drivers. Use a kernel that has support for ath3k or qca. Otherwise you can not do it. It designed that the kernel does the UART handling and the setup (including firmware loading etc.).
Regards
Marcel
Thanks Marcel for your answer.
I call 'btattach -P h4', because ath3k and qca options would simply reply '=
protocol not supported'.
My point is how to send the HCI command inside, or before btattach launch.
Thanks :)
-----Urspr=FCngliche Nachricht-----
Von: Marcel Holtmann [mailto:[email protected]]=20
Gesendet: Mittwoch, 18. Oktober 2017 14:05
An: Libor Peltan <[email protected]>
Cc: [email protected]
Betreff: Re: UART baud rate to 3M within btattach
Hi Libor,
> my setup: Linux 4.14rc2, bluez 5.47. SoC + Qualcomm BT chip, connected vi=
a UART.
> The default speed of the UART is 115200 bps, which is obviously slow, nee=
d 3M bps.
>=20
> I already found out, how to do it: send a HCI command
> 0x01 0x48 0xFC 0x01 0x0E
> In other words: OGF=3D0x3F, OCF=3D0x0048, plen=3D1, pdata=3D0xE ...and re=
set=20
> the UART after 300 millis with new speed.
>=20
> This is possible via 'hcitool', but it breaks running instances of btatta=
ch...
>=20
> I would like to make btattach to do it for me at startup. Is there a way =
to configure it?
>=20
> It seems that hciattach had this possibility, but dunno if not already de=
precated in bluez 5.47 and how to use it.
so it depends on your hardware. Is the QCA or ATH hardware? Try btattach -P=
qca or btattach -P ath3k and see if it will change the baudrate and do the=
correct setup.
Regards
Marcel
Hi Libor,
> my setup: Linux 4.14rc2, bluez 5.47. SoC + Qualcomm BT chip, connected via UART.
> The default speed of the UART is 115200 bps, which is obviously slow, need 3M bps.
>
> I already found out, how to do it: send a HCI command
> 0x01 0x48 0xFC 0x01 0x0E
> In other words: OGF=0x3F, OCF=0x0048, plen=1, pdata=0xE
> ...and reset the UART after 300 millis with new speed.
>
> This is possible via 'hcitool', but it breaks running instances of btattach...
>
> I would like to make btattach to do it for me at startup. Is there a way to configure it?
>
> It seems that hciattach had this possibility, but dunno if not already deprecated in bluez 5.47 and how to use it.
so it depends on your hardware. Is the QCA or ATH hardware? Try btattach -P qca or btattach -P ath3k and see if it will change the baudrate and do the correct setup.
Regards
Marcel