Skip to main content
Explorer
October 21, 2024
Solved

Unable to access SD Card using SDIO in F446RET6

  • October 21, 2024
  • 4 replies
  • 3829 views

Hai all,

I am using SDIO protocol for interfacing SD card with STM42F446RE.But While accessing the SD card, I am facing the following issues.

1. Unable to access the card, even the card size , free space etc

2. Also unable to open directory, and files.

 

Here I am using SDIO 4bit bus mode. FATFS enabled with minimum sector size 512 and maximum 4096.

I tried with external pull up resistors of 10k in each data lines(D0 to D3) and CMD lines.

Bit still I am unable to connect with SD card,

Please help me

    This topic has been closed for replies.
    Best answer by Abin

    Hai All, 

    I want to mention my points about the SDIO protocol in the F446RE Nucleo Board.

    1. First I checked the Clock frequency and verified that it is always 381 KHz all the times. The image from the oscilloscope is attached here.

    2. Even if the frequency input for APB2 is divided with any prescalar value , the same 381 KHz is maintained.

    It is not increasing or decreasing.

    3. I have tested the same with an SDIO module which is purchased via online for hardware side verification. Unfortunately there is no change.

    So , I assume that SDIO is not suitable for F446RE Nucleo or STM32f446RE microcontroller series.

    Please give a response to my observations.Wave_SDIOMod.pngSDS00007.png

     

    4 replies

    Super User
    October 21, 2024

    What board is this on?

    What software?

    What testing/debugging/investigation have you done so far?

    Please see the posting tips:

    https://community.st.com/t5/community-guidelines/how-to-write-your-question-to-maximize-your-chances-to-find-a/ta-p/575228

     

    AbinAuthor
    Explorer
    October 21, 2024

    I am using NUCLEO-F446RE (MB136 rev C) board.

    I am using Cube IDE V1.16.1.

    Actually I have done the following checking from my side.

    -- This is initially I checked in NUCLEO l476RG using SDMMC with 4 bit mode and SPI it was working fine.

    -- While I migrated to F446RE , I am facing the issue.

    -- Here I kept the frequency as 180MHz and clock division in (SDIO CLock Div) as 4.Even I changed to 6, 8 etc.

    -- Connected the SD card slot with each pin 10K pull up resistors externally, except for CLK line.

    If I want to do anything else please tell me

    Super User
    October 21, 2024

    Have you stepped through your code to see where, exactly, it is failing?

    Have you used an oscilloscope or logic analyser to see what (if anything) is actually happening on the wires?

    Compare & contrast what happens on the (working) NUCLEO l476RG and the (non-working) F446RE 

    AbinAuthor
    Explorer
    October 22, 2024

    Hai,

    I will explain my points clearly.

    I have Nucleo f446RE board and I need to interface an SD card with the same board using SDIO protocol.

    I am using SD card adaptor for connecting the SD card with Nucleo Board. Please see the image.

    The connection is exactly the same as in the image.

    I hope it is clear.Connection.pngAdaptor.pngconnection.jpeg

     

    ST Employee
    October 23, 2024

     

     

    Abin,

     

    Thanks for your sharing. The schematic is no issue, even we can config internal pull-up/pull-down without external resistor to respect the SDIO specification.

    I don't find the right MCU pinout for SDIO and the connection. But I think it's not the big issue if you checked them carefully.

    I'm worried about the signal integrity because you used the flying wires for SDIO communication. For my understanding, it maybe the issue happens on the L446, but not on the L476. It should be better to use oscillator to confirm the signals.

    If not, I suggest adding more GND wires close to SDIO signals to check if the SDIO communication can create.

     

     

    AbinAuthor
    Explorer
    October 23, 2024

    Hai @EZHON.1 

    Thank you for your reply. I will check it. Moreover, I checked the clock frequency. It is coming as 334KHz. I configured HCLK as 16 MHz from internal RC oscillator.And the division factor is 18.This division factor is derived from the following formulae

    SDIO Need 400KHz clock, So 400 = (HCLK)/(2*(CLKDIV+2)).Please confirm , my approach is correct.

    AbinAuthorAnswer
    Explorer
    November 4, 2024

    Hai All, 

    I want to mention my points about the SDIO protocol in the F446RE Nucleo Board.

    1. First I checked the Clock frequency and verified that it is always 381 KHz all the times. The image from the oscilloscope is attached here.

    2. Even if the frequency input for APB2 is divided with any prescalar value , the same 381 KHz is maintained.

    It is not increasing or decreasing.

    3. I have tested the same with an SDIO module which is purchased via online for hardware side verification. Unfortunately there is no change.

    So , I assume that SDIO is not suitable for F446RE Nucleo or STM32f446RE microcontroller series.

    Please give a response to my observations.Wave_SDIOMod.pngSDS00007.png