Linux-enabled BLE HID peripheral

I am trying to develop a BLE HID peripheral that can be used on Ubuntu 24.04.

When I try to connect the peripheral_hids_mouse example to a Linux machine, it immediately disconnects and becomes unusable.

Is there any sample code that has been confirmed to work with Linux machines?
Or is this a problem specific to my environment?

I am using nRF52840DK and NCS 3.0.2.

The host Linux machine is a Lenovo ThinkPad T14s. It works fine with other Logitech devices.

  • And are you are not pressing button 2 on the DK while trying to connect? Or shorting P0.12 to GND?

    BR,
    Edvin

  • Erasing the board makes no difference.
    I have also confirmed that there is no pair information using bluetoothctrl on a Linux machine.

    To check that the DK buttons are not malfunctioning, I set it to output a log when num_comp_reply() is called, but there is no sign of a malfunction.

    Setting up the sniffer takes some time, so I tested it using Bluetooth Standalone.

    Also, my setup is a standard development kit and sample code, except for the Linux host machine.
    The Linux machine (T14s gen2, Ubuntu 24.04) is also a very standard environment.
    Would it be possible for Nordic to test it?

  • Does the log from the nRF say the same when you attempted using nRF Connect for Desktop -> Bluetooth Low Energy? 

    I noticed that you are using "No keyboard, no display" in nRF Connect for Desktop -> Bluetooth Low Energy.

    Can you please try to use "Keyboarrd And Display"?

    Does that change anything?

    A sniffer trace could still be helpful.

    Best regards,

    Edvin

  • Sorry, I left it set to test mode for another device (the device I'm developing on).

    However, even when I changed it to "Keyboard And Display", the result was the same.

    Note: The target board has been changed to the nRF52833DK due to a lack of board.

    Analysis using a BLE sniffer seems a bit time-consuming. I'll check it tomorrow.

  • In that case, we can rule out that this is a linux issue, if the behavior is the same when trying to pair with the nRF Connect for Desktop -> Bluetooth Low Energy.

    Can you replicate the issue once more, and after you have done that, can you read out the flash on the nRF (the one acting as a hids_mouse)?

    To read it out, you can use one of these commands:

    nrfjprog --readcode flash_dump.hex

    nrfutil device dump-to-file flash_dump.hex

    And upload that flash_dump.hex file here? Also, let me know what device (nRF52833 or nRF52840) the flash dump is coming from.

    Best regards,

    Edvin

Related