cancel
Showing results for 
Search instead for 
Did you mean: 

I want to do file operation on internal flash memory. is there any way to do this? I tried using f_open, f_write, but its getting fail. is there any setting that we need to do?

STura.1
Associate II

my requirement is to do file operation. I tried it using following way.

  1. f_mkfs
  2. f_mount
  3. f_open
  4. f_write.

but it cant help me. f_mkfs failed to create file system. I attached file filesystem.c for reference. please let me know any way to do this.

1 REPLY 1
Jack Peacock_2
Senior III

This is theoretically possible but you aren't going to find much in the way of examples. Internal flash is a limited resource. Typically there isn't much left over after code and data, so a file system isn't practical.

You have to provide the low level code to read and write the internal flash. For most controllers this stalls execution, causing all kinds of problems. For instance, you have to shut down all other interrupts while writing or erasing internal flash. How does that impact your application? Have you looked at the storage overhead needed for a FAT filesystem? You aren't going to have much room for data. What happens if power fails during a directory write? How do you recover?

Look at an SPI or QUADSPI serial NOR flash, or an SD/MMC storage device instead.

Jack Peacock