Serial Communnication over USB with a LIVE USB boot

987 views Asked by At

The application uses serial communication over USB and works fine when the PC boots from HDD.

I have created a liveUSB image (.iso) of the working OS. Booted the same PC from USB drive which contains the .iso image.

Now, the DUT is connected and the application is run, which reports that there is Garbage on the Line most of the times. However, it does work on some attempts, it is very inconsistent.

I couldn't understand how does a boot from a Live USB is different from a HDD boot.

FYI, PC has Fedora Core 22 with 4.0.4 Linux kernel.

Serial communication: baudrate is 115200 with 1 stop bit.

Any help is much appreciated.

Thanks,

Shahab

Edit

I have checked dmesg and found a difference,

cdc_acm : failed to set dtr/rts on Live USB boot. It is not seen in the other case. Similar to this question on stackoverflow.

Another observation, the serial communication works fine when the device is connected and PC boots from the Live USB stick. If the USB cable to the device is unplugged and plugged in again, it reports the issue.

1

There are 1 answers

2
dungo On

After reconnecting the USB cable your serial ports number will probably be incremented and you will have a dead /dev/ttyUSB0 and probably a new working /dev/ttyUSBX. As your application keeps the /dev/ttyUSB0 open it will not be removed until you restart your app. Keep reading the old ttyUSB0 and you will get the garbage. A second hint would be, that you probably have a read-only filesystem when booting from live so you are not able to create anything new in the /dev folder so the new device will not show up.