diff --git a/stmhal/hal/f7/src/stm32f7xx_hal_sd.c b/stmhal/hal/f7/src/stm32f7xx_hal_sd.c index 4aa28dbfdf..d7ea7d01f5 100644 --- a/stmhal/hal/f7/src/stm32f7xx_hal_sd.c +++ b/stmhal/hal/f7/src/stm32f7xx_hal_sd.c @@ -1557,7 +1557,7 @@ HAL_SD_ErrorTypedef HAL_SD_Get_CardInfo(SD_HandleTypeDef *hsd, HAL_SD_CardInfoTy /* Byte 10 */ tmp = (uint8_t)((hsd->CSD[2] & 0x0000FF00) >> 8); - pCardInfo->CardCapacity = ((pCardInfo->SD_csd.DeviceSize + 1)) * 512 * 1024; + pCardInfo->CardCapacity = ((pCardInfo->SD_csd.DeviceSize + 1ULL)) * 512 * 1024; pCardInfo->CardBlockSize = 512; } else