PKP
VS1000 P
ROGRAMMER
’
S
G
UIDE
VSMPG
with STALL token. Bit out-stall-sent indicates that a STALL token has been successfully
transmitted to the PC.
A more common case of stalling regards the handling of control requests (SETUP mes-
sages sent to the control endpoint). In case of receiving an unsupported request, the
device should respond wit a stall. Since the control endpoint must remain open for the
next request for the PC and stalling a control request should be a rare event, a possible
way to handle this is:
•
In the USB_EP_ST0 register, set out-forcestall to “1” and out-stall-sent to “0”
•
Busy loop until out-stall-sent is “1” OR a USB reset occurs OR a time-out occurs
•
Set out-forcestall to “0”
In a normal case this would send a single STALL to the control endpoint and leave the
endpoint open for the next request.
If an endpoint’s (other than 0) Halt feature is set (USB Chapter 9 standard request), the
endpoint should be stalled (forcestall set to “1”).
Mass storage class device can use STALL to end a bulk transfer [Axelson, J.: USB Mass
Storage].
20.4
VS1000 ROM code usage
The ROM code in VS1000 has the following usage for the USB:
•
Endpoint 0: USB Standard Requests (USB Chapter 9 functionality)
•
Endpoint 1 OUT: USB Speakers
•
Endpoint 2 OUT: Mass Storage Class (PC
→
VS1000)
•
Endpoint 3 IN: Mass Storage Class (VS1000
→
PC)
Depending on the state of GPIO0:6 during boot-up, the descriptors sent to the PC select
either Audio or Mass Storage functionality.
Rev. 0.20
2011-10-04
Page