2023-06-11 01:57 AM
Hello everyone,
I would like to use SDMMC1 with some low cost mcu with cortex m3 or m4 processor. Who have such experience, could you please share with your experience ? At moment I am using F746ZGT6 and it works great. I have decided to migrate to L452 but it doesn't work with the same configuration which I am using for F746ZGT6.
2023-06-11 07:37 AM
so you want some recommendation for >> with the same configuration which I am using << , but you do not give any description for ?
ok, wait, i am looking for my big blue glass ball ...
2023-06-11 08:25 AM
I am using SDMMC with DMA RX, TX not RTOS, 50mhz clock, 32gb, v10 sd card.
here is my sd writing function. In case of L452 I got disk filure and timeout.
void write_sd(uint32_t * data_send)
{
if(f_mount(&SDFatFS, (TCHAR const*)SDPath, 0) != FR_OK)
{
char *str0 = "Mounting Error\r\n";
HAL_UART_Transmit(&huart2, (uint8_t *)str0, strlen(str0), 100);
Error_Handler();
}
else
{
//Open file for writing (Create)
if(f_open(&SDFile, "STM32.txt", FA_OPEN_APPEND | FA_WRITE) != FR_OK)
{
char *str2 = "Opening Error\r\n";
HAL_UART_Transmit(&huart2, (uint8_t *)str2, strlen(str2), 100);
Error_Handler();
}
else
{
//Write to the text file
res = f_write(&SDFile, data_send, BUFFER_SIZE, (void *)&byteswritten);
if((byteswritten == 0) || (res != FR_OK))
{
char *str4 = "Writing from main Error\r\n";
HAL_UART_Transmit(&huart2, (uint8_t *)str4, strlen(str4), 100);
Error_Handler();
}
else
{
char bbb[32];
sprintf(bbb, "bytes written %ld\n", byteswritten);
HAL_UART_Transmit(&huart2, (uint8_t *)bbb, strlen(bbb), 100);
char *str5 = "Writed!\r\n";
HAL_UART_Transmit(&huart2, (uint8_t *)str5, strlen(str5), 100);
f_close(&SDFile);
}
}
}
f_mount(&SDFatFS, (TCHAR const*)NULL, 0);
}
2023-06-11 09:05 AM
Is SD card working with L452 ?
F_mount, open, read file?
1or4 bit mode? Did you test speed?
2023-06-11 09:10 AM
The L452 should be capable.
You'd need to debug the DISKIO layer, the top level code's going to reveal very little.
2023-06-11 10:00 AM
For L452 both 4bit and 1bit can do f_mount and then can't f_open.
2023-06-13 12:39 AM
so you have no working connection on L452.
check connections and clock/speed settings;
try 1 bit mode at first.