阅读:1563回复:4
有请做过Mass Storage类设备的大虾来指点一下方向!
小弟之前用手头上的开发板资源做了一个自定义的HID类设备,
将Input Report和Output Report长度都定为4 Bytes, 用Interrupt 传输发送Input Report给Host, 用Control传输接收从Host发送的Output Report, 成功的实现了对设备的读写。 由于项目的最终目标是要读/写设备EEPROM中的数据(也就是要做一个EEPROM编程器), 而且每次读/写操作的数据量在几十K Bytes, 因此个人觉得采用HID设备的来做似乎不合适, 所以想请教各位大虾, 希望能指点一下方向。 为了简化开发过程,希望能避过写驱动程序,仍然采用USB Org定义的标准设备类型, 想请问各位: 1、将该设备定义成Mass Storage类还是Communication Device类比较适用于我所描述的设备? 因为Mass Storage类设备是不用自己写驱动程序的,但是简单看了一下定义成该类的设备类型,大多数都是Hard drive,CD、DVD drive居多,似乎没有用作EEPROM编程器的,希望有做过Mass Storage类设备的大虾指点一下,采用该类标准做是否可行? 2、如果上面所说的两种标准类设备都不适合的话,应该是哪种标准类设备比较适合? 拜谢各位! |
|
沙发#
发布于:2007-10-31 18:59
刚刚从Jan Axelson的《Mass Storage--Designning And Programming Device And Embedded Host》书中看到下面的话,看来用Mass Storage做我这个EEPROM编程器并不合适,唉,再看看别的先。显然我做的东东比它说的要简单些的说。
大虾们,指点一下啊。 Designing and programming a USB mass-storage device or embedded USB host involves a variety of interfaces, protocols, and structures. Every USB mass-storage device must support two interfaces: • A USB device interface to enable the device to communicate with a PC or other USB host. • An interface between the device’s microcontroller or other CPU and the storage media. Flash-memory cards typically use the Serial Peripheral Interface (SPI), MultiMediaCard bus, SD-Card bus, or a bus derived from the ATA interface or PC-Card bus. Hard drives typically use the ATA parallel interface. 每个USB Mass-Storage设备必须支持两个接口:一是与PC或者其他的USB Host的接口;另一个是在设备MCU与存储介质之间的接口。 A USB mass-storage device must implement these protocols and structures: • Generic USB protocol. Every USB device must respond to requests sent by the USB host and other events on the bus. • USB mass-storage protocol. Every USB mass-storage device must detect and respond to requests that are specific to the USB mass-storage class. • SCSI commands. USB hosts access mass-storage devices via commands originally developed for devices that use the Small Computer Systems Interface (SCSI). • Media-specific protocol. The storage media’s controller typically supports a command set for accessing the media’s contents. Many flash-memory cards use the MultiMediaCard protocol or the SD Card protocol. Hard drives use the ATA protocol. USB Mass-Storage设备必须处理以下协议: 通用的USB协议;USB Mass-Storage类协议;SCSI命令;存储介质特定协议。 Reading and writing data to a mass-storage device also involves understanding logical structures in the media: • Media structure. Program code accesses the storage area in drives as a series of logical blocks, or sectors. Dedicated areas in the media store information about the logical blocks and other logical structures in the media. • File system. If the device firmware reads or writes to files on its own, rather than via a USB host, the device must implement a file system such as FAT16 or FAT32. 向Mass-Storage设备读写数据同样要理解存储介质的逻辑结构: 存储介质结构;文件系统。 |
|
板凳#
发布于:2007-10-31 20:14
找到了周立功的开发包中关于做EEPROM编程器的例程
看了一下代码,它是用Test & Measurement Class类设备来做的 但是它提供了驱动文件 为什么要用驱动程序呢? 把源代码共享一下先 希望有人来回答我的问题 |
|
|
地板#
发布于:2008-09-04 12:34
Jan Axelson的《Mass Storage--Designning And Programming Device And Embedded Host》这本书能共享一下吗?
maggieshaw@gmail.com谢谢了 |
|
地下室#
发布于:2008-09-07 20:27
可以用HID去做,用SET_REPORT和GET_REPORT去做
|
|
|