2013-11-29 04:04 AM
Hey everybody,
I'm having a hard time figuring out what the problem is. SPI seems to be working, disk_initialize(0) returns FR_OK and f_mount(0,&fs) returns FR_OK as well.
Problem is, that when I call
f_open(&fin, ''olimexino.txt'', FA_WRITE | FA_OPEN_ALWAYS | FA_READ)
the returnvalue is FR_NO_FILESYSTEM. I tracked the origin of the error, and the problem occurs in the check_fs()-function at the following line
if (LD_WORD(&fs->win[BS_55AA]) != 0xAA55)
so 2 is returned.
The reason for this is, that every value in the fs-pointer is zero.
I feel like I forgot some kind of initialization? But I wasn't able to figure out why this happens exactly. I had FatFS up & running on other systems just fine. In this application I'm using a STM32F103BG (part of Olimexino-STM32)
Any help would be appreciated! Thank you very much in advance
#zero #fatfs2013-11-29 04:36 AM
Suggest you start by validating disk_read() in diskio.c, what blocks it's being asked to read, and what actually gets read into memory. Check also if there are any PARTITION related settings in the code. If the stack is adequately large, and if the static structures within FatFs are being initialized as expected by the C run time code.
2013-11-29 08:58 AM
You are a m&!§)§f)''§(ng genius! If you should ever be in munich: I owe you a drink.
Thanks clive!For the rest of the world: During the disk_read() I realized, that the write_block didn't do what the method was supposed to do.2014-08-31 12:25 PM
Hi menecken,
I am facing same issue. Could please share what changes you have made ?