STM32 USB High Speed read SD card only 1 MB/s
Hello!
I am using STM32F427VGT with USB3300 as USB high speed device mass storage class. I want to read data from SD card to a PC and I am only able to get transfer speed about 1 MB/s. What is the real maximum read speed that I can get with this hardware configuration?
MCU provides USB3300 with 24 MHz clock and I am using BSP_SD_ReadBlocks_DMA() in STORAGE_Read_HS(). Transfer speed only slightly depends on SDIO clock divider - changing divider from 1 to 5 reduces the transfer by only about 20%. My code is generated with STM32CubeMX.
Here is my STORAGE_Read_HS():
int8_t STORAGE_Read_HS(uint8_t lun, uint8_t *buf, uint32_t blk_addr, uint16_t blk_len)
{
/* USER CODE BEGIN 13 */
uint8_t readResult;
uint32_t timeout = 100000;
readResult = BSP_SD_ReadBlocks_DMA((uint32_t *) buf, blk_addr, blk_len);
while (BSP_SD_GetCardState() != SD_TRANSFER_OK)
{
if (timeout-- == 0)
{
return USBD_FAIL;
}
}
if (readResult == MSD_OK)
{
return USBD_OK;
}
else
{
return USBD_FAIL;
}
/* USER CODE END 13 */
}Any ideas why I am not able to achieve greater read speed?
Kind regards
Bartosz
