I have an mbed connected to a PC and use the mbed USB link for passing back-and-forth data from my real-time apps on the PC and mbed. The application requires that this communication link be robust to various anomalous datalink occurrences. Things that can go wrong are:
1) mbed loses power, but is restarted
2) PC loses power, but is restarted
3) mbed code "hangs" or crashes, but is restarted
4) PC code hangs or crashes, but is restarted
5) USB cable gets unplugged, but is replugged
Ideally, I'd like to lose data only over the period where I get the system restarted
Occasionally, I have found that the mbed-to-PC communication just wont work. The only way to get things restarted is if I unplug and replug the USB cable and restart the mbed.
When this occurs, I can see the PC mbed device in the device manager, and I can see that the mbed application is running (by checking some once-per-sec LEDs) In the mbed code. Every printf() has a "if pc.writeable()" protection so that the main mbed loop doesn't crash if the USB link goes away. The PC real-time code also runs fine, just there is no communication.
I believe the problems are that the PC opens a serial port with the correct baud rate for the mbed. I can see that the serial link opens correctly. But the mbed running application doesn't recognize that the PC serial link has been re-opened.
Anyone else ran into this?
Jim
I have an mbed connected to a PC and use the mbed USB link for passing back-and-forth data from my real-time apps on the PC and mbed. The application requires that this communication link be robust to various anomalous datalink occurrences. Things that can go wrong are:
1) mbed loses power, but is restarted 2) PC loses power, but is restarted 3) mbed code "hangs" or crashes, but is restarted 4) PC code hangs or crashes, but is restarted 5) USB cable gets unplugged, but is replugged
Ideally, I'd like to lose data only over the period where I get the system restarted
Occasionally, I have found that the mbed-to-PC communication just wont work. The only way to get things restarted is if I unplug and replug the USB cable and restart the mbed.
When this occurs, I can see the PC mbed device in the device manager, and I can see that the mbed application is running (by checking some once-per-sec LEDs) In the mbed code. Every printf() has a "if pc.writeable()" protection so that the main mbed loop doesn't crash if the USB link goes away. The PC real-time code also runs fine, just there is no communication.
I believe the problems are that the PC opens a serial port with the correct baud rate for the mbed. I can see that the serial link opens correctly. But the mbed running application doesn't recognize that the PC serial link has been re-opened.
Anyone else ran into this?
Jim