You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by GitBox <gi...@apache.org> on 2021/04/05 16:59:05 UTC

[GitHub] [incubator-nuttx] v01d opened a new issue #3387: EP0 OUT CLASS DATA

v01d opened a new issue #3387:
URL: https://github.com/apache/incubator-nuttx/issues/3387


   ```
     Description: There is no mechanism in place to handle EP0 OUT data transfers.
                  There are two aspects to this problem, neither are easy to fix
                  (only because of the number of drivers that would be impacted):
   
                  1. The class drivers only send EP0 write requests and these are
                     only queued on EP0 IN by this drivers.  There is never a read
                     request queued on EP0 OUT.
                  2. But EP0 OUT data could be buffered in a buffer in the driver
                     data structure.  However, there is no method currently
                     defined in the USB device interface to obtain the EP0 data.
   
                  Updates:  (1) The USB device-to-class interface as been extended so
                  that EP0 OUT data can accompany the SETUP request sent to the
                  class drivers. (2) The logic in the STM32 F4 OTG FS device driver
                  has been extended to provide this data.  Updates are still needed
                  to other drivers.
   
                  Here is an overview of the required changes:
                  New two buffers in driver structure:
   
                  1. The existing EP0 setup request buffer (ctrlreq, 8 bytes)
                  2. A new EP0 data buffer to driver state structure (ep0data,
                     max packetsize)
   
                  Add a new state:
   
                  3. Waiting for EP0 setup OUT data (EP0STATE_SETUP_OUT)
   
                  General logic flow:
   
                  1. When an EP0 SETUP packet is received:
                     - Read the request into EP0 setup request buffer (ctrlreq,
                       8 bytes)
                     - If this is an OUT request with data length, set the EP0
                       state to EP0STATE_SETUP_OUT and wait to receive data on
                       EP0.
                     - Otherwise, the SETUP request may be processed now (or,
                       in the case of the F4 driver, at the conclusion of the
                       SETUP phase).
                  2. When EP0 the EP0 OUT DATA packet is received:
                     - Verify state is EP0STATE_SETUP_OUT
                     - Read the request into the EP0 data buffer (ep0data, max
                       packet size)
                     - Now process the previously buffered SETUP request along
                       with the OUT data.
                  3. When the setup packet is dispatched to the class driver,
                     the OUT data must be passed as the final parameter in the
                     call.
   
                  Update 2013-9-2:  The new USB device-side driver for the SAMA5D3
                  correctly supports OUT SETUP data following the same design as
                  per above.
   
                  Update 2013-11-7: David Sidrane has fixed with issue with the
                  STM32 F1 USB device driver.  Still a few more to go before this
                  can be closed out.
   
     Status:      Open
     Priority:    High for class drivers that need EP0 data.  For example, the
                  CDC/ACM serial driver might need the line coding data (that
                  data is not used currently, but it might be).
   ```


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org