简体   繁体   English

通过USB与LIVE USB启动进行串行通信

[英]Serial Communnication over USB with a LIVE USB boot

The application uses serial communication over USB and works fine when the PC boots from HDD. 该应用程序使用USB串行通信,当PC从HDD启动时工作正常。

I have created a liveUSB image (.iso) of the working OS. 我创建了一个工作操作系统的liveUSB映像(.iso)。 Booted the same PC from USB drive which contains the .iso image. 从包含.iso映像的USB驱动器启动相同的PC。

Now, the DUT is connected and the application is run, which reports that there is Garbage on the Line most of the times. 现在,DUT已连接并运行应用程序,该程序报告大多数时间都在线路上存在垃圾 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. 我无法理解Live USB的启动与HDD启动有什么不同。

FYI, PC has Fedora Core 22 with 4.0.4 Linux kernel. 仅供参考,PC有Fedora Core 22和4.0.4 Linux内核。

Serial communication : baudrate is 115200 with 1 stop bit. 串行通信 :波特率为115200,1个停止位。

Any help is much appreciated. 任何帮助深表感谢。

Thanks, 谢谢,

Shahab 流星

Edit 编辑

I have checked dmesg and found a difference, 我检查了dmesg ,发现了一个区别,

cdc_acm : failed to set dtr/rts on Live USB boot. cdc_acm : failed to set dtr/rts在Live USB启动时cdc_acm : failed to set dtr/rts It is not seen in the other case. 在另一种情况下没有看到。 Similar to this question on stackoverflow. 类似于stackoverflow上的这个问题

Another observation, the serial communication works fine when the device is connected and PC boots from the Live USB stick. 另一个观察结果是,当连接设备和PC从Live USB记忆棒启动时,串行通信正常工作。 If the USB cable to the device is unplugged and plugged in again, it reports the issue. 如果拔下插头并重新插入设备的USB电缆,则会报告问题。

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. 重新连接USB电缆后,您的串行端口号可能会增加,您将有一个死/ dev / ttyUSB0,可能还有一个新的工作/ dev / ttyUSBX。 As your application keeps the /dev/ttyUSB0 open it will not be removed until you restart your app. 当您的应用程序保持/ dev / ttyUSB0打开时,在重新启动应用程序之前不会删除它。 Keep reading the old ttyUSB0 and you will get the garbage. 继续阅读旧的ttyUSB0,你就会得到垃圾。 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. 第二个提示是,从实时启动时可能有一个只读文件系统,因此您无法在/ dev文件夹中创建任何新内容,因此新设备将不会显示。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM