USB ROM CDC without UART Bridge

Discussion created by lpcware Employee on Jun 15, 2016
Latest reply on Jun 15, 2016 by lpcware
Content originally posted in LPCWare by shikarm@identisoft.net on Tue Nov 12 07:59:38 MST 2013

I am using the USB ROM echo example for a CDC in Keil.
see http://www.lpcware.com/content/nxpfile/sample-code-bundle-lpc11uxx-peripherals-using-keils-mdk-arm-0

Everything  works fine. I can send and receive data on both the serial port and USB VCOM port. :D

I also managed to integrate my application to work with this example and can receive and send data using the USB API.  Basically, I modified the CDC example to push data received on USB bulk out into my application comms. buffer and then my application uses writeEP and if necessary multiple calls to the VCOM_bulk_in_hdlr interrupt to send data  > 64 bytes.

My problem comes when I try and remove the UART Bridge code. If I comment it out, the compiler complains about the UART_IRQHandler() referencing uart_read() and uart_write(). So I comment out UART_IRQHandler() and the compiler passes the compile and I program my unit.

I have a problem when the device tries to respond with more than 64 bytes of data. I send the first message from PC to device, I get a reply. However, when I attempt to send a second message from PC to device, the VCom port freezes. There is no reply from the device.
If I leave the orginal UART Bridge code in, everything works!  :p

Did anyone else try removing the UART from the example? It's clear to me that the UART routines does something that keeps the USB working continuously. Anyone have any idea how the original example can be modified to work without the UART code?