SDIO 4bit not working, but SDIO 1bit is working.
- March 18, 2020
- 3 replies
- 2685 views
STM32F429I-DISC1
STM32F429ZIT6U
STM32CubeMX Version 5.6.0
FATFS Version R0.12c
two different SDHC Class 10, 8GB with sector size 2048, tested on windows 10
FREERTOS not enabled
SDIO 1bit is working perfectly with my configuration.
SDIO 4bit is not working, as f_open returns "FR_NO_FILESYSTEM"
I've spent some time and figured out, why it is giving me that error:
In "./Middlewares/ST/Third_Party/FatFs/src/ff.c" is a function called "check_fs". There's an if:
if (ld_word(fs->win + BS_55AA) != 0xAA55) return 3;This if returns 3 which equals FR_NO_FILESYSTEM.
I've looked into fs->win + BS_55AA which is going to be converted to a 2-byte little endian word. So this function takes fs->win[510] and fs->win[511] as BS_55AA is 510.
There I saw a difference!
SDIO 1bit (correct):
fs->win[509] = 0 = 0x0
fs->win[510] = 85 = 0x55
fs->win[511] = 170 = 0xAA
so ld_word(fs->win + BS_55AA) equals 0xAA55 => correct => if does not return 3
SDIO 4bit (incorrect):
fs->win[509] = 4 = 0x5
fs->win[510] = 90 = 0x5A
fs->win[511] = 161 = 0xA1
so ld_word(fs->win + BS_55AA) equals 0xA15A => incorrect => if does return 3
I hope someone knows how to resolve this issue.
BTW: I already tried standard debug things like other pullups, series resistors, sdio clock speed, ...
If I select 60 as prescaler for SDIO_CLK the signals on all pins are very clean, so the hardware is working.
Thank you!