2016-07-25 10:21 AM
Hello,
I am using CubeMx to generate 1-bit SDIO SD card code. I have done so much programming using CubeMx and all those codes workfine. But When I generate SD code it is giving error (Hard Fault) at the function f_open(). Here is the code sequence which I used.res = BSP_SD_Init();
if
(res!=FR_OK)
{
Error_Handler();
}
res = f_mount(&SDFatFs,
''''
,1);
if
(res!=FR_OK)
{
Error_Handler();
}
res = f_open(&myFile,
''test.txt''
,FA_READ);
it goes into the hard fault at f_open(). Anyone have done SD card with STM32F4??
#stm32f4 #f_open() #sd-card
2016-07-25 11:20 AM
Make sure you have an adequate stack allocation.
Have a proper Hard Fault Handler so you can see exactly what it is faulting on. If your understand what is faulting you can focus on how to fix it.2016-07-25 01:42 PM
If you use DMA, file handlers can be local.... if stack is located in CCRAM
2016-07-26 12:56 AM