3.2.1.2INDataPhase
USBControllerHostandPeripheralModesOperation
www.ti.com
3.Attheendoftheattempttosendthedata,thecontrollerwillgenerateanEndpoint0interrupt.The
softwareshouldthenreadHOST_CSR0toestablishwhethertheRXSTALLbit(bit2),theERRORbit
(bit4)ortheNAK_TIMEOUTbit(bit7)hasbeenset.
IfRXSTALLisset,itindicatesthatthetargetdidnotacceptthecommand(e.g.,becauseitisnot
supportedbythetargetdevice)andsohasissuedaSTALLresponse.
IfERRORisset,itmeansthatthecontrollerhastriedtosendtheSETUPPacketandthefollowing
datapacketthreetimeswithoutgettinganyresponse.
IfNAK_TIMEOUTisset,itmeansthatthecontrollerhasreceivedaNAKresponsetoeachattemptto
sendtheSETUPpacket,forlongerthanthetimesetinHOST_NAKLIMIT0.Thecontrollercanthenbe
directedeithertocontinuetryingthistransaction(untilittimesoutagain)byclearingthe
NAK_TIMEOUTbitortoabortthetransactionbyflushingtheFIFObeforeclearingtheNAK_TIMEOUT
bit.
4.IfnoneofRXSTALL,ERRORorNAK_TIMEOUTisset,theSETUPPhasehasbeencorrectlyACKed
andthesoftwareshouldproceedtothefollowingINDataPhase,OUTDataPhaseorINStatusPhase
specifiedfortheparticularStandardDeviceRequest.
FortheINDataPhaseofacontroltransaction(Figure10),thesoftwaredrivingtheUSBhostdevice
needsto:
1.SetREQPKTbitofHOST_CSR0(bit5).
2.WaitwhilethecontrollersendstheINtokenandreceivestherequireddataback.
3.WhenthecontrollergeneratestheEndpoint0interrupt,readHOST_CSR0toestablishwhetherthe
RXSTALLbit(bit2),theERRORbit(bit4),theNAK_TIMEOUTbit(bit7)orRXPKTRDYbit(bit0)has
beenset.
IfRXSTALLisset,itindicatesthatthetargethasissuedaSTALLresponse.
IfERRORisset,itmeansthatthecontrollerhastriedtosendtherequiredINtokenthreetimeswithout
gettinganyresponse.
IfNAK_TIMEOUTbitisset,itmeansthatthecontrollerhasreceivedaNAKresponsetoeachattempt
tosendtheINtoken,forlongerthanthetimesetinHOST_NAKLIMIT0.Thecontrollercanthenbe
directedeithertocontinuetryingthistransaction(untilittimesoutagain)byclearingthe
NAK_TIMEOUTbitortoabortthetransactionbyclearingREQPKTbeforeclearingtheNAK_TIMEOUT
bit.
4.IfRXPKTRDYhasbeenset,thesoftwareshouldreadthedatafromtheEndpoint0FIFO,thenclear
RXPKTRDY.
5.Iffurtherdataisexpected,thesoftwareshouldrepeatSteps1-4.
Whenallthedatahasbeensuccessfullyreceived,theCPUshouldproceedtotheOUTStatusPhaseof
theControlTransaction.
UniversalSerialBus(USB)Controller 46SPRUGH3–November2008
SubmitDocumentationFeedback