AnsweredAssumed Answered

BUG in STM32L4 Hal lib (v1.1) hal_sd.c

Question asked by Mazzetti.Francesco on Nov 21, 2015
Latest reply on Nov 23, 2015 by Amel N
Hello everybody
I have found a BUG in STM32L4 hal lib (v1.1)
I don't know if it is present in other STM32 family hal library.

in stm32l4xx_hal_sd.c file at 1657 line

pCardInfo->CardCapacity  = ((pCardInfo->SD_csd.DeviceSize + 1)) * 512 * 1024;

must be change in

pCardInfo->CardCapacity  = ((uint64_t)((uint64_t)pCardInfo->SD_csd.DeviceSize + 1)) * 512 * 1024;

this error generate false capacity detection in SDHC card and limit at 4GB some operation with FATFS library
(for example wite and format)


Outcomes