I have a big problem on our board based on EMX. In some cases we lost the CDC connection. It appears when the relays (driven by a ULN2004AD that include a clamp diode) are switching. This disconnection occurs after a while. At the beginning I belived it was due to the fact that we were using the cdc+debug option but now we have move to the CDC normal driver (usbser.sys). We believed it was a problem on the 5V that was shared between VBUS and the 5V of our board. We cut this line without any effect (the only one is that we can not power supply the board by USB now, anyway the board has its own buck switching power supply).
When the connection disappear, the device is still listed in the device manager of windows but we can no longer talked to the device. When we unplugged/plugged the device again, windows says the de usb device is not recognized. The only thing that we can do is to switch off the device.
I have tried to observed the usb stream on DP and DM but didn’t notice any problem on voltage. I should also mention that this work well when there’s nothing connected to the relays but as soon as solenoid coils are connected to the relay the problem appears (sometime after 5 min of switching but it appears).
Many thanks for your answers. The relays are driven solenoid coils such as the festo MSFG-12-OD.
I have made a test during the last night, two boards (one with linear voltage regulator and one with a switching voltage regulator) were communicating with 2PC (one laptot under Windows XP.SP3 one desktop running vista, both with usbser.sys). When I arrived in the office this morning both cards were still alive but the applications that were running on computer were not responding… Communications stopped after 3 and 4 hours respectively. During the test, relays were not switching at all.
I can make slight modifications on the design to enhance EMI, but I don’t know where to start. I know that there’s tons of guidelines that has not been respected due to lack of time, money and so on… (USB guidelines advice 4 layers PCB…).
I really need to find a way to restart connection by software (may be on the computer and at the same time on the EMX side).
IMaybe you could insert something like a ping to make cdc alive when you dont send any data. If so, when you dont get the response restart cdc… Dont know if restarting cdsc is enough to make it work again…
There’s always communications on CDC on my system until it stops without knowing why.
The board is supposed to send a data summary on CDC after each iteration of the main loop (every 250ms), this can works well during 3 hours without any problem but at one time this stops. USB analyser shows no transaction on the usb port. If I unconnect and reconnect the usb cable, the device become unrecognized by windows. The only solution is to switch off/on the device.
Tomorrow morning I will go in an electronic lab to check with a good oscilloscope. I believe that it is due to EMI and a poor windows driver (that does not have a recovery mechanism) since when a load is connected to my board (solenoid coil connected to relays through a uln2004ad) the problem occurs earlier.
This is snapshot of the oscilloscope on USB DP and DM. The second picture shows the invert signal. This sounds good to me and the usb link can be good for several hours but sometime it crashes without knowing why (sometime 10mn after … sometimes less or more). This is really weird.
I have made an other test , the board has been running all the last night. Obviously, when I enter in the office, the application on the PC was showing nothing good, while USB traces were showing activities. I have closed the application on the computer, unplugged the usb on PC, re-plugged it, and restarted the application and all was ok.
During this morning the connection stops an other time, but the same manipulation did not give the same result. I have been obliged to restart the netmf device…