Example showing how to create a file system on the QSPI flash.
The app_qspi_memstick application cannot create a QSPI file system - it can only modify an existing one. This application will create a file system for you. Modify the application by changing DESIRED_SIZE_IN_MB to get the desired size of the file system, compile it, download and run to format the QSPI FLASH.
Diff: main.cpp
- Revision:
- 0:52d05cabc12f
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/main.cpp Thu Sep 26 08:37:11 2013 +0000 @@ -0,0 +1,41 @@ + +/****************************************************************************** + * Includes + *****************************************************************************/ + +#include "mbed.h" + +#include "QSPIFileSystem.h" + +/****************************************************************************** + * Typedefs and defines + *****************************************************************************/ + +#define DESIRED_SIZE_IN_MB (8) + +/****************************************************************************** + * Local variables + *****************************************************************************/ + +QSPIFileSystem qspifs("qspi"); + +/****************************************************************************** + * Local functions + *****************************************************************************/ + +/****************************************************************************** + * Main function + *****************************************************************************/ + +int main() { + + printf("\nQSPI FS formatter\n"); + printf("Will format QSPI as %d MB file system\n", DESIRED_SIZE_IN_MB); + + int err = qspifs.format(DESIRED_SIZE_IN_MB); + if (err == 0) { + printf("Successfully formatted!\n"); + } else { + printf("Failed to format. Got error %d\n", err); + } +}