cancel
Showing results for 
Search instead for 
Did you mean: 

FatFS on QSPI Flash

zubizeratta
Associate II
Posted on June 07, 2016 at 09:04

Hello,

Is is possible to use FATFS file system on QSPI Flash with STM32F7 series microcontrollers? I couldn't find any example code about it. 

18 REPLIES 18
Radosław
Senior II
Posted on June 07, 2016 at 09:34

ONLY for read, for write you need flash file system, ot FTL (flash transiction layer).

ONLY read version make no sense.

imtiaz
Associate II
Posted on December 15, 2016 at 00:56

Hi,

I would like to do the same thing - use FAtFs on QSPI Flash - are there any examples or QSPIFlash_diskio.c driver available?

Thanks

Posted on December 15, 2016 at 01:13

Ok, so assuming such code is code isn't falling out of a Google search you might need to take some code that supports QSPI read/write and mapping that into the simple blocking strategy the DISKIO layer implements.

Prove to yourself you can read 512 byte blocks, then review what the block erase size is, and how you might need to read-erase-write to commit the changes back. Optimization might lead you to a lazy writer caching implementation.

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
Posted on December 15, 2016 at 03:55

Thanks for the pointers – I will try to implement the diskio layer – doesn’t look too difficult.

________________

Attachments :

image001.jpg : https://st--c.eu10.content.force.com/sfc/dist/version/download/?oid=00Db0000000YtG6&ids=0680X000006HyhG&d=%2Fa%2F0X0000000bFg%2Fzn5X1uRuf0o2Zi16NHYMZc2cd3_wma1y9tDcNfSdmag&asPdf=false
Posted on December 15, 2016 at 20:15

Hi Clive,

You mentioned reading 512 byte blocks , why 512?

Thanks

Imtiaz

________________

Attachments :

image001.jpg : https://st--c.eu10.content.force.com/sfc/dist/version/download/?oid=00Db0000000YtG6&ids=0680X000006Hyzk&d=%2Fa%2F0X0000000bFd%2F8p1WALO4iuAoX8JKpZZQk.rORbESdUttELylz4C4Y00&asPdf=false
Posted on December 15, 2016 at 21:49

It is the sector size that FatFs expects to be working with, and the minimum size read/write unit the DISKIO layer is expected to handle transparently.

You might want to review mass storage devices used in the last several decades to put that in some context. Specifically rotating magnetic media use on IBM PC type systems.

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
Posted on December 16, 2016 at 00:53

Hi Clive,

Do you see any issues if I just make the BLOCK_SIZE to 4096 , which is my minimum erase size for the SPI flash?

Thanks , Much appreciated

________________

Attachments :

image001.jpg : https://st--c.eu10.content.force.com/sfc/dist/version/download/?oid=00Db0000000YtG6&ids=0680X000006Hz2X&d=%2Fa%2F0X0000000bFe%2F8GlBlRVbw43OOGg4gYQPFAOh4UrMVhz1YM11aEaw.Cg&asPdf=false
imtiaz
Associate II
Posted on December 22, 2016 at 22:50

Just to close out this thread - I implemented the Disk IO layer for the external flash on the F769 Discovery. I took the easy option and used the 4096 byte sector size corresponding to the minimum sector erase on the flash chip. All works fine. It takes around 600mSec to write and read back 64K - which is quite slow. Fatfs has to do a read - erase - write for each write and a sector erase takes minimum 43 msec .

Posted on February 19, 2017 at 16:57

Hi imtiaz,

would you be willing to provide some code of your implementation? (FatFs config, VFS, HAL Init)?

Best regards

Lars