Question
FATFs f_open ?
Posted on February 25, 2017 at 23:02
Everybody,
Why isn't my f_open working properly ?
I tried the example from UM1718 but stack on f_open.
Is SDIO initialized properly ?
here's the code :
/TEST SDIO begin
if(retSD == 0) { printf('inside if retSD \n'); HAL_GPIO_WritePin(GPIOE, GPIO_PIN_6, GPIO_PIN_RESET); HAL_Delay(1000); /*♯♯-2- Register the file system object to the FatFs module ♯♯♯*/ if(f_mount(&SDFatFs, (TCHAR const*)SD_Path, 0) != FR_OK) { /* FatFs Initialization Error : set the red LED on */ HAL_GPIO_WritePin(GPIOE, GPIO_PIN_5, GPIO_PIN_SET); HAL_Delay(100); HAL_GPIO_WritePin(GPIOE, GPIO_PIN_5, GPIO_PIN_RESET); printf('FMOUNT FAIL! \n'); while(1); } else { printf('inside else on f_mount \n'); printf('f_mount OK! \n'); HAL_GPIO_WritePin(GPIOE, GPIO_PIN_5, GPIO_PIN_SET); HAL_Delay(1000); HAL_GPIO_WritePin(GPIOE, GPIO_PIN_5, GPIO_PIN_RESET); // it's stopped here res = f_open(&MyFile, 'hello.txt', FA_CREATE_ALWAYS | FA_WRITE); printf('after res command!');I diagnosed from serial :
inside if retSD
inside else on f_mount f_mount OK!Anyone can help please ?
Thanks
#fatfs-sdio #sdio #stm32f103