This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

Problems with OUT reports on USB HID

Hi,

I'm using the NRF52840 PDK version:

PCA10056

0.11.0

2018.3

With SDK version 15.2

I've been trying to develop an application based on the HID Generic example and am seeing some strange behaviours on the USB HID OUT endpoint.

I try to obtain the data in the APP_USBD_HID_USER_EVT_OUT_REPORT_READY event, at which point I use app_usbd_hid_generic_out_report_get to retrieve the data for processing in my main loop.

After more tracing and debugging, I've found that the hid_generic_ep_transfer_out handler is called when the OUT endpoint is busy.  When this happens the app_usbd_ep_transfer fails and app_usbd proceeds to stall the endpoint (in app_usbd_event_execute).

How can I avoid this situation?

Thanks,

Larry

  • Hi Larry,

    Do you have the possibility to order yourself a new nRF52840-DK, the preview kit you have contains engineering samples that have not gone through production test, and may thereby contain issues. What SDK example are you using for this test?

    Best regards,
    Kenneth

  • I'm using some code that I modified based on a sample.
    I can try to get a sample working as out of the box provided I can get the same test data to send to it.

    I can order another PDK.  I originally had 4 with engineering Rev A chips on it.  Then I ordered another because of USB issues and that one I believe is Rev B.  Are you saying that there are PDKs available which production chips on them?

    I also have some dongles (a few Nordic nRF52840 Dongles and some from MakerDiary nrf52840-mdk-usb-dongle).
    I'm hoping to get the application running on those so I can see if the problem still exists because I believe that they are using production chips.

    Larry

    I have some more information.  The issue only seems to occur when rapid HID frames are sent in succession.
    The test tool I'm using is from the FIDO Alliance.   One of the tests requires the device to pass a long echo, which can span multiple frames (a frame is 64 bytes - header information).
    So when I reduce my tests so that the message is always 64 bytes or less and I don't see any problems.

    Also, the SDK example I started from is the usbd_hid_generic example.
    The issue is with using that example is that it only has one IN endpoint.  I had to add another OUT endpoint for my application.  It will take a bit of effort to try to get it working.

    Both endpoints are of size 64 bytes.


    Larry

  • Hi Larry,

    The PDK go are no longer in production no, they are all DK v1.0.0 now. The build code should be QIAAC0 (or newer if someone read this in the future).

    Best regards,
    Kenneth

  • OK.  The USB dongles I have are QIAAC0.  Still trying to get them to work...

    I have added a small (5 ms) delay between HID frames on the FIDO test harness.
    This seems to make the problem go away (at least it is orders of magnitude better).
    Unfortunately, this is not a real solution as we don't control the host software in the real world.

    Larry

  • Are you able to provide a simple example that we may use to recreate it here?

    Please provide where I should put the project in the sdkv15.2 and also which project path I should open.

    Thanks,
    Kenneth

Related