Hello,
I've tried to test sdcard with fatfs on STM32F429ZI on NUCLEO-F429ZI board.
The same code was working in SD 1 bit mode((no DMA, no RTOS).when i configure SD 4 bit mode f_mount returns FR_NOT_READY.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2022-08-31 3:17 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2022-08-31 4:51 AM
That's unfortunate.
​
P​erhaps 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.
Up vote any posts that you find helpful, it shows what's working..
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2022-08-31 6:13 AM
did you placed all the pullups?https://community.st.com/s/question/0D50X00009XkfrVSAR/using-internal-pullups-for-sdio-interface
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎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.
Up vote any posts that you find helpful, it shows what's working..
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2022-08-31 10:28 PM
Enable internally pull-ups on all lines except sdio _clk
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2022-08-31 11:11 PM
what are the possibility if the 4 bit mode not working?
