在使用minicom时,可能会碰到串口设备被锁的情况。如下: yesaidu@ywf-ubuntu:~$ sudo minicom Device /dev/ttyS0 is locked. 可以通过下面的办法来解决: yesaidu@ywf-ubuntu:~$ ls /var/lock LCK..ttyS0 subsys yesaidu@ywf-ubuntu:~$ kill 0 yesaidu@ywf-ubuntu:~$ ls /var/lock subsys yesaidu@ywf-ubuntu:~$ sudo minicom Welcome to minicom 2.3 道理如下: 转自http://linux.about.com/od/srl_howto/a/hwtsrl18t14.htm This means that someone else (or some other process) is supposedly using the serial port. There are various ways to try to find out what process is "using" it. One way is to look at the contents of the lockfile (/var/lock/LCK...). It should be the process id. If the process id is say 100 type "ps 100" to find out what it is. Then if the process is no longer needed, it may be gracefully killed by "kill 100". If it refuses to be killed use "kill -9 100" to force it to be killed, but then the lockfile will not be removed and you'll need to delete it manually. Of course if there is no such process as 100 then you may just remove the lockfile but in most cases the lockfile should have been automatically removed if it contained a stale process id (such as 100).
"Device /dev/ttyS? is locked."
最新推荐文章于 2022-12-22 15:46:12 发布