您尚未登录。

楼主 # 2021-10-15 15:38:48

gogo54321
会员
注册时间: 2021-10-04
已发帖子: 13
积分: 13

linux内核启动后串口能工作,接usb键盘不能输入!特请教各位大神!

我用的licheepi 的5.2linux内核, lsusb 键盘能看到,大小写切换灯也得跟着切换,就是输入文字,按回车屏幕都没反应! 串口这边输入输出都能正常工作,  是不是要配置控制台,搞不懂,特求教大神!
如图键盘输入屏幕 不变
IMG_20211015_151935.jpgIMG_20211015_151935.jpg

离线

楼主 #1 2021-10-15 15:40:34

gogo54321
会员
注册时间: 2021-10-04
已发帖子: 13
积分: 13

Re: linux内核启动后串口能工作,接usb键盘不能输入!特请教各位大神!

IMG_20211015_151935.jpg

离线

#2 2021-10-15 16:41:10

unturned3
会员
注册时间: 2020-07-01
已发帖子: 262
积分: 300

Re: linux内核启动后串口能工作,接usb键盘不能输入!特请教各位大神!

这个屏幕显示的 tty 可能和你键盘的 tty 不一样,所以也就不显示你键盘的输入。

屏幕能显示来自串口的输入(和 ttyS0 shell prompt)吗,还是只显示内核 printk 信息?

离线

楼主 #3 2021-10-15 17:43:21

gogo54321
会员
注册时间: 2021-10-04
已发帖子: 13
积分: 13

Re: linux内核启动后串口能工作,接usb键盘不能输入!特请教各位大神!

屏幕只能显示内核打印信息!   屏幕也不显示串口信息 ,串口和屏幕是独立的,串口的输入输出都能正常操作输入命令都ok,但屏幕和usb键盘没联系上,键盘输入字符屏幕没反应!

离线

#4 2021-10-15 19:01:09

unturned3
会员
注册时间: 2020-07-01
已发帖子: 262
积分: 300

Re: linux内核启动后串口能工作,接usb键盘不能输入!特请教各位大神!

用 cat /proc/cmdline 看看 console= 这个选项是啥。

然后再在你的串口控制台里用 tty 指令查看你的当前 tty 是什么。或者打开 /etc/inittab 看看串口连接的是哪个 tty

离线

楼主 #5 2021-10-15 22:04:17

gogo54321
会员
注册时间: 2021-10-04
已发帖子: 13
积分: 13

Re: linux内核启动后串口能工作,接usb键盘不能输入!特请教各位大神!

cmdline :     console=tty0 console=ttyS0,115200 panic=5 rootwait root=/dev/mmcblk0p2 rw
串口
# tty
/dev/ttyS0

离线

楼主 #6 2021-10-15 22:06:21

gogo54321
会员
注册时间: 2021-10-04
已发帖子: 13
积分: 13

Re: linux内核启动后串口能工作,接usb键盘不能输入!特请教各位大神!

# cat /etc/inittab
# /etc/inittab
#
# Copyright (C) 2001 Erik Andersen <andersen@codepoet.org>
#
# Note: BusyBox init doesn't support runlevels.  The runlevels field is
# completely ignored by BusyBox init. If you want runlevels, use
# sysvinit.
#
# Format for each entry: <id>:<runlevels>:<action>:<process>
#
# id        == tty to run on, or empty for /dev/console
# runlevels == ignored
# action    == one of sysinit, respawn, askfirst, wait, and once
# process   == program to run

# Startup the system
::sysinit:/bin/mount -t proc proc /proc
::sysinit:/bin/mount -o remount,rw /
::sysinit:/bin/mkdir -p /dev/pts
::sysinit:/bin/mkdir -p /dev/shm
::sysinit:/bin/mount -a
::sysinit:/bin/hostname -F /etc/hostname
# now run any rc scripts
::sysinit:/etc/init.d/rcS

# Put a getty on the serial port
/dev/ttyS0::respawn:/sbin/getty -L  /dev/ttyS0 115200 vt100 # GENERIC_SERIAL

# Stuff to do for the 3-finger salute
#::ctrlaltdel:/sbin/reboot

# Stuff to do before rebooting
::shutdown:/etc/init.d/rcK
::shutdown:/sbin/swapoff -a
::shutdown:/bin/umount -a -r

离线

楼主 #7 2021-10-15 22:13:41

gogo54321
会员
注册时间: 2021-10-04
已发帖子: 13
积分: 13

Re: linux内核启动后串口能工作,接usb键盘不能输入!特请教各位大神!

这是usb 键盘 插入后信息

[  831.933590] usb 1-1: new low-speed USB device number 15 using musb-hdrc
[  832.297615] input: GASIA USB KB V11 as /devices/platform/soc/1c13000.usb/musb-hdrc.1.auto/usb1/1-1/1-1:1.0/0003:0E8F:0022.0003/input/input3
[  832.606465] hid-generic 0003:0E8F:0022.0003: input: USB HID v1.10 Keyboard [GASIA USB KB V11] on usb-musb-hdrc.1.auto-1/input0
[  832.869936] input: GASIA USB KB V11 Consumer Control as /devices/platform/soc/1c13000.usb/musb-hdrc.1.auto/usb1/1-1/1-1:1.1/0003:0E8F:0022.0004/input/input4
[  833.185734] input: GASIA USB KB V11 System Control as /devices/platform/soc/1c13000.usb/musb-hdrc.1.auto/usb1/1-1/1-1:1.1/0003:0E8F:0022.0004/input/input5
[  833.430735] hid-generic 0003:0E8F:0022.0004: input: USB HID v1.10 Device [GASIA USB KB V11] on usb-musb-hdrc.1.auto-1/input1

离线

楼主 #8 2021-10-18 22:30:58

gogo54321
会员
注册时间: 2021-10-04
已发帖子: 13
积分: 13

Re: linux内核启动后串口能工作,接usb键盘不能输入!特请教各位大神!

感谢unturned3 的提示。经过几天终于找到原因了   
:我的roorfs是复制一键烧录的,里面仅仅打开了串口ttys0
修改如下:nano /etc/inittab
添加:
/dev/tty1:12345:respawn:/sbin/getty 38400 /dev/tty1

离线

页脚

工信部备案:粤ICP备20025096号 Powered by FluxBB

感谢为中文互联网持续输出优质内容的各位老铁们。 QQ: 516333132, 微信(wechat): whycan_cn (哇酷网/挖坑网/填坑网) service@whycan.cn