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.

TMS320F28377S: DSP 28377S USB virtual serial port problem

Part Number: TMS320F28377S
Other Parts Discussed in Thread: C2000WARE

I ported the official usb_dev_serial example to the DSP project, and also uses the official driver.

In the USB virtual serial port using DSP 28377S, the following problems are encountered:

1. Long-time running of the USB virtual serial port to transmit data (the device is a power electronic device with signal interference), and occasionally the DSP's USB virtual serial port may freeze.

Occurrence: Appears once every 10 hours

When a failure occurs: other DSP module are operating normally; preplugging  the USB connector cannot solve the problem, and the virtual serial port communication cannot be activated again; replacing other computers cannot solve the problem and cannot restore communication; USBUARTPrimeTransmit() function does not enter; f28x_USB0DeviceIntHandler() interrupt enters;

Because the USB0DeviceIntHandler() function called in the f28x_USB0DeviceIntHandler() interrupt is packaged as a library, there is no clear solution. Please also give advice from the predecessors!

2. Another problem occurred during operation:

The USB virtual serial port is communicating. If the DSP restarts, the communication software on the PC side needs to manually close the serial port--reopen the serial port, and the serial communication can be restored, but not automatically. Would you like to ask if there is a solution that can realize the automatic recovery of communication in this case?

  • Hi ,

    1. Is there any particular scenario where the virtual com port freezes or is it random after a certain period of time?

    Can you check the log file on the PC side located at %windir%\inf\setupapi.dev.log to see if any exception is recorded when the com port freezes?

    USB0DeviceIntHandler() is available in C:\ti\c2000\C2000Ware_3_04_00_00\libraries\communications\usb\f2837xs\source\device\usbdhandler.c

    2. Microsoft provides a program called devcon.exe. It's the Windows Device Console, kind of a command line version of Device Manager. You can make a call to this application periodically to check if the serial port is still open . If a disconnect is detected, then you can remove the specific device and then rescan to recover the communication.

    Best Regards

    Siddharth

  • Hi, Thanks for your replay.

    1.  It is random after a certain period of time, maybe 6 hours, or 20 hours.Following is piece of "setupapi.dev.log", I checked 3 computers that has use USB virtual serial port. No trace of VID 1CBE was found.piece of setupapi.dev.log

    Yes, I have checked the source code of USBLib you gived to me. But it seems hard to find the problem .

    Do you have any idea about how to solved this problem, such as detected this problem and then reinitialize the USB?

    2.Thanks for your answer, I understood.

  • Hi ,

    If it's random. it is going to be a difficult to figure out the cause for the failure. I was hoping that the log file could capture any exception when the  COM port freezes. Do you have a USB analyzer. if so please use ti to analyze the USB Bus and check if  there is any particular pattern when the port freezes. 

    Do you see this behavior on all PCs?

    The Power Management on the PC would also be the cause of the USB problems. Windows is set to shut down your USB controller to save power by default, sometimes it won’t be able to power it back up.  Please ensure that the PC is configure not to turn off the USB Root Hub.

    Best Regards

    Siddharth

  • Hi,

    1. I have tested USB virtual serial port on 3 PCs, and I have see this behavior on 2 laptops, haven't see this on the desktop

    2. I personally think it’s not a computer problem. Because after the USB failure, I tried to replace the computer, but still can't wake up the USB virtual serial port. And tried different USB ports of several computers.

    3. I am try to use USB Analyzer to analyze the USB Bus.

  • Hi,

    Not sure what is causing this issue, let me try to figure it out. In the meantime, can you try to get a trace using the USB analyzer to check what happens before the com port freezes.

    Best Regards

    Siddharth

  • OK, I am trying to get a trace.

    But because the freeze occurs randomly, it may take some time to capture the data.

  • Ok, as mentioned earlier , if it's randomly occurring then, it is going to be a difficult to figure out the cause. 

    Hope that the USB trace may help in narrowing done the cause.

    Best Regards

    Siddharth

  • QWE.txt
    --------------------------------------------------
    request  type="URB" num="7777" function="URB_FUNCTION_BULK_OR_INTERRUPT_TRANSFER" dir="Down" time="18:26:49.475" buf. size="4096 bytes" data dir="IN" status="PENDING"
    	UrbBulkOrInterruptTransfer
    		Hdr
    			Length	72	72	
    			Function	0x9 (URB_FUNCTION_BULK_OR_INTERRUPT_TRANSFER)	0x9 (URB_FUNCTION_BULK_OR_INTERRUPT_TRANSFER)	
    			Status	USBD_STATUS_SUCCESS	USBD_STATUS_SUCCESS	
    			UsbdDeviceHandle	0x00000000	0x860F7D28	
    			UsbdFlags	0x0	0x22	
    		PipeHandle	0x00000000879BF71C	0x00000000879BF71C	
    		TransferFlags	0x3 (IN | SHORT)	0x3 (IN | SHORT)	
    		TransferBufferLength	4096	205	
    		TransferBuffer	0x86271004	0x86271004	
    		TransferBufferMDL	0x00000000	0x8602C7B8	
    		UrbLink	0x00000000	0x00000000	
    		hca
    			Reserved8
    				[0]	0x00000000	0xFFFFFFFF	
    				[1]	0x00000000	0xDEADF00D	
    				[2]	0x00000000	0x00000000	
    				[3]	0x00000000	0x00000000	
    				[4]	0x00000000	0x00000000	
    				[5]	0x00000000	0x00000000	
    				[6]	0x00000000	0x00000000	
    				[7]	0x00000000	0x00000000	
    --------------------------------------------------
    --------------------------------------------------
    request  type="URB" num="7778" function="URB_FUNCTION_BULK_OR_INTERRUPT_TRANSFER" dir="Down" time="18:26:49.506" buf. size="8 bytes" data dir="OUT" status="PENDING"
    	UrbBulkOrInterruptTransfer
    		Hdr
    			Length	72	72	
    			Function	0x9 (URB_FUNCTION_BULK_OR_INTERRUPT_TRANSFER)	0x9 (URB_FUNCTION_BULK_OR_INTERRUPT_TRANSFER)	
    			Status	USBD_STATUS_SUCCESS	USBD_STATUS_SUCCESS	
    			UsbdDeviceHandle	0x00000000	0x860F7D28	
    			UsbdFlags	0x0	0x22	
    		PipeHandle	0x00000000879BF73C	0x00000000879BF73C	
    		TransferFlags	0x2 (OUT | SHORT)	0x2 (OUT | SHORT)	
    		TransferBufferLength	8	8	
    		TransferBuffer	0x85FBDA40	0x85FBDA40	
    		TransferBufferMDL	0x00000000	0x86070858	
    		UrbLink	0x00000000	0x00000000	
    		hca
    			Reserved8
    				[0]	0x00000000	0xFFFFFFFF	
    				[1]	0x00000000	0xDEADF00D	
    				[2]	0x00000000	0x00000000	
    				[3]	0x00000000	0x00000000	
    				[4]	0x00000000	0x00000000	
    				[5]	0x00000000	0x00000000	
    				[6]	0x00000000	0x00000000	
    				[7]	0x00000000	0x00000000	
    --------------------------------------------------
    --------------------------------------------------
    request  type="URB" num="7779" function="URB_FUNCTION_BULK_OR_INTERRUPT_TRANSFER" dir="Up" time="18:26:49.506" buf. size="8 bytes" data dir="OUT" status="SUCCESS"
    	UrbBulkOrInterruptTransfer
    		Hdr
    			Length	72	72	
    			Function	0x9 (URB_FUNCTION_BULK_OR_INTERRUPT_TRANSFER)	0x9 (URB_FUNCTION_BULK_OR_INTERRUPT_TRANSFER)	
    			Status	USBD_STATUS_SUCCESS	USBD_STATUS_SUCCESS	
    			UsbdDeviceHandle	0x00000000	0x860F7D28	
    			UsbdFlags	0x0	0x22	
    		PipeHandle	0x00000000879BF73C	0x00000000879BF73C	
    		TransferFlags	0x2 (OUT | SHORT)	0x2 (OUT | SHORT)	
    		TransferBufferLength	8	8	
    		TransferBuffer	0x85FBDA40	0x85FBDA40	
    		TransferBufferMDL	0x00000000	0x86070858	
    		UrbLink	0x00000000	0x00000000	
    		hca
    			Reserved8
    				[0]	0x00000000	0xFFFFFFFF	
    				[1]	0x00000000	0xDEADF00D	
    				[2]	0x00000000	0x00000000	
    				[3]	0x00000000	0x00000000	
    				[4]	0x00000000	0x00000000	
    				[5]	0x00000000	0x00000000	
    				[6]	0x00000000	0x00000000	
    				[7]	0x00000000	0x00000000	
    --------------------------------------------------
    --------------------------------------------------
    request  type="URB" num="7780" function="URB_FUNCTION_BULK_OR_INTERRUPT_TRANSFER" dir="Up" time="18:26:49.506" buf. size="205 bytes" data dir="IN" status="SUCCESS"
    	UrbBulkOrInterruptTransfer
    		Hdr
    			Length	72	72	
    			Function	0x9 (URB_FUNCTION_BULK_OR_INTERRUPT_TRANSFER)	0x9 (URB_FUNCTION_BULK_OR_INTERRUPT_TRANSFER)	
    			Status	USBD_STATUS_SUCCESS	USBD_STATUS_SUCCESS	
    			UsbdDeviceHandle	0x00000000	0x860F7D28	
    			UsbdFlags	0x0	0x22	
    		PipeHandle	0x00000000879BF71C	0x00000000879BF71C	
    		TransferFlags	0x3 (IN | SHORT)	0x3 (IN | SHORT)	
    		TransferBufferLength	4096	205	
    		TransferBuffer	0x86271004	0x86271004	
    		TransferBufferMDL	0x00000000	0x8602C7B8	
    		UrbLink	0x00000000	0x00000000	
    		hca
    			Reserved8
    				[0]	0x00000000	0xFFFFFFFF	
    				[1]	0x00000000	0xDEADF00D	
    				[2]	0x00000000	0x00000000	
    				[3]	0x00000000	0x00000000	
    				[4]	0x00000000	0x00000000	
    				[5]	0x00000000	0x00000000	
    				[6]	0x00000000	0x00000000	
    				[7]	0x00000000	0x00000000	
    --------------------------------------------------
    --------------------------------------------------
    request  type="URB" num="7781" function="URB_FUNCTION_BULK_OR_INTERRUPT_TRANSFER" dir="Down" time="18:26:49.506" buf. size="4096 bytes" data dir="IN" status="PENDING"
    	UrbBulkOrInterruptTransfer
    		Hdr
    			Length	72	72	
    			Function	0x9 (URB_FUNCTION_BULK_OR_INTERRUPT_TRANSFER)	0x9 (URB_FUNCTION_BULK_OR_INTERRUPT_TRANSFER)	
    			Status	USBD_STATUS_SUCCESS	USBD_STATUS_SUCCESS	
    			UsbdDeviceHandle	0x00000000	0x860F7D28	
    			UsbdFlags	0x0	0x22	
    		PipeHandle	0x00000000879BF71C	0x00000000879BF71C	
    		TransferFlags	0x3 (IN | SHORT)	0x3 (IN | SHORT)	
    		TransferBufferLength	4096	205	
    		TransferBuffer	0x86271004	0x86271004	
    		TransferBufferMDL	0x00000000	0x8602C7B8	
    		UrbLink	0x00000000	0x00000000	
    		hca
    			Reserved8
    				[0]	0x00000000	0xFFFFFFFF	
    				[1]	0x00000000	0xDEADF00D	
    				[2]	0x00000000	0x00000000	
    				[3]	0x00000000	0x00000000	
    				[4]	0x00000000	0x00000000	
    				[5]	0x00000000	0x00000000	
    				[6]	0x00000000	0x00000000	
    				[7]	0x00000000	0x00000000	
    --------------------------------------------------
    --------------------------------------------------
    request  type="URB" num="7782" function="URB_FUNCTION_BULK_OR_INTERRUPT_TRANSFER" dir="Down" time="18:26:49.678" buf. size="8 bytes" data dir="OUT" status="PENDING"
    	UrbBulkOrInterruptTransfer
    		Hdr
    			Length	72	72	
    			Function	0x9 (URB_FUNCTION_BULK_OR_INTERRUPT_TRANSFER)	0x9 (URB_FUNCTION_BULK_OR_INTERRUPT_TRANSFER)	
    			Status	USBD_STATUS_SUCCESS	USBD_STATUS_SUCCESS	
    			UsbdDeviceHandle	0x00000000	0x860F7D28	
    			UsbdFlags	0x0	0x22	
    		PipeHandle	0x00000000879BF73C	0x00000000879BF73C	
    		TransferFlags	0x2 (OUT | SHORT)	0x2 (OUT | SHORT)	
    		TransferBufferLength	8	8	
    		TransferBuffer	0x86102740	0x86102740	
    		TransferBufferMDL	0x00000000	0x85EAF878	
    		UrbLink	0x00000000	0x00000000	
    		hca
    			Reserved8
    				[0]	0x00000000	0xFFFFFFFF	
    				[1]	0x00000000	0xDEADF00D	
    				[2]	0x00000000	0x00000000	
    				[3]	0x00000000	0x00000000	
    				[4]	0x00000000	0x00000000	
    				[5]	0x00000000	0x00000000	
    				[6]	0x00000000	0x00000000	
    				[7]	0x00000000	0x00000000	
    --------------------------------------------------
    --------------------------------------------------
    request  type="URB" num="7783" function="URB_FUNCTION_BULK_OR_INTERRUPT_TRANSFER" dir="Up" time="18:26:49.678" buf. size="8 bytes" data dir="OUT" status="SUCCESS"
    	UrbBulkOrInterruptTransfer
    		Hdr
    			Length	72	72	
    			Function	0x9 (URB_FUNCTION_BULK_OR_INTERRUPT_TRANSFER)	0x9 (URB_FUNCTION_BULK_OR_INTERRUPT_TRANSFER)	
    			Status	USBD_STATUS_SUCCESS	USBD_STATUS_SUCCESS	
    			UsbdDeviceHandle	0x00000000	0x860F7D28	
    			UsbdFlags	0x0	0x22	
    		PipeHandle	0x00000000879BF73C	0x00000000879BF73C	
    		TransferFlags	0x2 (OUT | SHORT)	0x2 (OUT | SHORT)	
    		TransferBufferLength	8	8	
    		TransferBuffer	0x86102740	0x86102740	
    		TransferBufferMDL	0x00000000	0x85EAF878	
    		UrbLink	0x00000000	0x00000000	
    		hca
    			Reserved8
    				[0]	0x00000000	0xFFFFFFFF	
    				[1]	0x00000000	0xDEADF00D	
    				[2]	0x00000000	0x00000000	
    				[3]	0x00000000	0x00000000	
    				[4]	0x00000000	0x00000000	
    				[5]	0x00000000	0x00000000	
    				[6]	0x00000000	0x00000000	
    				[7]	0x00000000	0x00000000	
    --------------------------------------------------
    --------------------------------------------------
    request  type="URB" num="7784" function="URB_FUNCTION_BULK_OR_INTERRUPT_TRANSFER" dir="Up" time="18:26:49.678" buf. size="205 bytes" data dir="IN" status="SUCCESS"
    	UrbBulkOrInterruptTransfer
    		Hdr
    			Length	72	72	
    			Function	0x9 (URB_FUNCTION_BULK_OR_INTERRUPT_TRANSFER)	0x9 (URB_FUNCTION_BULK_OR_INTERRUPT_TRANSFER)	
    			Status	USBD_STATUS_SUCCESS	USBD_STATUS_SUCCESS	
    			UsbdDeviceHandle	0x00000000	0x860F7D28	
    			UsbdFlags	0x0	0x22	
    		PipeHandle	0x00000000879BF71C	0x00000000879BF71C	
    		TransferFlags	0x3 (IN | SHORT)	0x3 (IN | SHORT)	
    		TransferBufferLength	4096	205	
    		TransferBuffer	0x86271004	0x86271004	
    		TransferBufferMDL	0x00000000	0x8602C7B8	
    		UrbLink	0x00000000	0x00000000	
    		hca
    			Reserved8
    				[0]	0x00000000	0xFFFFFFFF	
    				[1]	0x00000000	0xDEADF00D	
    				[2]	0x00000000	0x00000000	
    				[3]	0x00000000	0x00000000	
    				[4]	0x00000000	0x00000000	
    				[5]	0x00000000	0x00000000	
    				[6]	0x00000000	0x00000000	
    				[7]	0x00000000	0x00000000	
    --------------------------------------------------
    --------------------------------------------------
    request  type="URB" num="7785" function="URB_FUNCTION_BULK_OR_INTERRUPT_TRANSFER" dir="Down" time="18:26:49.678" buf. size="4096 bytes" data dir="IN" status="PENDING"
    	UrbBulkOrInterruptTransfer
    		Hdr
    			Length	72	72	
    			Function	0x9 (URB_FUNCTION_BULK_OR_INTERRUPT_TRANSFER)	0x9 (URB_FUNCTION_BULK_OR_INTERRUPT_TRANSFER)	
    			Status	USBD_STATUS_SUCCESS	USBD_STATUS_STALL_PID	
    			UsbdDeviceHandle	0x00000000	0x860F7D28	
    			UsbdFlags	0x0	0x22	
    		PipeHandle	0x00000000879BF71C	0x00000000879BF71C	
    		TransferFlags	0x3 (IN | SHORT)	0x3 (IN | SHORT)	
    		TransferBufferLength	4096	0	
    		TransferBuffer	0x86271004	0x86271004	
    		TransferBufferMDL	0x00000000	0x8602C7B8	
    		UrbLink	0x00000000	0x00000000	
    		hca
    			Reserved8
    				[0]	0x00000000	0xFFFFFFFF	
    				[1]	0x00000000	0xDEADF00D	
    				[2]	0x00000000	0x00000000	
    				[3]	0x00000000	0x00000000	
    				[4]	0x00000000	0x00000000	
    				[5]	0x00000000	0x00000000	
    				[6]	0x00000000	0x00000000	
    				[7]	0x00000000	0x00000000	
    --------------------------------------------------
    --------------------------------------------------
    request  type="URB" num="7786" function="URB_FUNCTION_BULK_OR_INTERRUPT_TRANSFER" dir="Down" time="18:26:49.709" buf. size="8 bytes" data dir="OUT" status="PENDING"
    	UrbBulkOrInterruptTransfer
    		Hdr
    			Length	72	72	
    			Function	0x9 (URB_FUNCTION_BULK_OR_INTERRUPT_TRANSFER)	0x9 (URB_FUNCTION_BULK_OR_INTERRUPT_TRANSFER)	
    			Status	USBD_STATUS_SUCCESS	USBD_STATUS_SUCCESS	
    			UsbdDeviceHandle	0x00000000	0x860F7D28	
    			UsbdFlags	0x0	0x22	
    		PipeHandle	0x00000000879BF73C	0x00000000879BF73C	
    		TransferFlags	0x2 (OUT | SHORT)	0x2 (OUT | SHORT)	
    		TransferBufferLength	8	8	
    		TransferBuffer	0x85FBDA40	0x85FBDA40	
    		TransferBufferMDL	0x00000000	0x8783C938	
    		UrbLink	0x00000000	0x00000000	
    		hca
    			Reserved8
    				[0]	0x00000000	0xFFFFFFFF	
    				[1]	0x00000000	0xDEADF00D	
    				[2]	0x00000000	0x00000000	
    				[3]	0x00000000	0x00000000	
    				[4]	0x00000000	0x00000000	
    				[5]	0x00000000	0x00000000	
    				[6]	0x00000000	0x00000000	
    				[7]	0x00000000	0x00000000	
    --------------------------------------------------
    --------------------------------------------------
    request  type="URB" num="7787" function="URB_FUNCTION_BULK_OR_INTERRUPT_TRANSFER" dir="Up" time="18:26:49.709" buf. size="8 bytes" data dir="OUT" status="SUCCESS"
    	UrbBulkOrInterruptTransfer
    		Hdr
    			Length	72	72	
    			Function	0x9 (URB_FUNCTION_BULK_OR_INTERRUPT_TRANSFER)	0x9 (URB_FUNCTION_BULK_OR_INTERRUPT_TRANSFER)	
    			Status	USBD_STATUS_SUCCESS	USBD_STATUS_SUCCESS	
    			UsbdDeviceHandle	0x00000000	0x860F7D28	
    			UsbdFlags	0x0	0x22	
    		PipeHandle	0x00000000879BF73C	0x00000000879BF73C	
    		TransferFlags	0x2 (OUT | SHORT)	0x2 (OUT | SHORT)	
    		TransferBufferLength	8	8	
    		TransferBuffer	0x85FBDA40	0x85FBDA40	
    		TransferBufferMDL	0x00000000	0x8783C938	
    		UrbLink	0x00000000	0x00000000	
    		hca
    			Reserved8
    				[0]	0x00000000	0xFFFFFFFF	
    				[1]	0x00000000	0xDEADF00D	
    				[2]	0x00000000	0x00000000	
    				[3]	0x00000000	0x00000000	
    				[4]	0x00000000	0x00000000	
    				[5]	0x00000000	0x00000000	
    				[6]	0x00000000	0x00000000	
    				[7]	0x00000000	0x00000000	
    --------------------------------------------------
    --------------------------------------------------
    request  type="URB" num="7788" function="URB_FUNCTION_BULK_OR_INTERRUPT_TRANSFER" dir="Up" time="18:26:49.709" buf. size="0 bytes" data dir="IN" status="UNSUCCESSFUL"
    	UrbBulkOrInterruptTransfer
    		Hdr
    			Length	72	72	
    			Function	0x9 (URB_FUNCTION_BULK_OR_INTERRUPT_TRANSFER)	0x9 (URB_FUNCTION_BULK_OR_INTERRUPT_TRANSFER)	
    			Status	USBD_STATUS_SUCCESS	USBD_STATUS_STALL_PID	
    			UsbdDeviceHandle	0x00000000	0x860F7D28	
    			UsbdFlags	0x0	0x22	
    		PipeHandle	0x00000000879BF71C	0x00000000879BF71C	
    		TransferFlags	0x3 (IN | SHORT)	0x3 (IN | SHORT)	
    		TransferBufferLength	4096	0	
    		TransferBuffer	0x86271004	0x86271004	
    		TransferBufferMDL	0x00000000	0x8602C7B8	
    		UrbLink	0x00000000	0x00000000	
    		hca
    			Reserved8
    				[0]	0x00000000	0xFFFFFFFF	
    				[1]	0x00000000	0xDEADF00D	
    				[2]	0x00000000	0x00000000	
    				[3]	0x00000000	0x00000000	
    				[4]	0x00000000	0x00000000	
    				[5]	0x00000000	0x00000000	
    				[6]	0x00000000	0x00000000	
    				[7]	0x00000000	0x00000000	
    --------------------------------------------------
    --------------------------------------------------
    request  type="URB" num="7789" function="URB_FUNCTION_BULK_OR_INTERRUPT_TRANSFER" dir="Down" time="18:26:50.770" buf. size="8 bytes" data dir="OUT" status="PENDING"
    	UrbBulkOrInterruptTransfer
    		Hdr
    			Length	72	72	
    			Function	0x9 (URB_FUNCTION_BULK_OR_INTERRUPT_TRANSFER)	0x9 (URB_FUNCTION_BULK_OR_INTERRUPT_TRANSFER)	
    			Status	USBD_STATUS_SUCCESS	USBD_STATUS_SUCCESS	
    			UsbdDeviceHandle	0x00000000	0x860F7D28	
    			UsbdFlags	0x0	0x22	
    		PipeHandle	0x00000000879BF73C	0x00000000879BF73C	
    		TransferFlags	0x2 (OUT | SHORT)	0x2 (OUT | SHORT)	
    		TransferBufferLength	8	8	
    		TransferBuffer	0x85FBDA40	0x85FBDA40	
    		TransferBufferMDL	0x00000000	0x8602C7B8	
    		UrbLink	0x00000000	0x00000000	
    		hca
    			Reserved8
    				[0]	0x00000000	0xFFFFFFFF	
    				[1]	0x00000000	0xDEADF00D	
    				[2]	0x00000000	0x00000000	
    				[3]	0x00000000	0x00000000	
    				[4]	0x00000000	0x00000000	
    				[5]	0x00000000	0x00000000	
    				[6]	0x00000000	0x00000000	
    				[7]	0x00000000	0x00000000	
    --------------------------------------------------
    --------------------------------------------------
    request  type="URB" num="7790" function="URB_FUNCTION_BULK_OR_INTERRUPT_TRANSFER" dir="Up" time="18:26:50.770" buf. size="8 bytes" data dir="OUT" status="SUCCESS"
    	UrbBulkOrInterruptTransfer
    		Hdr
    			Length	72	72	
    			Function	0x9 (URB_FUNCTION_BULK_OR_INTERRUPT_TRANSFER)	0x9 (URB_FUNCTION_BULK_OR_INTERRUPT_TRANSFER)	
    			Status	USBD_STATUS_SUCCESS	USBD_STATUS_SUCCESS	
    			UsbdDeviceHandle	0x00000000	0x860F7D28	
    			UsbdFlags	0x0	0x22	
    		PipeHandle	0x00000000879BF73C	0x00000000879BF73C	
    		TransferFlags	0x2 (OUT | SHORT)	0x2 (OUT | SHORT)	
    		TransferBufferLength	8	8	
    		TransferBuffer	0x85FBDA40	0x85FBDA40	
    		TransferBufferMDL	0x00000000	0x8602C7B8	
    		UrbLink	0x00000000	0x00000000	
    		hca
    			Reserved8
    				[0]	0x00000000	0xFFFFFFFF	
    				[1]	0x00000000	0xDEADF00D	
    				[2]	0x00000000	0x00000000	
    				[3]	0x00000000	0x00000000	
    				[4]	0x00000000	0x00000000	
    				[5]	0x00000000	0x00000000	
    				[6]	0x00000000	0x00000000	
    				[7]	0x00000000	0x00000000	
    --------------------------------------------------
    --------------------------------------------------
    request  type="URB" num="7791" function="URB_FUNCTION_BULK_OR_INTERRUPT_TRANSFER" dir="Down" time="18:26:51.830" buf. size="8 bytes" data dir="OUT" status="PENDING"
    	UrbBulkOrInterruptTransfer
    		Hdr
    			Length	72	72	
    			Function	0x9 (URB_FUNCTION_BULK_OR_INTERRUPT_TRANSFER)	0x9 (URB_FUNCTION_BULK_OR_INTERRUPT_TRANSFER)	
    			Status	USBD_STATUS_SUCCESS	USBD_STATUS_SUCCESS	
    			UsbdDeviceHandle	0x00000000	0x860F7D28	
    			UsbdFlags	0x0	0x22	
    		PipeHandle	0x00000000879BF73C	0x00000000879BF73C	
    		TransferFlags	0x2 (OUT | SHORT)	0x2 (OUT | SHORT)	
    		TransferBufferLength	8	8	
    		TransferBuffer	0x85FBDA40	0x85FBDA40	
    		TransferBufferMDL	0x00000000	0x85EAF878	
    		UrbLink	0x00000000	0x00000000	
    		hca
    			Reserved8
    				[0]	0x00000000	0xFFFFFFFF	
    				[1]	0x00000000	0xDEADF00D	
    				[2]	0x00000000	0x00000000	
    				[3]	0x00000000	0x00000000	
    				[4]	0x00000000	0x00000000	
    				[5]	0x00000000	0x00000000	
    				[6]	0x00000000	0x00000000	
    				[7]	0x00000000	0x00000000	
    --------------------------------------------------
    --------------------------------------------------
    request  type="URB" num="7792" function="URB_FUNCTION_BULK_OR_INTERRUPT_TRANSFER" dir="Up" time="18:26:51.830" buf. size="8 bytes" data dir="OUT" status="SUCCESS"
    	UrbBulkOrInterruptTransfer
    		Hdr
    			Length	72	72	
    			Function	0x9 (URB_FUNCTION_BULK_OR_INTERRUPT_TRANSFER)	0x9 (URB_FUNCTION_BULK_OR_INTERRUPT_TRANSFER)	
    			Status	USBD_STATUS_SUCCESS	USBD_STATUS_SUCCESS	
    			UsbdDeviceHandle	0x00000000	0x860F7D28	
    			UsbdFlags	0x0	0x22	
    		PipeHandle	0x00000000879BF73C	0x00000000879BF73C	
    		TransferFlags	0x2 (OUT | SHORT)	0x2 (OUT | SHORT)	
    		TransferBufferLength	8	8	
    		TransferBuffer	0x85FBDA40	0x85FBDA40	
    		TransferBufferMDL	0x00000000	0x85EAF878	
    		UrbLink	0x00000000	0x00000000	
    		hca
    			Reserved8
    				[0]	0x00000000	0xFFFFFFFF	
    				[1]	0x00000000	0xDEADF00D	
    				[2]	0x00000000	0x00000000	
    				[3]	0x00000000	0x00000000	
    				[4]	0x00000000	0x00000000	
    				[5]	0x00000000	0x00000000	
    				[6]	0x00000000	0x00000000	
    				[7]	0x00000000	0x00000000	
    --------------------------------------------------
    --------------------------------------------------
    request  type="URB" num="7793" function="URB_FUNCTION_BULK_OR_INTERRUPT_TRANSFER" dir="Down" time="18:26:52.891" buf. size="8 bytes" data dir="OUT" status="PENDING"
    	UrbBulkOrInterruptTransfer
    		Hdr
    			Length	72	72	
    			Function	0x9 (URB_FUNCTION_BULK_OR_INTERRUPT_TRANSFER)	0x9 (URB_FUNCTION_BULK_OR_INTERRUPT_TRANSFER)	
    			Status	USBD_STATUS_SUCCESS	USBD_STATUS_SUCCESS	
    			UsbdDeviceHandle	0x00000000	0x860F7D28	
    			UsbdFlags	0x0	0x22	
    		PipeHandle	0x00000000879BF73C	0x00000000879BF73C	
    		TransferFlags	0x2 (OUT | SHORT)	0x2 (OUT | SHORT)	
    		TransferBufferLength	8	8	
    		TransferBuffer	0x85F54240	0x85F54240	
    		TransferBufferMDL	0x00000000	0x85D528E8	
    		UrbLink	0x00000000	0x00000000	
    		hca
    			Reserved8
    				[0]	0x00000000	0xFFFFFFFF	
    				[1]	0x00000000	0xDEADF00D	
    				[2]	0x00000000	0x00000000	
    				[3]	0x00000000	0x00000000	
    				[4]	0x00000000	0x00000000	
    				[5]	0x00000000	0x00000000	
    				[6]	0x00000000	0x00000000	
    				[7]	0x00000000	0x00000000	
    --------------------------------------------------
    --------------------------------------------------
    request  type="URB" num="7794" function="URB_FUNCTION_BULK_OR_INTERRUPT_TRANSFER" dir="Up" time="18:26:52.891" buf. size="8 bytes" data dir="OUT" status="SUCCESS"
    	UrbBulkOrInterruptTransfer
    		Hdr
    			Length	72	72	
    			Function	0x9 (URB_FUNCTION_BULK_OR_INTERRUPT_TRANSFER)	0x9 (URB_FUNCTION_BULK_OR_INTERRUPT_TRANSFER)	
    			Status	USBD_STATUS_SUCCESS	USBD_STATUS_SUCCESS	
    			UsbdDeviceHandle	0x00000000	0x860F7D28	
    			UsbdFlags	0x0	0x22	
    		PipeHandle	0x00000000879BF73C	0x00000000879BF73C	
    		TransferFlags	0x2 (OUT | SHORT)	0x2 (OUT | SHORT)	
    		TransferBufferLength	8	8	
    		TransferBuffer	0x85F54240	0x85F54240	
    		TransferBufferMDL	0x00000000	0x85D528E8	
    		UrbLink	0x00000000	0x00000000	
    		hca
    			Reserved8
    				[0]	0x00000000	0xFFFFFFFF	
    				[1]	0x00000000	0xDEADF00D	
    				[2]	0x00000000	0x00000000	
    				[3]	0x00000000	0x00000000	
    				[4]	0x00000000	0x00000000	
    				[5]	0x00000000	0x00000000	
    				[6]	0x00000000	0x00000000	
    				[7]	0x00000000	0x00000000	
    --------------------------------------------------
    --------------------------------------------------
    request  type="URB" num="7795" function="URB_FUNCTION_BULK_OR_INTERRUPT_TRANSFER" dir="Down" time="18:26:53.952" buf. size="8 bytes" data dir="OUT" status="PENDING"
    	UrbBulkOrInterruptTransfer
    		Hdr
    			Length	72	72	
    			Function	0x9 (URB_FUNCTION_BULK_OR_INTERRUPT_TRANSFER)	0x9 (URB_FUNCTION_BULK_OR_INTERRUPT_TRANSFER)	
    			Status	USBD_STATUS_SUCCESS	USBD_STATUS_SUCCESS	
    			UsbdDeviceHandle	0x00000000	0x860F7D28	
    			UsbdFlags	0x0	0x22	
    		PipeHandle	0x00000000879BF73C	0x00000000879BF73C	
    		TransferFlags	0x2 (OUT | SHORT)	0x2 (OUT | SHORT)	
    		TransferBufferLength	8	8	
    		TransferBuffer	0x85FBDA40	0x85FBDA40	
    		TransferBufferMDL	0x00000000	0x8804CE28	
    		UrbLink	0x00000000	0x00000000	
    		hca
    			Reserved8
    				[0]	0x00000000	0xFFFFFFFF	
    				[1]	0x00000000	0xDEADF00D	
    				[2]	0x00000000	0x00000000	
    				[3]	0x00000000	0x00000000	
    				[4]	0x00000000	0x00000000	
    				[5]	0x00000000	0x00000000	
    				[6]	0x00000000	0x00000000	
    				[7]	0x00000000	0x00000000	
    --------------------------------------------------
    --------------------------------------------------
    request  type="URB" num="7796" function="URB_FUNCTION_BULK_OR_INTERRUPT_TRANSFER" dir="Up" time="18:26:53.952" buf. size="8 bytes" data dir="OUT" status="SUCCESS"
    	UrbBulkOrInterruptTransfer
    		Hdr
    			Length	72	72	
    			Function	0x9 (URB_FUNCTION_BULK_OR_INTERRUPT_TRANSFER)	0x9 (URB_FUNCTION_BULK_OR_INTERRUPT_TRANSFER)	
    			Status	USBD_STATUS_SUCCESS	USBD_STATUS_SUCCESS	
    			UsbdDeviceHandle	0x00000000	0x860F7D28	
    			UsbdFlags	0x0	0x22	
    		PipeHandle	0x00000000879BF73C	0x00000000879BF73C	
    		TransferFlags	0x2 (OUT | SHORT)	0x2 (OUT | SHORT)	
    		TransferBufferLength	8	8	
    		TransferBuffer	0x85FBDA40	0x85FBDA40	
    		TransferBufferMDL	0x00000000	0x8804CE28	
    		UrbLink	0x00000000	0x00000000	
    		hca
    			Reserved8
    				[0]	0x00000000	0xFFFFFFFF	
    				[1]	0x00000000	0xDEADF00D	
    				[2]	0x00000000	0x00000000	
    				[3]	0x00000000	0x00000000	
    				[4]	0x00000000	0x00000000	
    				[5]	0x00000000	0x00000000	
    				[6]	0x00000000	0x00000000	
    				[7]	0x00000000	0x00000000	
    --------------------------------------------------
    --------------------------------------------------
    request  type="URB" num="7797" function="URB_FUNCTION_BULK_OR_INTERRUPT_TRANSFER" dir="Down" time="18:26:55.013" buf. size="8 bytes" data dir="OUT" status="PENDING"
    	UrbBulkOrInterruptTransfer
    		Hdr
    			Length	72	72	
    			Function	0x9 (URB_FUNCTION_BULK_OR_INTERRUPT_TRANSFER)	0x9 (URB_FUNCTION_BULK_OR_INTERRUPT_TRANSFER)	
    			Status	USBD_STATUS_SUCCESS	USBD_STATUS_SUCCESS	
    			UsbdDeviceHandle	0x00000000	0x860F7D28	
    			UsbdFlags	0x0	0x22	
    		PipeHandle	0x00000000879BF73C	0x00000000879BF73C	
    		TransferFlags	0x2 (OUT | SHORT)	0x2 (OUT | SHORT)	
    		TransferBufferLength	8	8	
    		TransferBuffer	0x881D87C0	0x881D87C0	
    		TransferBufferMDL	0x00000000	0x8656BC18	
    		UrbLink	0x00000000	0x00000000	
    		hca
    			Reserved8
    				[0]	0x00000000	0xFFFFFFFF	
    				[1]	0x00000000	0xDEADF00D	
    				[2]	0x00000000	0x00000000	
    				[3]	0x00000000	0x00000000	
    				[4]	0x00000000	0x00000000	
    				[5]	0x00000000	0x00000000	
    				[6]	0x00000000	0x00000000	
    				[7]	0x00000000	0x00000000	
    --------------------------------------------------
    

    Finally captured the data when the USB was frozen, as above!

    And I have saved one "Usb session monitor (.usblog)" file, but upload failed!

  • Thanks. Will take a look at the trace and get back to you.

    Best Regards

    Siddharth

  • I imported the USB library of the F2837xd to provide a virtual COM port for our device too. I had similary problems, but I could resolve the trouble by some small patches at the library. I used C2000Ware 3.04 too.

    1. I located a missing retrigger for the receiver which was caused by function SetDeferredOpFlag of file usbdcdc.c. This function calls a macro which doesn't work correctly. I simplify it, see the patch.
      Index: usbdcdc.c
      ===================================================================
      --- usbdcdc.c	(revision 117)
      +++ usbdcdc.c	(working copy)
      @@ -589,7 +589,7 @@
           // Set the flag bit to 1 or 0 using a bitband access.
           //
       #ifdef __TMS320C28XX__
      -    HWREGBITHW(pui16DeferredOp, ui16Bit, bSet ? 1 : 0);
      +    HWREGBITHW(pui16DeferredOp, ui16Bit, bSet );
       #else
           HWREGBITH(pui16DeferredOp, ui16Bit) = bSet ? 1 : 0;
       #endif
      
    2. Now, it's possible that under some circumstances the function HandleRxAvailable in file usbbuffer.c is called when there isn't any space left in the FIFO. It's a good idea to deactivate the issue, see the patch.
      Index: usbbuffer.c
      ===================================================================
      --- usbbuffer.c	(revision 117)
      +++ usbbuffer.c	(working copy)
      @@ -278,6 +278,8 @@
               //
               ui32Avail = USBRingBufContigFree(&psBuffer->sPrivateData.sRingBuf);
       
      +        if(ui32Avail)
      +        {
               //
               // Get as much of the packet as we can in the available space.
               //
      @@ -327,7 +329,7 @@
                       }
                   }
               }
      -
      +        }
               //
               // We need to return 0 in this case to indicate that the lower layer
               // need not perform any buffer maintenance as a result of the callback.
      
    3. When you write more than one character in the buffer with function USBRingBufWrite of file usbringbuf.c, then it's possible to write outside of the buffer memory. The write index isn't set appropriate, I resolved it with the following patch. After these modifications the device has worked without issues.
      Index: usbringbuf.c
      ===================================================================
      --- usbringbuf.c	(revision 117)
      +++ usbringbuf.c	(working copy)
      @@ -707,31 +707,9 @@
               //
               // Write the data byte.
               //
      -        psUSBRingBuf->pui8Buf[psUSBRingBuf->ui32WriteIndex] =
      -                                                         pui8Data[ui32Temp];
      -    }
      -    //
      -    // Increment the write index.
      -    //
      -    //
      -    // Update the variable value.
      -    //
      -    psUSBRingBuf->ui32WriteIndex += ui32Length;
      +    psUSBRingBuf->pui8Buf[psUSBRingBuf->ui32WriteIndex++] = pui8Data[ui32Temp];
       
      -    //
      -    // Correct for wrap.  We use a loop here since we don't want to use a
      -    // modulus operation with interrupts off but we don't want to fail in
      -    // case ui32Delta is greater than ui32Size (which is extremely unlikely
      -    // but...)
      -    //
      -	if(psUSBRingBuf->ui32WriteIndex >= psUSBRingBuf->ui32Size)
      -    {
      -        psUSBRingBuf->ui32WriteIndex -= (psUSBRingBuf->ui32Size +
      -                                         (ui32Length - 1));
      -    }
      -	
           while(psUSBRingBuf->ui32WriteIndex >= psUSBRingBuf->ui32Size)
      -    {
               psUSBRingBuf->ui32WriteIndex -= psUSBRingBuf->ui32Size;
           }
       
      


    With best regards

    M. Hundertmark

  • Hi Hundertmark,

    Thanks for providing these patches. Will ask the development team to take a look and add these patches in the USB Lib.

    Did you face any similar issue where  the virtual com port would freeze randomly after a certain period of time?

    Best Regards

    Siddharth

  • Hi Siddharth,

    In my case, only the receiver EP froze when the FIFO of the data stream was completely filled. The transmit EP was working. Another random frozen state of the whole interface did not occur.

    Best Regards

    M. Hundertmark

  • Hi Hundertmark,

    Okay, got it. 

    Best Regards

    Siddharth

  • Hi Siddharth,

    Have we solved this problem now? Is usblib updated officially or do I need to modify the code to generate it myself?

  • Hi,

    The USB Library is not yet updated, it will be done later probably in the next release of C2000Ware. In the meantime, you can use the patches and update the code in your project.

    Best Regards

    Siddharth

  • Hi Siddharth,  Hi Hundertmark,

    1.  We have update our USBlib from old version to newest version .   And we update the above code in our project. Unfortunately, the problem has not been resolved

    2.  What I need to explain again is: Our product is a high-power&high-frequency(100KHz) power supply. When the power supply has no output, the USB works without any problems, and transmits millions of frames of data without a single frame error. But when the power is turned on and output (power is 10kw), USB will report an error for several hundred frames, and it is impossible to recover from the error.

  • Hi, the problems you describe are probably not caused by software errors in the USB library. It looks like your issues are caused by EMC interference from the power converter. An analysis of the electrical reference point for the USB interface, a current compensated choke for D- and D+, analysis of the ground loops, etc. promise in my view greater success in troubleshooting.

    Best Regards

    M. Hundertmark

  • Hi,

    In this case, when the USB is Frozen, do we have a software method to recover from the Frozen state?

    How to deal with my code so that it can resume communication after freezing?

  • Hi,

    After a reset of the USB periphery the communication should be possible again. Only a reset on the hardware has no success.
             
    If VBUS is detected, the interface should be initialized, if the voltage VBus is no longer present, the interface should be closed. The VBUS input of the USB controller is not led out at this controller, a general purpose IO is necessary for this task. The library provides the commands USBDCDCInit and USBDCDCTerm for this purpose. An interrupt routine that reacts on rising and falling edges of VBUS could contain e.g. the following code:

             if(pUsbPort->VBusPwr)
             {
               //
               // Pass our device information to the USB library and place the device
               // on the bus.
               //
               USBStackModeSet(0, eUSBModeForceDevice, 0);
               USBDCDCInit(0, &pUsbPort->CDCDevice);
             }
             else
             {
               USBDCDCTerm(&pUsbPort->CDCDevice);
               SetControlLineState( pUsbPort, USB_CDC_DTE_NOT_PRESENT);
    
               pUsbPort->BusConnected = false;
             }

    The function USBDCDCInit not only initializes the USB controller, but also triggers a reset on the hardware.

    Best Regards

    M.Hundertmark

  • Hi,

    1.  "After a reset of the USB periphery the communication should be possible again. Only a reset on the hardware has no success."

         "the communication should be possible again",  do we need close Virtual serial port  and reopen it on PC? Or I don’t need any action, the communication will automatically resume?

    2.  If I add the above code in An interrupt routine that reacts on rising and falling edges of VBUS  ,  Suppose we detected a falling edge and a rising edge followed,  after we execute this code , do we need close Virtual serial port  and reopen it on PC ? Or I don’t need any action, the communication will automatically resume?

    We want communication automatically resume , and we do not want to close Virtual serial port  and reopen it .

    Thanks so much!

  • Hi,

    The whole procedure is comparable to a short disconnection of device and host (unplug and plug in again). The application on the host recognizes the absence of the device and will have to reopen the virtual interface when the device is registered again by the host operating system.

    Best Regards

    M. Hundertmark

  • Thank you so much!