adafruit / adafruit/Adafruit_nRF52_Arduino

Unable to use gamepad features for Adafruit Feather nrf52832

Open
#723 8 comments 0 reactions 0 assignees View on GitHub
Bug
Dominant language
C
Stars
699
Forks
570
PR merge metrics
No merged PRs in 30d

Description

### Operating System

Linux

### IDE version

1.18.19

### Board

Adafruit Feather nrf52832

### BSP version

Github latest

### Sketch

https://github.com/adafruit/Adafruit_nRF52_Arduino/blob/master/libraries/Bluefruit52Lib/examples/Peripheral/blehid_gamepad/blehid_gamepad.ino

### What happened ?

I am able to successfully connect over Bluetooth to my board, however, it is classified as type "Unknown" and none of the gamepad features, like the joystick or buttons, register. The same code works fine on Windows.

### How to reproduce ?

1. Upload basic starter code to board
2. Connect board via bluetooth to computer
3. The device is initially recognized as a gamepad, but changes to Unknown, and none of the inputs work.

### Debug Log

I suspect it is something to do with a faulty device descriptor. See below:
```
jeff@pop-os:~$ sudo systemctl status bluetooth
● bluetooth.service - Bluetooth service
Loaded: loaded (/lib/systemd/system/bluetooth.service; enabled; vendor preset: enabled)
Active: active (running) since Sun 2022-03-27 19:35:03 PDT; 1min 45s ago
Docs: man:bluetoothd(8)
Main PID: 8024 (bluetoothd)
Status: "Running"
Tasks: 1 (limit: 16507)
Memory: 1.2M
CGroup: /system.slice/bluetooth.service
└─8024 /usr/lib/bluetooth/bluetoothd

Mar 27 19:36:34 pop-os bluetoothd[8024]: profiles/input/hog-lib.c:report_map_read_cb() Report Map read failed: Invalid handle
Mar 27 19:36:34 pop-os bluetoothd[8024]: profiles/input/hog-lib.c:info_read_cb() HID Information read failed: Invalid handle
Mar 27 19:36:35 pop-os bluetoothd[8024]: profiles/input/hog-lib.c:report_reference_cb() Malformed ATT read response
Mar 27 19:36:41 pop-os bluetoothd[8024]: profiles/input/hog-lib.c:proto_mode_read_cb() ATT protocol error
Mar 27 19:36:41 pop-os bluetoothd[8024]: profiles/input/hog-lib.c:report_reference_cb() Read Report Reference descriptor failed: Attribute can't be read
Mar 27 19:36:41 pop-os bluetoothd[8024]: profiles/input/hog-lib.c:report_reference_cb() Read Report Reference descriptor failed: Invalid handle
Mar 27 19:36:41 pop-os bluetoothd[8024]: profiles/input/hog-lib.c:report_reference_cb() Read Report Reference descriptor failed: Invalid handle
Mar 27 19:36:41 pop-os bluetoothd[8024]: profiles/input/hog-lib.c:report_map_read_cb() Report Map read failed: Invalid handle
Mar 27 19:36:41 pop-os bluetoothd[8024]: profiles/input/hog-lib.c:info_read_cb() HID Information read failed: Invalid handle
Mar 27 19:36:41 pop-os bluetoothd[8024]: profiles/input/hog-lib.c:report_reference_cb() Malformed ATT read response
```

### Screenshots

https://i.imgur.com/XnU79nS.png
https://i.imgur.com/TYw3PZ1.png
https://i.imgur.com/GXWnf3O.png

Contributor guide

No contributing guide indexed for this repository

Research direction

Start with libraries/Bluefruit52Lib/examples/Peripheral/blehid_gamepad/blehid_gamepad.ino and reproduce the Bluetooth connection on Linux using the reported board and IDE versions. Review the Bluetooth HID debug output for the descriptor-related failure; done means the device remains recognized as a gamepad and its joystick and button inputs register.

Written by the indexing model from the issue text.

Assessment

Tech stack
c
Domain
embedded-iot
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.