NRF52840DK USB HID example not sending data over USB

I am working on a project that involves creating a USB HID device.  I am trying to get the default sample included with the SDK to work, but it does not affect the mouse cursor or keyboard at all.  I have not edited the sample, and am trying to use the code as is just as a test.  My computer does recognize it as a HID device in device manager though.  I have verified that my board works as best I can, by using both the blink and button samples to verify functionality, both of which work fine.

One other thing of importance that I thought I should add, I have both the JLink USB and the NRF USB plugged into my computer.

  •  Hello,

    Could you share the SDK version you are using here? Could you also direct me to the sample you are flashing onto the device (from the SDK)? How are you going about flashing this sample to the DK? Are you using VScode or west?

    Kind Regards,

    Abhijith

  • Hi Abhijith,

    I am using SDK version V2.3.0 in VScode.  I am flashing it directly from VScode.  The example I am attempting to use is zephyr/samples/subsys/usb/hid and zephry/samples/subsys/usb/hid-cdc.  All I am trying to do is get the board to type out a character when a button is pressed.

  • Hello,

    Thank you for sharing the details.

    One other thing of importance that I thought I should add, I have both the JLink USB and the NRF USB plugged into my computer.

    Sorry, I missed asking this in my first response. Why are you connecting both ports? Please try connecting the JLink USB port, and if it fails, please share the logs from the terminal.

    Kind Regards,

    Abhijith

  • Hi Abhijith,

    I am confused at your request to connect the JLink USB port.  Are you saying to not connect the NRF USB port?  From my understanding the JLink port is just for power and programming and the actual HID communications will be from the NRF USB port.  If that is wrong please correct me.

    Also, I have gotten the mouse example working, the cursor is moving, but I am still not able to get keyboard presses to work with any of the samples I have tried.

  • Hello,

    Sorry, I misinterpreted your words. I thought you were connecting both ports while flashing the program. Yes, what you said is true; you need to connect to the nRF USB port for testing the HID device applications. I am not sure about this zephyr sample, as I haven't tested it before. I will try to test it here. But can you try the⁠ nRF desktop sample from Nordic, where you have the option for both mouse and keyboard?

     

    You can find the sample under ncs\v2.3.0\nrf\applications\nrf_desktop. For building and testing the sample, you can follow⁠ this blog. You need to use the specific configuration file for the keyboard; see this section. Also see the testing section for keyboards.

     

    Kind Regards,

    Abhijith

Related