cancel
Showing results for 
Search instead for 
Did you mean: 

USB CDC error recovery

gusg
Associate
Posted on June 21, 2016 at 01:09

I am trying to use USB CDC on STM32F205 from cubemx v4.15.1 with STM32F2 firmware package 1.3.1, all the latest.  Have got almost everything working with the only problem occurring if the host (either Windows or Linux) reboots while the device running the cube software is sending packets to the host.  My firmware sends a 60+ character message about 3 times per second for this test.  Eventually will need to run much faster than that.  When the problem occurs, the host can reboot and will successfully enumerate and 3 or 4 lines of data will show up and at that point nothing more happens.  Digging around with the debugger, I find that hcdc->TxState remains set to 1 in this condition.  If I close the app that has the comm port open on the host and then reboot, everything works correctly when it reboots.  Helpful suggestions I am looking for are 1: how to reliably detect the host loosing its brain, Interrupts stop as soon as the host is killed.  2:  how to get the stack, presumably the endpoint that is transferring data to go back to a state where it will work correctly.

Gus
2 REPLIES 2