I'm trying to integrate FATFS file system on Micron NAND SPI FLASH. I'm using the SPI peripheral of the STM32L486RG as interface.
I have developped a low level driver through which I'm able to read, write and erase data from different locations in the NAND memory.
I have then integrated my Low-level driver APIs under diskio.c
file in order they could be used by fatfs
APIs.
I have successfully formatted the memory through f_mkfs
(I'm getting FR_OK
with both f_mkfs
and f_open
APIs and when debugging the fs
object is containing the FAT signature).
However, when I try to write buffer into the file that I have created using f_oprn
, I get "FR_INT_ERR"
.
I have debugged my code step by step and I found that my get_fat
function returns (1) as result which means that an internal error has occurred
.
Any idea what could be the issue ?