cancel
Showing results for 
Search instead for 
Did you mean: 

Move bulk of USB MSC ISR to user thread.

Biohazard
Associate

CubeMX USB MSC creates a large protocol stack to allow USB MSC to get to MMC memory device. This all runs directly from the ISR. We want as much of this to run in a user thread instead.

My concerns are how will the low-level USB work with this kind of hand off and if it is possible.

There must be a way for the USB MSC read/write request to be handed off to a user thread so the user thread can yield while waiting for DMA to/from MMC memory device to complete.

My first thought is that there must be a way to refactor HAL_PCD_IRQHandler to move the USB MSC data read/write calls to a user thread and schedule that thread.

My concerns are what happens once the handler returns and the data isn't ready to go out?

USB is polling, on read will the USB PC host keep polling waiting for a response?

How can the write result or read data response be sent back when not in the interrupt context?

Lots of USB details here I just don't know. Any know of a resource or maybe example of where this is done?

Device I am using is an STM32F7.

Thanks,

Greg.

0 REPLIES 0