cancel
Showing results for 
Search instead for 
Did you mean: 

Understanding uSD and MCU changing

GauravK
Senior

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.

1 ACCEPTED SOLUTION

Accepted Solutions
GauravK
Senior

Closing post...not getting any replies

View solution in original post

13 REPLIES 13

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
Up vote any posts that you find helpful, it shows what's working..

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

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
Up vote any posts that you find helpful, it shows what's working..

Thanks (Im new to ST environment and also using new interfaces),

I was able to identify pins in "stm32f4xx_hal_msp.c", will work on: 

          Understanding uSD SDIO  interface configurations in code and 

          Having R/W e.g. for Nucleo F439.

Hello,

You can use CubeMx code generator tool for any board you want by following this video on Youtube especially at the minute 06:00

 

To give better visibility on the answered topics, please click on "Accept as Solution" on the reply which solved your issue or answered your question.

 

Please check reply to topic

GauravK
Senior

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.


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 on "Accept as Solution" on the reply which solved your issue or answered your question.
GauravK
Senior

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