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

USB CDC ACM Example is not working in interrupt mode

Hi,

On Nordic SDk 15.0, I have observed that USB CDC ACM Example is not working in interrupt mode on nrf52840 Evaluation kit.

But I have tested USB CDC ACM Example in interrupt mode on Nordic SDK 14.2 and its works fine.

To enable interrupt mode, I have modified the USB CDC ACM example of Nordic SDK 14.2 as stated in this link - 

https://devzone.nordicsemi.com/f/nordic-q-a/29641/pca10056-usb-cdc-demo-no-polling

Can you please help us to resolve the issue on Nordic SDK 15.0?

Thanks in Advance

Regards,

Deepa

 

  • Hi Deepa

    All you should have to do to make event handling interrupt driven in SDK v15 is to set APP_USBD_CONFIG_EVENT_QUEUE_ENABLE to 0 in sdk_config.h, and comment out the call to app_usbd_event_queue_process() in main.c

    Please try it out, and let me know if you have any issues with it. 

    Best regards
    Torbjørn

  • Hi Torbjorn,

    With these suggested changes, USB CDC ACM Example is not working in interrupt mode.
    Thank you for timely help.

    I have one more issue with USB CDC read functionality.
    I was unable to get APP_USBD_CDC_ACM_USER_EVT_RX_DONE / PP_USBD_CDC_ACM_USER_EVT_PORT_OPEN events when I send commands to USB port using QT Application.


    But after running the application, If I do a dummy open and close of Teraterm connecting to USB port(Say "com14") then I was able to get APP_USBD_CDC_ACM_USER_EVT_RX_DONE / APP_USBD_CDC_ACM_USER_EVT_PORT_OPEN events when I send commands to USB port using QT Application.

    Why there is a dependency on dummy open and close of Teraterm connecting to USB port(Say "com14")?
    Can I avoid this dependency?

    Thanks in Advance

    Regards,
    Deepa

  • Hi

    Deepa Gopinath said:
    With these suggested changes, USB CDC ACM Example is not working in interrupt mode.

    I assume you meant to say it is "now working"? ;)

    Regarding the issues you see, do you have some other CDC device to test with?
    An FTDI based one for instance. 

    It is likely that your issue is with the QT application, since the Teraterm connection works fine. 

    Have you made many changes to the nRF52840 application, or is it similar to the SDK example?

    Best regards
    Torbjørn

  • Hi Torbjørn,

    I have two issues with USB CDC of nRF52840-
    1. USB read event failure issue in interrupt mode when dummy open and close of Teraterm connecting to USB port is done
    2. USB read event fails when dummy open and close of Teraterm connecting to USB port is not done

    With your suggested changes, issue-1 is resolved. Now I need your help for issue 2.

    Case 1: when dummy open and close of Teraterm connecting to USB port is not done
    => When I run the QT application, unable to receive USB port event interrupt and USB read event interrupt

    Case 2: when dummy open and close of Teraterm connecting to USB port is done
    => When I run the QT application, able to receive USB port event interrupt and USB read event interrupt

    The QT application works fine when I test with STM USB CDC device.
    In case of STM USB CDC device, USB read event works fine when dummy open and close of Teraterm connecting to USB port is not done
    As the QT application is working fine with STM USB CDC device, I think the issue is not in QT application.

    PFA : nrf52840 USB CDC example which I have used to reproduce the issue 2 with QT Application
    Only minor changes has done in nrf52840 USB CDC example

    I feel some intialization is missed for USB CDC example which was able to do when dummy open and close of Teraterm connecting to USB port is done

    Thanks & Regards,1401.main.zip
    Deepa

  • Hi Deepa

    I set up a small C# application to see if I could spot the issue, and indeed I do see something similar. If I try to send something from the C# application it is not received on the nRF52840 until I close the port in my application and open it in Tera Term. 

    I will have to do some more digging to figure out what is happening. 

    Best regards
    Torbjørn

Related