STM32L552 USB CDC Library CDC_Receive_FS Interrupt Control and Speed Optimization
I'm looking to control the CDC_Receive_FS interrupt in a manner that I'm hoping is supported by the lower level hardware, but I'm having difficulty locating registers and functionality to support this behavior.
To give a hint to the architecture I'm working with. When the CDC_Receive_FS callback is triggered by interrupt, I take the data and put it into a FIFO queue. I'd like to:
- Be able to "disable" the interrupt when the FIFO is full such that all messages that are attempted to be sent by the host are NAK'd until I've handled the FIFO and am ready to accept new messages.
- For handling large file transfer, I'd like to be able to make sure the UserRxBufferFS is completely filled with data BEFORE I receive the interrupt/callback. The idea here is that I can receive a full buffer, transfer it via MEM_TO_MEM DMA_IT, and then receive a new completely filled buffer afterwards. I don't want to receive a bunch of partially filled buffers of a few bytes at a time.
I'm trying to get a grasp of how the USB works internally, and how I should customize it for my use case. I know the USB MSC uses Bulk Transfer and DMA. Does the USBD CDC device class automatically support bulk transfer and DMA? I've seen information that points me in both directions. If it does, how do I activate the DMA/Bulk Transfer. There aren't any options in the .ioc or in the STM Source Code Comments. (Usually peripheral code [like spi.c] contain documentation on how to activate available features).
The MSC_Standalone usbd_storage_if.c interface gives examples of features and capacities I'd like to use, but that would require re-initializing my USB device in order to Register Storage in a different capacity specifically for the transfer, and then switching back again. Can the MSC features be used from the USBD CDC Storage class?
Thank you for the assistance!
