2022-08-31 03:17 AM
2022-08-31 04:51 AM
That's unfortunate.
Perhaps you wired it wrong, or the code has expectations that weren't met?
I have SD cards in 4-bit mode working on those boards, so something related to your implementation.
2022-08-31 06:13 AM
did you placed all the pullups?https://community.st.com/s/question/0D50X00009XkfrVSAR/using-internal-pullups-for-sdio-interface
2022-08-31 10:23 AM
I rechecked the wiring,it is okay.
If any issue in my configuration,please check that
The relevant part of code:
fr = f_mount(&FatFs, "", 1);
if(fr==FR_OK)
{
HAL_UART_Transmit(&huart3, "OK to mount\n\r", 15, 1000);
}
else
{
HAL_UART_Transmit(&huart3, "error mount\n\r", 15, 1000);
}
fr = f_open(&fil, "STM.txt", FA_CREATE_ALWAYS | FA_WRITE | FA_READ);
if(fr==FR_OK)
{
HAL_UART_Transmit(&huart3, "OK to Create a file\n\r", 22, 1000);
}
else
{
HAL_UART_Transmit(&huart3, "error Create a file\n\r", 24, 1000);
}
fr = f_write(&fil, wtext, strlen(wtext), &bw);
if(fr==FR_OK)
{
HAL_UART_Transmit(&huart3, "OK to write the file\n\r", 22, 1000);
}
else
{
HAL_UART_Transmit(&huart3, "error write file\n\r", 24, 1000);
}
/* Close the file */
f_close(&fil);
f_mount(&FatFs, (TCHAR const*)NULL, 0);
{
HAL_UART_Transmit(&huart3, "ok to unmount\n\r", 18, 1000);
}
Environment:
STM32CubeIDE 1.8.0
sd card 16gb-class10
configuration in 4 bit mode:
Minimum heap size 0x200
minimum stack size 0x400
SDIO global interrupt-disable
Fatfs configuration:
the same code work if i generate sdio 1 bit mode with cubeMX .but in 4 bit mode it return FR_NOT_READY
2022-08-31 10:31 AM
I'm not using the code generator / boiler plate stuff.
Top level code is mostly irrelevant, the failure here comes from the DISKIO level, so debug/instrument that.
FR_NOT_READY, look if its expecting a GPIO for the CARD PRESENT switch.
4-BIT fussy to signal slewing, and correct mode selection at the card's command level.
2022-08-31 10:28 PM
Enable internally pull-ups on all lines except sdio _clk
2022-08-31 11:11 PM
what are the possibility if the 4 bit mode not working?