run on mbed-os6.6.0

NumSD Card pinModule pinPin NamePort NameSPI
1CD/DAT3CSD10PB6-
2CMD/DISDID11PA_7MOSI
3VSS1GNDGND--
4VDD3.3V3V3--
5CLKCLKD13PA_5SCLK
6VSS2GNDGND--
7DAT0/DOSDOD12PA_6MISO
8DAT1----
9DAT2----

電源+/-を含め合計6本の結線で接続します。
Nucleoシリーズは、ボード上のLED(プログラムでLED1)がD13に接続されSPIモード設定時にSCLKとなる構成が多いので、LED1制御を止める必要があります。

For DISCO-F769NI
https://os.mbed.com/users/kenjiArai/code/DISCO-F769NI_BD_SD_Card_Control/
For DISCO-F469NI
https://os.mbed.com/users/kenjiArai/code/DISCO-F469NI_BD_SD_Card_Control/

Revision:
4:6d6ea85642ed
Parent:
3:4d7be22641c1
Child:
6:7f8bc932cede
--- a/FatFs_Mon/mon.cpp	Sat Aug 17 03:29:11 2019 +0000
+++ b/FatFs_Mon/mon.cpp	Tue Dec 24 10:30:40 2019 +0000
@@ -8,7 +8,7 @@
  *      Created:    May        5th, 2015
  *      Revised:    June      14th, 2015
  *      Revised:    April      7th, 2018
- *      Revised:    August    17th, 2019
+ *      Revised:    December  24th, 2019
  */
 
 /*
@@ -119,7 +119,7 @@
     "x     extend commands mode\r\n"
     "q     Return to main\r\n"
     "t     Show current time or Adjust time\r\n"
-    "      e.g. t 18 3 28 14 48 20 -> 2018-03-28 14:48:20\r\n"
+    "      e.g. t 19 12 24 10 11 12 -> 2019-12-24 10:11:12\r\n"
     "?     Help/You know the command\r\n"
     "\r\n";
 
@@ -292,6 +292,30 @@
     }
 }
 
+uint32_t get_data_file_size(const char *const file_name)
+{
+    BYTE res;
+    //const char *file_name ="acc_data.txt";
+ 
+    if (Dirx == NULL){
+        Dirx = new FATFS_DIR;
+    }
+    char p = NULL;
+    res = f_opendir(Dirx, &p);
+    if (res) {
+        put_rc((FRESULT)res);
+        return 0;
+    }
+    for(;;) {
+        res = f_readdir(Dirx, &Finfo);
+        if ((res != FR_OK) || !Finfo.fname[0]) break;
+        if (strcmp(Finfo.fname, file_name) == 0){
+            return Finfo.fsize;
+        }
+    }
+    return 0;
+}
+
 static void extended_mon( char *ptr )
 {
     PUTS(HelpMsg1);