简体   繁体   English

将模块添加到Angstrom内核

[英]Add module to angstrom kernel

I'm working on the Altera cyclone V Soc FPGA Dev Kit. 我正在研究Altera气旋V Soc FPGA开发套件。 I'm using the GSRD 14.1 Angstrom provides by rocketboards.com ( http://www.rocketboards.org/foswiki/Documentation/GSRD141AngstromGettingStarted ) 我正在使用rocketboards.com( http://www.rocketboards.org/foswiki/Documentation/GSRD141AngstromGettingStarted )提供的GSRD 14.1埃

root@socfpga_cyclone5:~# uname -a
Linux socfpga_cyclone5 3.10.31-ltsi

This kernel don't support usb serial device and I think that I need to add usbserial and maybe usbcore drivers to communicate with a GPS serial module. 该内核不支持USB串行设备,我想我需要添加usbserial或usbcore驱动程序才能与GPS串行模块通信。 The kernel includes insmod and modprobe but I can't find specifics driver for my board. 内核包含insmod和modprobe,但是我找不到用于我的主板的特定驱动程序。

dmesg returns: dmesg返回:

usb 1-1: new full-speed USB device number 2 using dwc2
usb 1-1: New USB device found, idVendor=10c4, idProduct=ea60
usb 1-1: New USB device strings: Mfr=1, Product=2, SerialNumber=3
usb 1-1: Product: CP2104 USB to UART Bridge Controller
usb 1-1: Manufacturer: Silicon Labs
usb 1-1: SerialNumber: 006FA62E

Is there a solution to add this module ? 是否有添加此模块的解决方案? If I have to rebuild and customize the kernel, I'm looking for some advise :) 如果我必须重建和自定义内核,我正在寻找一些建议:)

Thanks in advance. 提前致谢。

EDIT 编辑

The solution was add the serial driver support in menuconfig and update the kernel. 解决方案是在menuconfig中添加串行驱动程序支持并更新内核。

First, plug your serial device into the USB port and check the output of this command : 首先,将您的串行设备插入USB端口并检查以下命令的输出:

ls /dev |grep usb ls / dev | grep usb

If you see something like "ttyUSB0" or "ttyAMC0", then the driver is already there, either as a statically compile driver or loaded module. 如果看到类似“ ttyUSB0”或“ ttyAMC0”的内容,则该驱动程序已经存在,可以是静态编译驱动程序,也可以是已加载的模块。 I would be really surprised if your issue really is that the driver isn't present; 如果您的问题确实是驱动程序不存在,我会感到非常惊讶。 it should be included in just about every distribution. 它应该包含在几乎每个发行版中。

If nothing comes up, then check to see if the driver is currently loaded (this will tell you if it's actually a problem with your USB-serial device: 如果没有任何反应,请检查驱动程序当前是否已加载(这将告诉您USB串行设备是否确实存在问题:

lsmod | lsmod | grep serial grep序列

(Note: the module should be called "usb_serial", but I usually grep for a subset of the string I'm actually looking for to catch names that don't quite match what I expect, such as names with or without underscores in them. "grep serial" can match more than "usb_serial", but should include it while still shortening the modprobe output.") (注意:该模块应称为“ usb_serial”,但通常我会在grep中查找实际上要查找的字符串子集,以捕获与我期望的名称不完全匹配的名称,例如其中带有或不带有下划线的名称。“ grep serial”可以比“ usb_serial”匹配更多,但应包括它,同时仍会缩短modprobe输出。“)

If you see the driver there, then driver is loaded and the problem is with your USB-serial device. 如果在那里看到驱动程序,则驱动程序已加载,问题出在您的USB串行设备上。 Check this text document to see if your device is supported by the driver. 检查此文本文档以查看驱动程序是否支持您的设备。 It is possible that your device will still work even if it's not listed as supported, because there is support for a generic device in the usb serial module. 即使您的设备未列出为受支持的设备,也可能仍然可以工作,因为USB串行模块中支持通用设备。 You'll have to reload the module with this command to take advantage of it: 您必须使用以下命令重新加载模块才能利用它:

insmod usbserial vendor=0x#### product=0x#### insmod usbserial供应商= 0x ####产品= 0x ####

If the driver isn't loaded, use this command to see if it's available: 如果未加载驱动程序,请使用以下命令查看它是否可用:

modprobe | modprobe | grep serial grep序列

If the driver is there but not currently loaded, you should be able to find it in this directory to use "insmod" on it: 如果驱动程序在那里但尚未加载,则应该可以在此目录中找到它以在其上使用“ insmod”:

/lib/modules/`uname -r`/kernel/drivers/usb/serial/` / lib / modules /`uname -r` / kernel / drivers / usb / serial /

If all of that fails, you may have to recompile with the drivers enabled. 如果所有操作均失败,则可能必须在启用驱动程序的情况下重新编译。 Recompile your kernel and make sure you enable USB_SERIAL under the USB menu, and also enable kernel support for TTY, because USB_SERIAL depends on it . 重新编译内核,并确保您在USB菜单下启用了USB_SERIAL,并且还启用了对TTY的内核支持,因为USB_SERIAL 依赖于它

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

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