AnsweredAssumed Answered

USB CDC Fails (after many successful transactions) [Processor Expert]

Question asked by atm on Jul 29, 2014
Latest reply on Oct 5, 2014 by Erich Styger


I am working on a project that uses the USB CDC processor expert component for a K60. One of the things I am using the CDC for is to transmit firmware data to the microcontroller that it uses to update itself (once it has been saved to some external memory). I also have a C# app transmitting this data over the Virtual Com port (that is the CDC). The data is in Intel hex format, and the (sort of naive) implementation I am using transmits the data line by line, waiting for a character ack or nack after each line.


Sad Story:

After making some significant code changes (including more computation in interrupts with higher priority than USB), the transfers started failing. They used to work earlier in the development. The entire transfer of data takes a little while, and it now fails sometime during the transfer (Somewhere between 1% and 99% of the data). Typically, when it fails, the C# app has a WriteTimeout. If I look at the USB IRQ (after entering the error state), I am still getting interrupts with the SOF flag, but I never get the TOKDNE flag set (despite the fact the C# app is trying over and over). Also, I don't see any USB error flags set if I break on entering the ISR. So I am trying to diagnose what is happening with the USB that could cause it to go into a state where it no longer responds allows USB transfers to occur.


Without a doubt, I am a USB novice, so I despite reading about it, I am not sure I have a handle on the many things that must occur for writes from the host to occur successfully. It is a possibility that the target board does something to displease the host and so what the packet captures are telling me is getting sent never really ends up on the wires. I have used a few different USB capture tools while troubleshooting the problem, and one gives a status message like:




Any insights? Any things I should try? I will appreciate any suggestions!