| ??? 01/30/06 22:23 Read: times Msg Score: +1 +1 Good Answer/Helpful |
#108772 - the whole picture Responding to: ???'s previous message |
What is Out Status stage at Control-IN interrupt
How MCU can realize this status? Ignore it with some delay or another thing? About The rightmost small pass: What happens in this part: It seems there isn't any task here! The status stage is ZLP, either IN or OUT. At the end of Control-IN transfer, host send ZLP to Control-OUT EP as the status stage. The rightmost small path on the flow chart (p11) handles this ZLP from the host. As this packet works only for confirmation, MCU has nothing to do other than setting "Control State" to USB_IDLE. "Control State" in the flow chart means USB_TRANSMIT- MCU is handling Control-IN transfer
USB_RECEIVE - MCU is handling Control-OUT transfer with data stage
USB_IDLE - Control EPs are in idle state
or MCU is handling Control-OUT transfer without data stage
As you see in the discussion so far, Control-IN and Control-OUT transfer are handled across both Control IN/OUT EP. This feature makes the story complicated. OK, review once again. Now we can see the whole picture. a) Control-IN transfer
- Transaction (packet) sequence:
SETUP - IN - IN -...- IN - OUT
(data stage) (status stage)
- setup stage
SETUP packet is received by Control-OUT EP
This packet is handled by "Control Out Handler" - left main path
MCU set "Control State" to USB_TRANSMIT
- data stage
MCU interpret SETUP packet in mainloop, fill IN buffer with appropriate data
IN transaction is received by Control-IN EP
D12 returns a packet filled to IN buffer in the mainloop
After sending the packet, "Control IN Handler" is called by interrupt
- status stage
OUT packet (ZLP) is received by Control-OUT EP
This packet is handled by "Control Out Handler" - rightmost small path
MCU set "Control State" to USB_IDLE
a) Control-OUT transfer (with data stage)
- Transaction (packet) sequence:
SETUP - OUT - OUT -...- OUT - IN
(data stage) (status stage)
- setup stage
SETUP packet is received by Control-OUT EP
This packet is handled by "Control Out Handler" - left main path
MCU set "Control State" to USB_RECEIVE
- data stage
MCU interpret SETUP packet in mainloop, prepare to receive data
OUT packet is received by Control-OUT EP
This packet is handled by "Control Out Handler" - center path
When all data is received, MCU set "Control State" to USB_IDLE
MCU handle the command told by host
- status stage
MCU set ZLP to Control-IN EP in mainloop
IN transaction is received by Control-IN EP
D12 returns ZLP
After sending the packet, "Control IN Handler" is called by interrupt
"Control IN Handler" return immediately, because "Control State" is USB_IDLE
a) Control-OUT transfer (without data stage)
- Transaction (packet) sequence:
SETUP - IN
(status stage)
- setup stage
SETUP packet is received by Control-OUT EP
This packet is handled by "Control Out Handler" - left main path
MCU set "Control State" to USB_IDLE, because of no data
- status stage
MCU interpret SETUP packet in mainloop, handle the command told by host
MCU set ZLP to Control-IN EP in mainloop
IN transaction is received by Control-IN EP
D12 returns ZLP
After sending the packet, "Control IN Handler" is called by interrupt
"Control IN Handler" return immediately, because "Control State" is USB_IDLE
Tsuneo |



