2015-01-16 04:27 AM
Hello,
I have double checked all connections of SD card socket to uC on our board. We also have pull-up resistors there. Required setting of 4-bit access can be seen in the SDIO_CLKCR.WIDBUS register during debugging but function disk_initialize called in f_mount retutns FR_NOT_READY. Any opinion? However, it is suspicious that I had to increase the SCLK divider to low the SCLK frequency for a reliable work (in 1-bit mode). Regards Ivan2015-01-19 01:03 AM
Hi Ivan,
The 4-bit SD Data Transfer Mode is Mandatory for High-Speed Cards, Optional for Low-Speed ones, so it depends on the used uSD card type. Otherwise, it's better to configure first the 1-bit SD Data Transfer Mode:hsd.Init.BusWide = SDIO_BUS_WIDE_1B;
And then, just enable wide operation, for the 4-bit SD Data Transfer Mode:
HAL_SD_WideBusOperation_Config(&hsd, SDIO_BUS_WIDE_4B);
PS: You can refer to the stm324x9i_eval_sd.c/stm324xg_eval_sd.c BSP drivers, that may help you!
Regards,
Heisenberg.
2015-01-26 09:58 AM
Hello Heisenberg,
Late setting of 4-bit mode works (I checked it by scope on SD Card signal D3) but the functionHAL_SD_WideBusOperation_Config
has to be called even after
f_mount
. Unfortunatelly, the file write still does not work reliably due to an interrupt (another issue). Regards Ivan