cancel
Showing results for 
Search instead for 
Did you mean: 

Hello everyone, which low cost (I mean price and power) mcu can I use for SDMMC1 ?

HHako.1
Associate III

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.

6 REPLIES 6
AScha.3
Chief III

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 ...

If you feel a post has answered your question, please click "Accept as Solution".
HHako.1
Associate III

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);

}

AScha.3
Chief III

Is SD card working with L452 ?

F_mount, open, read file?

1or4 bit mode? Did you test speed?

If you feel a post has answered your question, please click "Accept as Solution".

The L452 should be capable.

You'd need to debug the DISKIO layer, the top level code's going to reveal very little.

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
HHako.1
Associate III

For L452 both 4bit and 1bit can do f_mount and then can't f_open.

AScha.3
Chief III

so you have no working connection on L452.

check connections and clock/speed settings;

try 1 bit mode at first.

If you feel a post has answered your question, please click "Accept as Solution".