cancel
Showing results for 
Search instead for 
Did you mean: 

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

fra
Associate II
Posted on November 21, 2015 at 16:01

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)

#stm32l4 #hal-library #bug
3 REPLIES 3
Posted on November 21, 2015 at 16:21

I believe this error has been reported before, if not in the L4 specifically then for others, in fact ST has had issues with >4G SD Cards, that have been repeatedly been pointed out for the last 7-8 years.

HAL/Cube bugs/issues might be better handled in the other forum page [DEAD LINK /public/STe2ecommunities/mcu/Lists/STM32Java/AllItems.aspx]STM32 Software Tools and Firmware 

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
fra
Associate II
Posted on November 21, 2015 at 21:36

I have now controlled stm32F4 (v1.9) hal lib and there isn't this issue.

I hope STM fix also STM32L4 lib

Amel NASRI
ST Employee
Posted on November 23, 2015 at 10:34

Hi Cesco,

Thanks for highlighting this bug. It is reported internally to be fixed in coming releases of L4 package.

-Mayla-

To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.