Skip to main content
Graduate
May 17, 2024
Solved

Understanding uSD and MCU changing

  • May 17, 2024
  • 5 replies
  • 2878 views

Hi, I was trying to have microSD logging with F439 Nucleo. I can't see example with mentioned board. Please let me know:

1. example for mentioned board to log data in microSD

2. I tried configuring SD-4 bit, but couldn't identify the pins intialized in generated code (in MX pins used were visible)

3. Tried importing F413 Nucleo e.g., but couldn't identify pins configured and wasn't able to change MCU to F439.

Please guide.

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

    Closing post...not getting any replies

    5 replies

    Graduate II
    May 17, 2024

    NUCLEO-F439ZI

    https://www.st.com/en/evaluation-tools/nucleo-f439zi.html

    https://www.st.com/resource/en/datasheet/stm32f439zi.pdf

     

    Options for SDIO/SDMMC pins going to be very limited

    PD2  CMD

    PC8  D0

    PC9  D1

    PC10  D2

    PC11  D3

    PC12  CLK

    GPIO for Socket Card Detect

    Usually found at upper end of connectors

     

    GauravKAuthor
    Graduate
    May 20, 2024

    I mean pin configurations in code, I can see pin assignment in MX and board.

    Graduate II
    May 20, 2024

    Callbacks in the MSP code?

    For examples look in Applications directory of STM32f4x9 EVAL boards and similar. Going to use materially same pins as few choices. 

    Check adapter board has pull-ups on data and cmd lines. See schematic for EVAL boards.

    GauravKAuthor
    Graduate
    May 22, 2024

    Hello, I made e.g. with default init on MX for F439 Nucleo, SDIO-4 bit with FATFS as SD card. 

    Then added init of FATFS_LinkDriver() code with writing to file from FatFs_uSD e.g. of F469 Discovery. 

    I don't see any pins changing (especially clk). Code flow goes through 

    FATFS_LinkDriver() > f_mount() > f_mkfs() > if (stat & STA_NOINIT) return FR_NOT_READY;

    Please check what am I missing. I have connected microSD through a holder kit, can add pull ups on data and cmd, but should see some pins changing right.

    Technical Moderator
    May 22, 2024

    Please check what am I missing. 


    Sorry but how could community members check what you are missing if you didn't share your project and your schematics?

     

    GauravKAuthor
    Graduate
    May 22, 2024

    Hi, Thanks for your response, I have attached project. Im now failing at:

     

    if( hsd->SdCard.CardVersion == CARD_V2_X)

    {

    /* SEND CMD55 APP_CMD with RCA as 0 */

    errorstate = SDMMC_CmdAppCommand(hsd->Instance, 0);

    if(errorstate != HAL_SD_ERROR_NONE)

    {

    return HAL_SD_ERROR_UNSUPPORTED_FEATURE; /* error here in SD_PowerON() in "stm32f4xx_hal_sd.c" */

    }

    }

    Also the clock looks 400 kHz, In code settings look to be for 48 MHz. Im directly connecting Nucleo board lines to SD card holder board.

    On SD boardController pinsNucleo board
    3v33.3CN8.7CN8.7
    gndGNDCN8.11CN8.11
    d0D0PC8CN8.2
    d1D1PC9CN8.4
    d2D2PC10CN8.6
    d3D3PC11CN8.8
    d5CLKPC12CN8.10
    d7CMDPD2CN8.12
    GauravKAuthor
    Graduate
    May 24, 2024

    Does the simple combined sample code look ok? 

    Also the CMD line varies from 1.5 to 3.3 not 0 to 3.3V.

    Is SD detect required?

    The microSD is 32GB HC

    Please check

    GauravKAuthor
    Graduate
    May 23, 2024

    I have tried by adding pull-ups (1.2K ohm) on CMD and D0 to D3 lines, clk = 24 MHz. But code getting erorr at below in ff.c:

    stat = disk_initialize(pdrv);

    if (stat & STA_NOINIT) return FR_NOT_READY

    Don't see CMD lines changing.

    GauravKAuthorAnswer
    Graduate
    June 5, 2024

    Closing post...not getting any replies