cancel
Showing results for 
Search instead for 
Did you mean: 

Hello, I've tried to test sdcard with fatfs on STM32F429ZI on NUCLEO-F429ZI board. The same code was working in SD 1 bit mode((no DMA, no RTOS).when i configure SD 4 bit mode f_mount returns FR_NOT_READY.

AK.15
Associate II
 
6 REPLIES 6

That's unfortunate.

P​erhaps you wired it wrong, or the code has expectations that weren't met?

I​ have SD cards in 4-bit mode working on those boards, so something related to your implementation.

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

did you placed all the pullups?https://community.st.com/s/question/0D50X00009XkfrVSAR/using-internal-pullups-for-sdio-interface

we dont need to firmware by ourselves, lets talk

I rechecked the wiring,it is okay.

If any issue in my configuration,please check that

The relevant part of code:

fr = f_mount(&FatFs, "", 1);

        if(fr==FR_OK)

        {

          HAL_UART_Transmit(&huart3, "OK to mount\n\r", 15, 1000);

        }

        else

        {

           HAL_UART_Transmit(&huart3, "error mount\n\r", 15, 1000);

        }

  fr = f_open(&fil, "STM.txt", FA_CREATE_ALWAYS | FA_WRITE | FA_READ);

        if(fr==FR_OK)

          {

          HAL_UART_Transmit(&huart3, "OK to Create a file\n\r", 22, 1000);

          }

          else

          {

           HAL_UART_Transmit(&huart3, "error Create a file\n\r", 24, 1000);

          }

   fr = f_write(&fil, wtext, strlen(wtext), &bw);

       if(fr==FR_OK)

          {

           HAL_UART_Transmit(&huart3, "OK to write the file\n\r", 22, 1000);

          }

          else

          {

            HAL_UART_Transmit(&huart3, "error write file\n\r", 24, 1000);

          }

  /* Close the file */

    f_close(&fil);

    f_mount(&FatFs, (TCHAR const*)NULL, 0);

    {

       HAL_UART_Transmit(&huart3, "ok to unmount\n\r", 18, 1000);

    }

Environment:

STM32CubeIDE 1.8.0

sd card 16gb-class10

configuration in 4 bit mode:

0693W00000SuDWnQAN.pngMinimum heap size 0x200

minimum stack size 0x400

0693W00000SuDWEQA3.png 

SDIO global interrupt-disable

0693W00000SuDWdQAN.pngFatfs configuration:

0693W00000SuDXMQA3.png 

the same code work if i generate sdio 1 bit mode with cubeMX .but in 4 bit mode it return FR_NOT_READY

I'm not using the code generator / boiler plate stuff.

Top level code is mostly irrelevant, the failure here comes from the DISKIO level, so debug/instrument that.

FR_NOT_READY, look if its expecting a GPIO for the CARD PRESENT switch.

4-BIT fussy to signal slewing, and correct mode selection at the card's command level.

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

Enable internally pull-ups on all lines except sdio _clk

what are the possibility if the 4 bit mode not working?