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

USB Examples on nRF52 Dongle

Hello! I'm following the nRF52 Dongle programming guide to adapt the USB examples from SDK 15.3.0 to the nRF52840 Dongle. USB CDC ACM works fine, and I managed to get half of the MSC example to work. But the HID examples don't seem to work. The application is built correctly and I can write the HEX file to the dongle, but the board doesn't seem to work at all (e.g. toggling a led in the main function doesn't do anything, device not recognized in computer as usb). Is there any explanation for this behavior?

Thanks in advance!

Parents Reply Children
  • I am sorry for the long delay. A huge portion of the support team are on vacation, which causes delayed responses.

    The reason the usbd_hid_generic example doesnt work on the dongle is because the error check inside INIT_BSP_ASSIGN_RELEASE_ACTION triggers. 

    Inside bsp_event_to_button_action_assign() there is the following check:

    if (button < BUTTONS_NUMBER){
            .
            .
            .
        } else
        {
            err_code = NRF_ERROR_INVALID_PARAM;
        }

    When you are providing it with BTN_MOUSE_LEFT (=2), which is bigger than BUTTONS_NUMBER (=1), the function will return an error and the program will stop running.

    Best regards,

    Simon

Related