Pico W HID Over GATT host freeze

36 views
Skip to first unread message

Stéphane Lenclud

unread,
Feb 1, 2025, 1:44:47 PMFeb 1
to btstack-dev
Hi,

I have this HID host application on Pico W that was only doing classic host. Now I'm trying to add BLE HID Over GATT too.
I had the impression that connecting a Logitech LIFT mouse worked just fine. However connecting a Lenovo ThinkPad Keyboard II appears to freeze the board, periodic timer callback stops firing.
So I thought I would try get the HCI logs. But after disabling my own logs and enabling the HCI it seems behaviour is somewhat different so I wonder if the Pico SDK 2.0.0 is being funny with the poll behaviour.

Still I got some logs I'll post here as soon as I figure how.

Cheers,
S.

Stéphane Lenclud

unread,
Feb 1, 2025, 2:40:12 PMFeb 1
to btsta...@googlegroups.com
Here are the logs.
It does an inquiry and a scan at the same time then connects to a device.
The logs were taken from a poll build.
I switched to background mode and I get the same issue with the keyboard anyway.
Worth noting that both devices can connect to HOG host example on SDK 2.1.0 so it is possibly something I'm doing in my app that's causing the issue.
I'm a little clueless at this point. 
I could try deactivating stuff from my app and hoping I get to a point where it works and gain an understanding of what is causing the issue.
That's easier said than done though.
The last log I get from my app when connecting the keyboard is from SM_EVENT_IDENTITY_CREATED then it hangs.



--
You received this message because you are subscribed to the Google Groups "btstack-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to btstack-dev...@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/btstack-dev/b929c806-facb-42dd-9fbc-2645d367f01fn%40googlegroups.com.
BLE-ThinkPad-Keyboard-pairing.pklg
BLE-Logitech-LIFT-pairing.pklg

Stéphane Lenclud

unread,
Feb 1, 2025, 2:46:31 PMFeb 1
to btstack-dev
I'm working with an older commit of develop but I tried the tip of develop and it's the same issue. 
I also tried v1.6.1 which what pico-sdk is using and that's the same issue.
Using the latest radio driver.

Stéphane Lenclud

unread,
Feb 1, 2025, 2:52:21 PMFeb 1
to btstack-dev
Could it somehow be caused by the fact that I'm using both HID host modes, classic and BLE?
That's certainly a major difference with the example.
It seems to be a timing issue as disabling my logs and onboard LCD display appears to change the outcome somewhat.
Maybe I should try to switch to Pico 2 W and see if that one works.

Stéphane Lenclud

unread,
Feb 2, 2025, 3:28:12 PMFeb 2
to btsta...@googlegroups.com
I have a feeling something goes wrong with the flashing, sometimes after the failed pairing and reboot to try again it does find the identity but the key is of size 0 I believe.
See attached logs.


BLE-ThinkPad-connect.pklg

Matthias Ringwald

unread,
Feb 3, 2025, 2:50:01 AMFeb 3
to btsta...@googlegroups.com
Hi Stéphane

Please use the develop branch from Pico SDK which uses a BTstack version newer than v1.6.2.
Using the latest Pico SDK release with a newer BTstack version did cause a few bytes getting overridden. when using GATT Client This has been fixed now.
Mayne you've run into that.

Cheers
Matthias
> To view this discussion visit https://groups.google.com/d/msgid/btstack-dev/CANJitvaGG8VvGq1prHw_CyVChr0zxJoSL%3DAzx7aH5z0tdZE2NQ%40mail.gmail.com.
> <BLE-ThinkPad-connect.pklg>

Stéphane Lenclud

unread,
Feb 3, 2025, 2:55:29 PMFeb 3
to btstack-dev
I could eventually switch to pico-sdk develop which points to a btstack commit just above v1.6.2.
First attempt to connect to that keyboard fails but no freeze. Second attempt freezes.
Workflow was somewhat different it seems but same end result. I'll try get the logs.

Stéphane Lenclud

unread,
Feb 3, 2025, 3:50:18 PMFeb 3
to btstack-dev
Interestingly I have the same issue after switching to Pico 2 W. Freeze after identity creation. 

Stéphane Lenclud

unread,
Feb 11, 2025, 11:01:29 AMFeb 11
to btsta...@googlegroups.com
There are logs of that freeze. This one is marked dirty because it might not have been the first attempt at connecting that device.

BLE-ThinkPad-Pico2W-Dirty-Freeze.pklg

Stéphane Lenclud

unread,
Feb 12, 2025, 2:29:39 PMFeb 12
to btstack-dev
I would love to be able to make some progress with that but I'm not sure what to look for.
Now I have the app working just fine with a Logitech Lift mouse but that ThinkPad keyboard just won't connect for some reason.
Since the issue does not seem to be specific to older SDK/btstack versions nor Pico/Pico 2 board  the first log files I sent are probably relevant too.
Still I could generate new ones if need be.

Stéphane Lenclud

unread,
Feb 14, 2025, 2:10:09 PMFeb 14
to btstack-dev

Stéphane Lenclud

unread,
Feb 18, 2025, 7:43:14 AMFeb 18
to btstack-dev
Turns out the crash is caused by enabling add_compile_definitions(PICO_USE_STACK_GUARDS=1).
Reply all
Reply to author
Forward
0 new messages