device initialization problems

Hi everyone,
I made a custom class composite device. The firmware seems to work except for one thing I can't fix.
If I initialize the USB in the following way:
If instead I initialize by doing:


the part relating to the custom class device works but other stop working.

Is there a way to make it all work at the same time?

BR
Parents
  • Hi,

    app_usbd_init() will internally call nrf_drv_usbd_init() with the library's own event handler. If you call nrf_drv_usbd_init() again outside of the library, the function will return an error code. 

    If you need to use both, you need to initialize the USBD driver outside of the app_usbd library and pass the events from the driver to the library yourself. I have not tested this, so I cannot comment on how easy it is to achieve and how well it will work. The handler you pass to the app_usbd config is for the library to send events back to the application, it is not related to the handler you pass to the driver, which pass events from the driver back to the application. app_usbd has its own internal handler where it receives events from the USBD driver.

    Best regards,
    Jørgen

  • I assumed that you was using the CDC ACM implementation through the app_usbd (USB CDC ACM module), while the custom class device was implemented through the driver directly, but I may have misunderstood you. Is the custom device also implemented through the app_usbd library?

Reply Children
Related