linux-usb软件系统架构

来源:互联网 发布:mac网络恢复 最新 编辑:程序博客网 时间:2024/06/05 02:25
1.软件系统架构

USB主控制器,芯片里面自带了得。为了让USB主控制器运行,所有有USB主控制器驱动。
USB核心,内核提供好的USB协议之类的。USB设备驱动是针对插到接口的设备去工作的软件。
主机插得是HOST接口


开发板插的是SLAVE接口
Gadget驱动:让USB设备工作成特殊的状态(网卡,串口等)

2.USB-MassStorage驱动体验
在tq2440-kernel中选择Device Drivers -> USB support ->support for host…->OSCI HCD support(usb1.0的协议)
加载上U盘的驱动->USB Mass Storage support(USB设备驱动)

因为U盘比较特殊,我们还需要配置一些其他信息:General setup --->[*] Configure standard kernel features (for small systems) --->[*] Support for hot-pluggable devices (NEW)
hot-pluggable热插拔

U盘属于块设备、磁盘设备,选择支持块设备选项:
Device Drivers --->Block devices ---><*> Low Performance USB Block driver
同时选择SCCI选项:Device Drivers --->SCSI device support ---><*> SCSI device support<*> SCSI disk support<*> SCSI generic support

U盘必须还要有文件系统的支持:
File systems --->DOS/FAT/NT Filesystems --->
   <*> MSDOS fs support 
   <*> VFAT (Windows-95) fs support 
   
(936) Default codepage for FAT 
   
(cp936) Default iocharset for FAT
Partition Types --->
  [*] PC BIOS (MSDOS partition tables) support
Native Language Support --->
 <*> Simplified Chinese charset (CP936, GB2312)
 <*> NLS UTF8
重新编译后,可以把U盘插到开发板中去。
  1. mount /dev/uba /mnt/
出错了,暂时找不到原因。估计和yaffs文件系统有关系:

点击(此处)折叠或打开

  1. yaffs: dev is 188743680 name is "uba"
  2. yaffs: passed flags ""
  3. yaffs: Attempting MTD mount on 180.0, "uba"
  4. yaffs: dev is 188743680 name is "uba"
  5. yaffs: passed flags ""
  6. yaffs: Attempting MTD mount on 180.0, "uba"
  7. mount: mounting /dev/uba on /mnt failed: Invalid argument

3.RNDIS驱动体验
把USB口模拟成网口
Device Drivers ->USB support ->USB gadget support(设备控制器驱动)
USB Gadget Drivers
Ethernet Gadget (with CDC Ethernet support)
这只好后需要重新编译内核的模块
  1. make ARCH=arm CROSS_COMPILE=arm-linux-
  2. make uImage ARCH=arm CROSS_COMPILE=arm-linux-
在开发板中设置usb的网络IP
  1. ifconfig usb0 192.168.1.30
在虚拟机中能PING通。






<script>window._bd_share_config={"common":{"bdSnsKey":{},"bdText":"","bdMini":"2","bdMiniList":false,"bdPic":"","bdStyle":"0","bdSize":"16"},"share":{}};with(document)0[(getElementsByTagName('head')[0]||body).appendChild(createElement('script')).src='http://bdimg.share.baidu.com/static/api/js/share.js?v=89860593.js?cdnversion='+~(-new Date()/36e5)];</script>
阅读(40) | 评论(0) | 转发(0) |
0

上一篇:USB协议分析

下一篇:USB驱动程序设计

相关热门文章
  • SHTML是什么_SSI有什么用...
  • 查看linux中某个端口(port)...
  • 卡尔曼滤波的原理说明...
  • shell中字符串操作
  • 关于java中的“错误:找不到或...
给主人留下些什么吧!~~
原创粉丝点击