This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

TM4C1237H6PZ: Facing issues while using USB-CDC class for transmission of data to hyper terminal.

Part Number: TM4C1237H6PZ

Hello,

I am using TM4C1237H6PZ for sending data through USB cable(as a virtual COM port on my laptop) continuously. I kept my machine for testing overnight with data transmitting to hyper terminal. It was working fine until next day when i started disconnecting and connecting the USB cable from my laptop for the purpose of testing. As per my observation, the hyper terminal was able to receive the data after disconnecting and connecting the connection from the hyper terminal when the cable was pulled out and inserted back. But after a few trials, a situation arose when the machine was no longer transmitting data to the hyper terminal. Usually when i disconnect the connection from hyper terminal, i get the event as USBD_CDC_EVENT_SET_CONTROL_LINE_STATE. When i pull out cable i get the event as USB_EVENT_SUSPEND. When i reconnect the session i get the following events:

USBD_CDC_EVENT_GET_LINE_CODING

USBD_CDC_EVENT_GET_LINE_CODING

USBD_CDC_EVENT_GET_LINE_CODING

USBD_CDC_EVENT_GET_LINE_CODING

USBD_CDC_EVENT_SET_LINE_CODING

USBD_CDC_EVENT_GET_LINE_CODING

USBD_CDC_EVENT_SET_CONTROL_LINE_STATE

Then it connects fine.

But in that error situation, when i disconnected from hyper terminal, i got no event. And when i connected again, i got USBD_CDC_EVENT_GET_LINE_CODING event 6 times and then nothing happened and connection did not establish. I then restarted the hyper terminal application as i though hyper terminal is not communicating properly. Still the same issue. I then restarted my device and then it worked properly and connected with proper events. Please suggest some methods to debug this. Is there any buffer overflow or any thing else that may be happening?

Thanks,

Naman

  • Hello Naman,

    Are you using a custom firmware, or the usb_dev_serial example from TivaWare?

    If using your own code, what is the process you are using for when the USB connection disconnects? Any source code you can post along those lines would be helpful.

    Also as far as debug goes, typically when the issue gets to that level of detail, you need to get a USB analyzer to investigate the flow of packets back and forth.
  • Hi Ralph,

    Thanks for the reply. The issue is resolved for now. The USBbuffer got full when I pulled out the USB cable. As i debugged further, USB_EVENT_TX_COMPLETE event also stopped repeating itself when the buffer got full and i reconnected the device. So i use USBBufferFlush() when i reconnect the cable and get the event USBD_CDC_EVENT_GET_LINE_CODING.

    The code i am using has been taken from the usb_dev_serial example but has been modified a little like the UART port used is UART7 instead of UART0 and a little more changes.

    Regards,
    Naman
  • Hi Ralph,

    Can you please help me with this? Why is the USB not transmitting serial data after the cable is re-connected after the USBBuffer gets full? I am not even getting the event USB_EVENT_TX_COMPLETE after the connection is re-established.
  • Hello Naman,

    Can you post the code for your USB Control Handler?