STM32L476 FatFs. cannot mount sd card (F_mount) - Help!
Hi,
Another one for you.
I am having problems with the FatFs library, specifically I cannot mount the SD card. I am using the HAL libraries and have generated the configuration using STMCubeMX. I cannot get this to work on either my own hardware of the STM32L476 eval board.
When I run this simple bit of code, i get the result '1' (FR_DISK_ERR), which apparently relates to a low level IO error.
I have tried;
adding 47K resistors to the I/O and clock lines.
changing the clock frequency (to the SDMMC module)
Formatting the SD card
Using a variety of SD cards
Running the code on my STM32L476 EVAL.
Given that I get the same result on the eval board, I would suggest that my hardware isn't the problem. The example software supplied in the STM32L4 mxcube package is massively different to the examples that apparently work on the web.
FATFS SDFatFs;
FIL MyFile;
UINT testByte;
uint8_t res;
char bufferout[20];
//char myPath[] = "testicle.txt\0";
//char myData[] = "This is a test!!\0";
//char bufferout[20];
//res = disk_initialize(0);
res = f_mount(&SDFatFs, (TCHAR const*)SDPath, 11);
sprintf(bufferout, "FR_res: %d", res);
HAL_UART_Transmit(&hlpuart1, (uint8_t*)bufferout, 10, 1000);I have scoured the internet for information, but cannot find any good examples to help me out, so I'm reaching to you guys.
Kind regards,
Peter