-
Notifications
You must be signed in to change notification settings - Fork 4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
...help with SD Card... #2
Comments
Check whether the pull-up function of GPIO is enabled |
Thank for you reply - I appreciate it. I am using this firmware package for the mcu reference STM32F446RETx So I started to step through ST's library, and I noticed that the mount failed due to SD detect pin state PA8 - SD_DETECT is gpio_input interesting enough - in the middleware file "fatfs_platform.c", the detect pin is expected to be reset state when card is inserted. uint8_t BSP_PlatformIsDetected(void) { However mounting the disk still fails looking further this command fails in this file stm32f4xx_hal_sd.c errorstate = SDMMC_CmdAppOperCommand(hsd->Instance, SDMMC_VOLTAGE_WINDOW_SD | SDMMC_HIGH_CAPACITY | SD_SWITCH_1_8V_CAPACITY);
SDMMC_CmdAppOperCommand returns HAL_SD_ERROR_CMD_RSP_TIMEOUT I made sure all the pins were set to pull-up, even though I don't believe the clock pin should be pull-up but out of desperation I tried anyway. I also tried setting sdio for 1-BIT and I still couldn't get that to work. The SD card is a 32GB card formatted to FAT32 Please let me know if there is any more information you need. Would love to get this to work with 4-bit SDIO. thanks again! |
Love the board for stm32f446 - I followed the schematic and assigned these pin configuration for SDIO
Select 4 bits wide bus in stm32 cubemx
PC8 - SDIO_D0
PC9 - SDIO_D1
PC10 - SDIO_D2
PC11 - SDIO_D3
PC12 - SDIO_CLK
PD2 - SDIO_CMD
PA8 - SD_DETECT - input - pull-down
PB2 - LED - output push pull
And since I am clocking the MCU to 180MHZ the SDIO bus is set to 45MHZ and in the SDIO configuration I have SDIOCLK clock divide factor set to 3 - expecting it to be 15 MHZ
I am also using FATFS middleware.
In attempting to mount the microSD card - I keep receiving this error stm32f4xx_hal_sd.c in function static uint32_t SD_PowerON(SD_HandleTypeDef *hsd) {...
/* Send CMD41 */
errorstate = SDMMC_CmdAppOperCommand(hsd->Instance, SDMMC_VOLTAGE_WINDOW_SD | SDMMC_HIGH_CAPACITY | SD_SWITCH_1_8V_CAPACITY);
...}
The errorstate returned is SDMMC_ERROR_CMD_RSP_TIMEOUT.
I am wondering if anyone was able to get the microSD working on the board? And would you mind sharing how?
The text was updated successfully, but these errors were encountered: