f_mount always return FR_DISK_ERR when using 4 bit wide SDIO bus but works perfectly with 1 bit SDIO bus
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2019-09-30 10:09 PM
I have NUCLEO-F767ZI 216Mhz and a SD card breakout board. I am using cube mx 5.2.0 and FW_F7_V1.15.0 for code generation. I want to read/write in a file on a sd card. I have enabled SDMMC1 (SD 4 bit wide bus) in cube mx and also enabled FATFS middleware for sd card.
SDIO CLK divide factor 3
MAX_SS 4096
and all other parameters are default
I have connected SDIO pin correctly (double checked) .
When I use 1 bit SDIO bus it works perfectly for same code.
Code:
FATFS SDFatFS ;
FIL SDFile ;
res =f_mount ( &SDFatFS , SDPath,1);
char myFileName[]= "abc.txt"; // create new file
if (res == FR_OK){
res=f_open ( &SDFile , myFileName, FA_WRITE | FA_CREATE_ALWAYS); // open in write mode
}
char myData[] = "xyx,ghj,acceleration,target position\n 1000,231.25,10,500.5";
if (res == FR_OK){
res=f_write ( &SDFile, myData , sizeof(myData), &myBytes);
}
f_close(&SDFile);
- Labels:
-
FatFS
-
SDIO-SDMMC
-
STM32CubeMX
-
STM32F7 Series
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2019-09-30 10:23 PM
Likely unrelated to code shown.
Could be SW, could be how you have your card wired.
4-bit test code for NUCLEO-F7xx posted here, review output to VCP
https://community.st.com/s/question/0D50X0000BOtWr8SQF/fatfs-sdio-4-bit-mode-stm32f746zg-nucleo
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
‎2019-09-30 10:32 PM
I have wired the card correctly. I saw your link and downloaded your demo. I don't know what to do with your hex file
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2019-09-30 11:37 PM
Program with STM32 Cube Programmer, observe via Terminal app.​
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
‎2019-10-01 12:21 AM
I tried. It is just Printing 0,13 % every second
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2019-10-31 4:10 AM
Solved! It was't related to software.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2024-08-20 12:14 AM
May I know how did you resolve it in your case?
I had the same problem.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2025-01-12 11:31 PM
I have the same problem. How did you solve it?
