From 09de030651b95956eb9f899e850f24d0ce804460 Mon Sep 17 00:00:00 2001 From: Felix Domke Date: Fri, 5 Sep 2014 13:47:33 +0200 Subject: [PATCH] stmhal/hal/src/stm32f4xx_hal_sd.c: fix SDHC card capacity --- stmhal/hal/src/stm32f4xx_hal_sd.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/stmhal/hal/src/stm32f4xx_hal_sd.c b/stmhal/hal/src/stm32f4xx_hal_sd.c index 08be7f689b..5018f1b23c 100644 --- a/stmhal/hal/src/stm32f4xx_hal_sd.c +++ b/stmhal/hal/src/stm32f4xx_hal_sd.c @@ -1578,7 +1578,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