I-m trying to accomplish best USB speed through STM32H743 MCU to PC. First of all I was testing just receiving data. I was sending sending 8192 bytes from MCU to the pc without any other tasks, and the speed is 60 megabytes per minute - which is fine for me. I was doing it like this:
while(1) { CDC_send_alot((uint8_t*)&nandtest[0],8192); } USBD_StatusTypeDef CDC_send_alot(const void *buf, uint16_t len) { USBD_StatusTypeDef result; while (1) { result = CDC_Transmit_FS((void*)buf, len); if (result != USBD_BUSY) // this should break if USB reset or disconnect occurred break; } if (result == USBD_OK && (len % 64 == 0)) { // Send ZLP while(1) { result = CDC_Transmit_FS(0, 0); if (result != USBD_BUSY) break; } } return result; } nandtest here just an empty buffer. CDC_send_alot is a sub I'm using for send big packets also for control ZLP.
But the problem comes when I read SDHC card with sdio protocol and send the data to PC. I'm getting huge delays between packages. 
So the speed drops from 60 megabytes/minute to 15 megabyets/minute. The question is how can avoid this delays between READ SDHC CARD DATA -> send to PC?
I-m using standard HAL library generated by CubeMX2. Is it possible to read and send synchronously?