How can I make lpd7a404 as a u-disk by using it's usb device controller in linux.
My platform is lpd7a404-SDK/linux/BSP-sharpLH7-1.2.8. I want to make lpd7a404 as a u-disk,
so I can format or copy file from PC(OS:WinXP) to lpd7a404 via usb (PC is host, and lpd7a404-SDK is device).
I have configured linux's kernel with "usb gadget" & "usb file storage" support, like this:
#
# USB Gadget Support
#
CONFIG_USB_GADGET=y
CONFIG_USB_GADGET_DEBUG_FILES=y
# CONFIG_USB_GADGET_NET2280 is not set
# CONFIG_USB_GADGET_PXA2XX is not set
# CONFIG_USB_GADGET_GOKU is not set
CONFIG_USB_GADGET_LH7A40X=y
CONFIG_USB_LH7A40X=y
# CONFIG_USB_GADGET_OMAP is not set
# CONFIG_USB_GADGET_DUMMY_HCD is not set
# CONFIG_USB_GADGET_DUALSPEED is not set
# CONFIG_USB_ZERO is not set
# CONFIG_USB_ETH is not set
CONFIG_USB_GADGETFS=m
CONFIG_USB_FILE_STORAGE=m
# CONFIG_USB_FILE_STORAGE_TEST is not set
# CONFIG_USB_G_SERIAL is not set
After "make modules", I get module g_file_storage.ko, then I test after linux booted:
/ # dd if=/dev/zero of=udisk.img bs=1k count=4096
4096+0 records in
4096+0 records out
/ # insmod /usr/modules/g_file_gadget.ko file=udisk.img
Using usr/modules/g_file_storage.ko
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=0, file: /udisk.img
lh7a40x_udc: registered gadget driver 'g_file_storage'
======= now I connect lpd7a404-SDK to PC(WinXP) via usb cable ========
/ # g_file_storage gadget: full speed config #1
Now WinXP show a u-disk driver is usable, but it's capability is 0 MB, and I cannot format u-disk or copy file to u-disk.
Is there any suggestion to me?
Best regards,
Alex Zhou
Sitek Hengke Co., ltd.
E-Mail:
zhouwang@sitek.cn
Address: GuangBao Road No.1, New District, WuXi, JiangSu, China