NO:
W90P710 Programming Guide
VERSION:
2.1
PAGE:
102
The above information is the exclusive intellectual property of Winbond Electronics and shall not be disclosed,
distributed or reproduced without permission from Winbond.
Table No.: 1200-0003-07-A
7.4.7 Example
How to configure the USBD to be a mass storage? The programmer could follow the steps below
to setup the hardware dependent. About the mass storage protocol, the programmer should refer to
the relative specification.
1. Configure the endpoint (refer to endpoint configuration section 10.4.2). The application needs
two endpoints in bulk-only mass storage. Therefore, the user can set the EPA for bulk IN,
endpoint 1 and maximum packet size is 64bytes; EPB for bulk OUT, endpoint 2 and
maximum packet size is 64 bytes.
2. Install the USBD interrupt service routine to Advanced Interrupt Controller (refer system
library users manual).
3. Initial the USBD hardware such as interrupt enable (refer to initialization section 10.4.1).
4. After finish the above steps, plug the USBD into the host.
5. The host will ask the descriptors such as device, configuration, and string descriptor. How to
answer the descriptor? The programmer could refer to Get Descriptor section 10.4.5.
6. The host will send the class command (0xa1fe) after get descriptor. This command uses to
get MAX LUN. The device shall return one bytes of data that contains the maximum LUN
supported by the device. The Logical Unit Numbers on the device shall be numbered
contiguously starting from LUN 0 to a maximum LUN of 15 (0xF). In this application, the
programmer may return 0 for one drive.
7. The host will begin to send the mass storage class command to get the removable drive
information. These class commands transfer will through the EPA and EPB endpoints. The
user can refer the endpoint operation section 10.4.6 to get more detail information.
8. After the above steps, the host can appreciate a removable drive plug-in. And the user can
access it using Windows File explorer.