主题 : usb  mass storage device 问题 复制链接 | 浏览器收藏 | 打印
级别: 新手上路
UID: 4010
精华: 1
发帖: 19
金钱: 210 两
威望: 210 点
贡献值: 10 点
综合积分: 58 分
注册时间: 2009-02-20
最后登录: 2010-10-27
楼主  发表于: 2009-02-25 21:50

 usb  mass storage device 问题

管理提醒: 本帖被 qq2440 执行取消置顶操作(2009-08-07)
我用nand flash的某个分区做为MSD让PC机识别和使用(通过FAT16/32).
分区为 : /dev/mtdblock/3

运行步骤:
[root@FriendlyARM plg]# insmod s3c2410_udc.ko
s3c2410_udc: version 28 Aug 2005
0.00 USB: s3c2410_udc_probe
0.01 USB: udc_disable called

[root@FriendlyARM plg]# insmod g_file_storage.ko file=/dev/mtdblock/3
0.02 USB: usb_gadget_register_driver() 'g_file_storage'
0.03 USB: binding gadget driver 'g_file_storage'
0.04 USB: s3c2410_set_selfpowered()
g_file_storage gadget: File-backed Storage Gadget, version: 20 October 2004
g_file_storage gadget: Number of LUNs=1
g_file_storage gadget-lun0: ro=1, file: /dev/mtdblock/3
0.05 USB: udc_enable called

将开发板与pc机相连后,pc能发现 mass storage device,但是在“我的电脑”里看不到盘符,不知道是什么原因,希望能得到你的帮助,谢谢!
级别: 新手上路
UID: 4010
精华: 1
发帖: 19
金钱: 210 两
威望: 210 点
贡献值: 10 点
综合积分: 58 分
注册时间: 2009-02-20
最后登录: 2010-10-27
1楼  发表于: 2009-02-26 20:11
问题解决,insmod g_file_storage.ko file=/dev/mtdblock/3 少了参数,insmod g_file_storage.ko file=/dev/mtdblock/3 stall=0 removable=1 就可以看到盘符了。
*無鈳取玳
级别: 论坛版主
UID: 27
精华: 12
发帖: 5398
金钱: 40120 两
威望: 17929 点
贡献值: 71 点
综合积分: 11036 分
注册时间: 2008-01-16
最后登录: 2014-11-22
2楼  发表于: 2009-02-27 12:45
加上removable=1是告诉Windows把这个设备看作可移除设备, 这只是Windows的白痴逻辑.
"If you have an apple and I have an apple and we exchange apples, then you and I will
still each have one apple. But if you have an idea and I have an idea and we exchange
these ideas, then each of us will have two ideas."
*無鈳取玳
级别: 论坛版主
UID: 27
精华: 12
发帖: 5398
金钱: 40120 两
威望: 17929 点
贡献值: 71 点
综合积分: 11036 分
注册时间: 2008-01-16
最后登录: 2014-11-22
3楼  发表于: 2009-02-27 12:48
事实上,把file=/dev/mtdblock/3换成SD卡对应的设备, 比如, /dev/mmcblk0, 就能把板子当成USB读卡器了.
"If you have an apple and I have an apple and we exchange apples, then you and I will
still each have one apple. But if you have an idea and I have an idea and we exchange
these ideas, then each of us will have two ideas."
级别: 新手上路
UID: 4010
精华: 1
发帖: 19
金钱: 210 两
威望: 210 点
贡献值: 10 点
综合积分: 58 分
注册时间: 2009-02-20
最后登录: 2010-10-27
4楼  发表于: 2009-02-27 17:08
insmod g_file_storage.ko file=/dev/mtdblock/3 如果不加stall=0,在pc上只能在屏幕的右下角看到识别为一个 mass storage device的一个usb的箭头,但是在“我的电脑”里看不到盘符,如果带上及可以看到了。
级别: 侠客
UID: 5071
精华: 0
发帖: 50
金钱: 390 两
威望: 297 点
贡献值: 0 点
综合积分: 100 分
注册时间: 2009-04-09
最后登录: 2013-12-20
5楼  发表于: 2009-04-28 14:46

 Re:usb mass storage device 问题

我的这有错误:
insmod s3c2410_udc.ko
s3c2410_udc: debugfs dir creation failed -19
级别: 新手上路
UID: 1428
精华: 0
发帖: 17
金钱: 110 两
威望: 33 点
贡献值: 0 点
综合积分: 34 分
注册时间: 2008-08-27
最后登录: 2011-03-31
6楼  发表于: 2010-04-14 14:32

 Re:usb mass storage device 问题

这个是调试文件系统的报错  可以再file_storage.c中注释掉这一段代码就可以了