STM32F4 Mass Storage Device
Initially I was planning to use a nand flash to read and write data, but I can't format it in FAT.


Sure you can -- if you use a flash translation layer. That's how SSDs and USB flash drives work, after all.

That being said, an SPI or QSPI flash device will probably be easier to get started with.