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:
- 2:f8bd763b5584
- Parent:
- 1:c39cfc31349d
- Child:
- 3:8b77055a68ec
--- a/main.cpp Fri Feb 12 15:38:38 2016 +0000 +++ b/main.cpp Fri Feb 12 15:52:44 2016 +0000 @@ -18,10 +18,15 @@ #define X_MEGA_BYTE ((1)*1024*1024) /* 1Mbyte */ #define FILE_NAME "GPATH" +void wait_key_press(){ + while(!pc.readable()); + volatile int res = pc.getc(); +} + int base_test() { printf("\nPress any key!\n"); - while(!pc.readable()); + wait_key_press(); mkdir("/sd/mydirx", 0777); @@ -95,9 +100,10 @@ int main(){ /* UART Baudrate is 9600bps*/ while(1){ - printf("\nStart SD card accsess test! -- Press any key"); - printf("\nWriting is very slow, wait several minuts.\n"); - while(!pc.readable()); + printf("\nStart SD card accsess test!"); + printf("\nWriting is very slow, wait several minuts."); + printf("\n-- Press any key --\n"); + wait_key_press(); writeTest(); readTest(); }