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

 

Parents
  • 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

    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

  • Hi Torbjorn,

    Currently we are blocked on this issue. Can you please help us to resolve this issue ASAP?

    Thanks in Advance!!

    Regards,

    Deepa

  • Hi Deepa

    I found the problem on my end. If "DTR" is not enabled, the CDC example will not consider the port opened. I must assume Tera Term is doing this automatically, but if you write your own serial code it might not be set.

    Fixing this in my C# example was very easy:

    mSerial.DtrEnable = true;
    mSerial.Open();

    I don't know how it works with QT, but I am sure there is a similar feature to set the DTR state.

    Please give this a go, and let me know if it works for you too :)

    Best regards
    Torbjørn

  • Hi Torbjorn,

    Thanks for the update. I will check this whether we can able to add this changes in QT application.

    As stated earlier, without above stated changes, the QT application works fine with STM USB CDC Device. So it will be good if we have a fix in Nordic Application end instead of C# application.

    Can you please help us to provide a fix at Nordic USB CDC application end?

    Thanks in Advance!!

    Regards,

    Deepa

  • Hi 

    I tried to make some changes to the driver to make this work. 

    I got it to respond without requiring DTR to be set, but the data coming in looks corrupted. 

    I will have to do some more testing and get back to you.

    Best regards
    Torbjørn

Reply Children
Related