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

nRF52840 USB COM

Hi,

I have developed part of my code using UART, starting from the UART example in \examples\peripheral\uart , but before continuing I need to start doing things over USB. I have followed the instructions on the USBD_CDC_ACM example, found here ( USB CDC ACM documentation ). I am connecting to the COM port with Termite, and I am receiving this: [1B][1;32muart_cli:~$ [1B][1;37m[1B][12D[1B][J<info> app: USBD CDC ACM example started.

The last part of the string is expected, but the first part is gibberish and I don't know where it comes from. Also, the LEDs and buttons don't seem to work at all. Then, the application behaves as an echo when I type things into the terminal, but since it is event-based the debugger doesn't help me find what functions are used for receiving and sending the strings through the virtual COM connection. What I want, basically, is to include in my code the most basic amount of code that will replicate via USB and its virtual COM port what is done in the UART example with the lines below:

while (app_uart_get(&cr) != NRF_SUCCESS);
while (app_uart_put(cr) != NRF_SUCCESS);

Is there any direct way of replicating this behavior? My code is for a simple test purpose, so it doesn't really need all the events structures if it is not completely necessary. I could just do everything I need with the structure in the UART example, plus adding some simple functions of my own, but I have to switch to USB virtual COM because in a hardware revision the access to the UART signals has been removed. 

Thank you very much in advance for your help.

Best regards,

Alin O. Dragomir

Related