Skip to main content
Senior
May 17, 2024
Solved

Understanding uSD and MCU changing

  • May 17, 2024
  • 13 replies
  • 2950 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

13 replies

Tesla DeLorean
Guru
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

 

Tips, Buy me a coffee, or three.. PayPal Venmo (See Profile) Up vote any posts that you find helpful, it shows what's working..
GauravKAuthor
Senior
May 20, 2024

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

Tesla DeLorean
Guru
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.

Tips, Buy me a coffee, or three.. PayPal Venmo (See Profile) Up vote any posts that you find helpful, it shows what's working..
GauravKAuthor
Senior
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.

mƎALLEm
ST 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?

 

To give better visibility on the answered topics, please click "Best answer" on the reply which solved your issue or answered your question.
GauravKAuthor
Senior
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
Senior
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
Senior
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.

GauravKAuthorBest answer
Senior
June 5, 2024

Closing post...not getting any replies