2024-06-21 06:32 AM
Hello,
I would like to know how to configure the SD card of an STM32L552E-VE evaluation board, I have an example with this evaluation card 'FatFs_uSD_Standalone' but It's not easy for me to understand how to configure the 'SDMMC' with this board since there is no '.IOC' file. I have the example code but not the '.IOC' configuration file. Can anyone tell me how to configure the SD card via STM32CubeIDE ?
Thank you for helps.
2024-06-21 06:37 AM - edited 2024-06-21 06:46 AM
Hello,
This video shows how to configure SD interface using CubeMx for FatFs file system usage .
Hope it helps.
2024-06-21 06:43 AM
2024-06-24 02:09 AM
Hello,
I can see the video but in this step I don't have the same configuration
And my evaluation card does not have a DMA tab? Maybe I'm missing a library ?
Yet the NVIC is activated. Probably the STM32F7 board is not the same as STM32L5 that why I don't have the DMA tab ?
Thanks
2024-06-24 03:19 AM
Hello,
this config of SD card on STM32L552E-VE board can help you. If you use SD card for the application 'FatFs_uSD_Standalone' must enable SDMMC1 global interrupt.
I will be waiting for your feedback.
2024-06-24 04:48 AM - edited 2024-06-24 05:44 AM
Hello M. Elhem,
Thank you for this information, after having verified I don't have the SD card but the µSD card, I think it's the same communication protocol for both ? Should I check the box 'NVIC Interrupt Table' or not ? After your previous picture we don't validate NVIC Interrupt Table.
When I try to generate de code by STMCubeIDE I have this message :
Thanks
2024-06-24 05:52 AM
Hello,
After login and download the update now i can have the code, now I can compare with the example code. Thank you.
2024-06-25 05:27 AM
Hello,
After comparing the code I more or less found the configuration via CubeMX but I don't know where to find this information ? Could you tell me where they are located in the CLock configuration window ?
Thank you for your helps
Regards
2024-06-25 06:23 AM
From the clock configuration menu and set SDMMC1 clock source to PLLP:
The related generated code will be available le in stm32l5xx_hal_msp.c:
void HAL_SD_MspInit(SD_HandleTypeDef* hsd)
{
GPIO_InitTypeDef GPIO_InitStruct = {0};
RCC_PeriphCLKInitTypeDef PeriphClkInit = {0};
if(hsd->Instance==SDMMC1)
{
/* USER CODE BEGIN SDMMC1_MspInit 0 */
/* USER CODE END SDMMC1_MspInit 0 */
/** Initializes the peripherals clock
*/
PeriphClkInit.PeriphClockSelection = RCC_PERIPHCLK_SDMMC1;
PeriphClkInit.Sdmmc1ClockSelection = RCC_SDMMC1CLKSOURCE_PLLP;
if (HAL_RCCEx_PeriphCLKConfig(&PeriphClkInit) != HAL_OK)
{
Error_Handler();
}
:
2024-06-25 06:24 AM
Hello,
Clock Config of SD is correct and it is located in "SystemClock_Config" function.
Please find attached this lien of "FatFs_uSD_Standalone" application on STM32L552E-EV can help you :
https://github.com/STMicroelectronics/STM32CubeL5/tree/master/Projects/STM32L552E-EV/Applications/FatFs/FatFs_uSD_Standalone
you can compare your code generated with CubeMX with this application.
Good work.
Best regards.