first
Dependencies: SDFileSystemDMA mbed
Refer to:
https://developer.mbed.org/users/mimi3/code/SDFileSystemDMA
Caution
If your board has SRAM less than or equal to 8KB, the 'buffer' size must be set to 512 Bytes.
NUCLEO-F411RE
About 2.5MBytes/sec
NUCLEO-L152RE
About 1MBytes/sec
Diff: main.cpp
- Revision:
- 20:e34f5e5f307b
- Parent:
- 18:5fb42182d85d
- Child:
- 21:6253a88675a5
--- a/main.cpp Tue Aug 30 20:15:36 2016 +0900 +++ b/main.cpp Tue Aug 30 20:17:00 2016 +0900 @@ -22,10 +22,10 @@ * (default is 1 (SPI1)) */ #include "spi_device.h" - #define UART_KEY_PRESS 1 #define SPI_CLOCK_HZ ( 12 * 1000000 ) + Timer timer; //Serial pc(PA_9,PA_10); Serial pc(USBTX,USBRX); @@ -41,19 +41,19 @@ #define X_MEGA_BYTE ((1)*1024*1024) /* 1Mbyte */ #define FILE_NAME "GPATH" + void wait_key_press(){ #if UART_KEY_PRESS pc.printf("\n-- Select 'r' or 'w' --\n"); fflush(stdout); while(!pc.readable()); volatile int res = pc.getc(); -#else - #endif } void writeTest() { +#if !_FS_READONLY //Test write performance by creating a 1MB file pc.printf("[Write]: Testing %d byte buffer: write performance...", sizeof(buffer)); fflush(stdout); @@ -82,6 +82,7 @@ } else { pc.printf("failed to create file!\n"); } +#endif } void readTest()