Beware that this post is related to an SDK in maintenance mode
More Info: Consider nRF Connect SDK for new designs

Add CDC class to the USB Device Example

I am developing a USB keyboard + mouse using a NRF52833. I have use the USB Device Example from nRF5 SDK v17.1.0. I chose this example because my project is in C++ and had problems compiling the USB HID Composite Example regarding to "designator order for field 'app_usbd_hid_inst_t::p_hid_methods' does not match declaration order in 'app_usbd_hid_inst_t'".

I have implemented the keyboard + mouse HID to my project since the original example only works as a mouse. Now I need to add the CDC class to have a serial com port, any suggestions or examples on how to do it?

Parents Reply Children
  • Hi,

     

    driverGuy said:
    Update. I have been able to compile the USB HID Composite Example in C++ and the computer correctly recognizes it as keyboard + mouse. Now I need to add CDC class to have serial port as well.

    That is good news.

     

    Unfortunately, we do not have any example that combines CDC_ACM directly with other usb classes, but the project that you are currently working with has two HID classes in one project.

    You'll have to perform similar steps as done in this sample to add the usbd_cdc_acm into your project.

     

    Kind regards,

    Håkon

Related