Simple helloworld program to show reduced overhead of SDFileSystem-RTOS

Dependencies:   SDFileSystem-RTOS mbed-rtos mbed

Hello-world program for RTOS SDFileSystem

One thread stores time values in two buffers, the other thread saves it on the SD card. Since the time thread has low priority the SD thread will take what it needs. This then shows the reduced overhead of the RTOS SDFileSystem compared to regular.

To test it yourself, delete SDFileSystem-RTOS, import the regular one.

The pinouts are for the Wi-Go2 board, but you can easily change it.

After writing the first buffer it stores it on the SD card, and as soon as possible starts filling the second buffer with new timer values. The timer values around this storage point for the RTOS version of SDFileSystem:

183
185
187
189
191
1900
1902
1904
1906
1908
1910

So it stopped the timer thread for 1.7ms.

With regular SD card it is:

183
185
187
189
191
426240
426242
426244
426246
426248
426250

So that is alot worse. Of course you still need to give it enough time to write everything, and later on there will also be short hickups when it has to start writing a new block.

Files at this revision

API Documentation at this revision

Comitter:
Sissors
Date:
Sat Mar 15 22:23:36 2014 +0000
Parent:
1:bce8311b4547
Commit message:
Added pinout comments

Changed in this revision

main.cpp Show annotated file Show diff for this revision Revisions of this file
--- a/main.cpp	Sun Jan 05 10:22:10 2014 +0000
+++ b/main.cpp	Sat Mar 15 22:23:36 2014 +0000
@@ -15,8 +15,9 @@
 #include "rtos.h"
 #include "SDFileSystem.h"
  
-DigitalOut SD_EN(PTE3);                         // Enable signal for SD Card
-SDFileSystem sd(PTD6, PTD7, PTB11, PTE5, "sd"); // The pinout on the Wi-Go2 module
+DigitalOut SD_EN(PTE3);                         // Enable signal for SD Card, specific to Wi-Go2, most SD-card boards do not have this pin
+                                                // In that case you can remove it, or assign it to a random pin you are not using
+SDFileSystem sd(PTD6, PTD7, PTB11, PTE5, "sd"); // The pinout on the Wi-Go2 module (MOSI, MISO, SCLK, CS)
 
 unsigned int buffer1[100];
 unsigned int buffer2[100];