cancel
Showing results for 
Search instead for 
Did you mean: 

SD card interface code genereated by STM32CUbe32 (5.5.0)

HMaje.1
Associate III

i would request imen to let us know if the STM32CubeMx 5.5.0 is addressing all the issues regarding SD card interface using SDMMC ( 4 bits and DMA). Since the code generated from CubeMX 5.5.0 for nucleo-l476rg BOARD for SD card interface does not work.

if i program the same board with

STM32Cube_FW_L4_V1.15.0\Projects\STM32L476G-EVAL\Applications\FatFs\FatFs_uSD_Standalone ,

the SD card can be written as well as read.

14 REPLIES 14
Imen.D
ST Employee

Hello,

Could you please provide your ioc file to check your issue.

Best Regards,

Imen

When your question is answered, please close this topic by clicking "Accept as Solution".
Thanks
Imen
Hi Imen Dahmen,

Thank you for reply.

Please find attached the newSD.IOC

Thanks,
Hitesh

Hi Imen,

Please find the newSD.ioc file.

I am using keil 5.29 version of IDE. on generating the project and trying to compile, we get error of following as multiple instance of

__weak void HAL_SD_AbortCallback(SD_HandleTypeDef *hsd)

__weak void HAL_SD_TxCpltCallback(SD_HandleTypeDef *hsd)

__weak void HAL_SD_RxCpltCallback(SD_HandleTypeDef *hsd)

SO I removed the __weak from bsp_driver_sd.c and then it was successfully complied.

debugging the application, passes FR_OK till retSD = f_mount(&fs, (TCHAR const*)SDPath, 0);

But with same board, on loading the

STM32Cube_FW_L4_V1.15.0\Projects\STM32L476G-EVAL\Applications\FatFs\FatFs_uSD_Standalone , works well with write and read in SD card

On each line, except CLK, a 33K resistor is applied as pull up.

Imen.D
ST Employee

Thank you @HMaje.1​  for providing more details and sharing your ioc file.

This issue is raised internally to CubeMx team for check and analyze, then we will come back to you with update.

Best Regards,

Imen

When your question is answered, please close this topic by clicking "Accept as Solution".
Thanks
Imen

Thanks Imen,

I am attaching the project, if it can help in the analyze process.

Thanks,

Best Regards,

Hitesh

Khouloud ZEMMELI
ST Employee

​Hello @HMaje.1​ ,

Issue fixed, the fix will be available in the next CubeMX release.

Best Regards,

Khouloud

Hi Khouloud,

Thank you for the FIX. I hope this fix would be applicable to all stm32L series.

when should we expect the new version ( error fixed) ?

Once again thanks and awaiting for the fix.

Regards,

Hitesh

​Hi, It will be W08.

Best Regards,

Khouloud

Thanks Khouloud,

One more request, if you could share with us the configuration details for SDMMC for the tobe released STMcubeMX would be much appreciated.

(as the below points are quit confusing in several other SD related posts).

> for example should a DMA channel be enabled for both TX and RX of SDMMC ? or only one for both ?

> should DMA template in Fatfs configuration be enabled or kept disabled ?

> IS 48MHZ for Sysclk and SDMMC is OK ?

> regarding the heap and stack size ?

Thanks,

Best Regards,

Hitesh