Hi all,
I've got a strange one here, perhaps something wrong with the STM32 HAL. I'm trying to demo FATFS that has been created through CubeMX. I have used SDIO 4 bits and enabled FATFS with the default settings. I use the code below to test. I can create the file on the disk however when I try to write to the file I get a Hardfault in the SDMMC_WriteFIFO function. The memory address for the data it's trying to write to the card is out of range at 0x20050000. I find this very strange. Has anyone else had this issue? I see one person has posted it on the ST forums without a proper solution.
Thanks
f_mount(&FatFs, "", 0);
fr = f_open(&Fil, "george.txt", FA_WRITE | FA_CREATE_ALWAYS);
if (fr == FR_OK)
{
f_write(&Fil, "It works!\r\n", 11, &bw);
fr = f_close(&Fil);
if (fr == FR_OK && bw == 11)
{
asm("NOP");
}
}