nordic peripheral_hids_mouse example: cursor doesn't work on iPad

Using ncs 2.4.2 on nrf52840DK v3.0.1.  iPad iOS is 15.3.1

Example works on PC and Android.

I can connect to the iPad, but no cursor appears, and the DK buttons don't do anything.

Using a BLE sniffer, I can see the HID reports being transmitted. The iPad knows that an HID device is connected, since the AssistiveTouch icon shows up on connection. A wireshark capture file of the connection and some test button pushes is attached.

My conclusion is that the HID mouse report is not cooperating with apple's HID parser.

Could anyone confirm the same behaviour?

Are there any suggested fixes?

I have tried with the regular peripheral_hids_mouse example, but the capture is based on this modificationnrf sample peripheral_hids_mouse does not connect to desktop with BT_HIDS_SECURITY_ENABLED=n, disconnected reason 19 

8875.iPad_dud_hid_report.pcapng

  • Additionally, if someone could outline the situations when "nrfjprog --recover" is required during development, that would be great. It helped the person in the linked thread and I think it helped me, but I'm not sure why.

  • Hi mrd,

    mrd said:
    Additionally, if someone could outline the situations when "nrfjprog --recover" is required during development, that would be great. It helped the person in the linked thread and I think it helped me, but I'm not sure why.

    This question is not on the same topic as the opening post. I can quickly answer you that it is related to the Access Port Protection feature of the SoC. --recover writes into the UICR to disable the feature, allowing debugging. When you perform actions that erase the UICR, the feature is turned back on by default.
    If you have any further questions about it, please follow-up on a new post.


    My conclusion is that the HID mouse report is not cooperating with apple's HID parser.

    I don't currently have an iOS device to check this yet. I will try to get to it soon and update you.

    Hieu

  • Hi mrd,

    mrd said:
    Additionally, if someone could outline the situations when "nrfjprog --recover" is required during development, that would be great. It helped the person in the linked thread and I think it helped me, but I'm not sure why.

    This question is not on the same topic as the opening post. I can quickly answer you that it is related to the Access Port Protection feature of the SoC. --recover writes into the UICR to disable the feature, allowing debugging. When you perform actions that erase the UICR, the feature is turned back on by default.
    If you have any further questions about it, please follow-up on a new post.


    My conclusion is that the HID mouse report is not cooperating with apple's HID parser.

    I don't currently have an iOS device to check this yet. I will try to get to it soon and update you.

    Hieu

  • Hi mrd,

    I just want to let you know that I reproduced your issue with the peripheral_hids_mouse.

    My conclusion is that the HID mouse report is not cooperating with apple's HID parser.

    This doesn't seem to be the case. I tested and the exact same HID mouse report on the nRF5 SDK works fine.

    It really is very curious. I also tested the same sample on NCS v2.5.0, and the nRF Desktop application on NCS v2.5.0. The sample continues to fail, but the nRF Desktop app demonstrates mouse functionality just fine.

    From those results, I can at least see that it must be something wrong with the peripheral_hids_mouse sample. However, I haven't been able to figure out what yet.

    Could you please give an overview of your goal? Could the nRF Desktop sample application fit your needs?
    It is a many-in-1 project that support a lot of build configurations for mouse, keyboard, and dongle devices.

    Another idea is to compare the service tables of this sample and the one in the example in the nRF5 SDK, since they are supposed to provide the same functionality. 
    I couldn't schedule further debugging for this case this week though. Do you mind taking a look while you wait?
    Sorry for this inconvenience. We are a little short staffed at the moment.

    Here is the hex file of the nRF5 SDK example that I confirmed working with an iPhone.

    ble_app_hids_mouse_pca10056_s140_debug.hex

    Hieu

  • Hi Hieu,

    Thank you for the update. I feel reassured - I've been trying to figure out what I've been missing with peripheral_hids_mouse for a long time!

    I have already done a fair bit of development on my own application, and it would be a shame to transition, but I will if it's required.

    Our goal is to make a composite mouse and keyboard BLE HID device with NUS service (or some other serial BT service) for configuration. It reads data from an i2c-based sensor. It would have external EEPROM for saving bluetooth connection info between power cycles. It would also be able to send serial data + HID over USB when connected.

    I saw the desktop sample, but found it to be overwhelming. In particular, I found it very challenging to navigate.

    For example, my first instinct is to look for the HID report so that I can modify it to send keyboard and mouse data. I find hid_report_desc.c, and it looks like it can support mouse and keyboard if I enable CONFIG_DESKTOP_HID_REPORT_MOUSE_SUPPORT and CONFIG_DESKTOP_HID_REPORT_KEYBOARD_SUPPORT. Perfect. But if I search for these definitions in the project, they don't exist anywhere! So I look in prj.conf for a likely candidate anyways, and there's CONFIG_DESKTOP_PERIPHERAL_TYPE_MOUSE. But when I search this in the project, it also is not linked to anything!

    Clearly my method of navigating this project is bad. A description of your workflow would be very helpful for my navigation of nrf desktop. How would you find the linkage between those defines?

    Thank you

Related