Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependencies: DISCO-F746NG_BLOCK_DEVICE_WITH_FAT_FILESYSTEM_ON_SDCARD SDRAM_DISCO_F746NG BSP_DISCO_F746NG BD_SD_DISCO_F746NG AUDIO_DISCO_F746NG
Revision 0:4cdf28a602a8, committed 2018-03-24
- Comitter:
- roykrikke
- Date:
- Sat Mar 24 19:11:15 2018 +0000
- Child:
- 1:ffacc9d0b308
- Commit message:
- First release
Changed in this revision
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/BD_SD_DISCO_F746NG.lib Sat Mar 24 19:11:15 2018 +0000 @@ -0,0 +1,1 @@ +https://os.mbed.com/users/roykrikke/code/BD_SD_DISCO_F746NG/#131c3e1d831e
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/main.cpp Sat Mar 24 19:11:15 2018 +0000
@@ -0,0 +1,56 @@
+#include "mbed.h"
+#include "BD_SD_DISCO_F746NG.h"
+
+DigitalOut led (LED1);
+
+// Instantiate the Block Device for sd card on DISCO-F746NG
+BD_SD_DISCO_F746NG bd;
+uint8_t block[512] = "Hello World!\n";
+
+int
+main () {
+ Serial pc (SERIAL_TX, SERIAL_RX);
+ pc.baud (115200);
+ printf ("Start\n");
+
+ // Call the BD_SD_DISCO_F746NG instance initialisation method.
+ printf ("sd card init...\n");
+ if (0 != bd.init ()) {
+ printf ("Init failed \n");
+ return -1;
+ }
+
+ printf ("sd size: %llu\n", bd.size ());
+ printf ("sd read size: %llu\n", bd.get_read_size ());
+ printf ("sd program size: %llu\n", bd.get_program_size ());
+ printf ("sd erase size: %llu\n\n", bd.get_erase_size ());
+
+ printf ("sd erase...\n");
+ if (0 != bd.erase (0, bd.get_erase_size ())) {
+ printf ("Error Erasing block \n");
+ }
+
+ // Write some the data block to the device
+ printf ("sd write: %s\n", block);
+ if (0 == bd.program (block, 0, 512)) {
+ // read the data block from the device
+ printf ("sd read: ");
+ if (0 == bd.read (block, 0, 512)) {
+ // print the contents of the block
+ printf ("%s", block);
+ }
+ }
+
+ // Call the BD_SD_DISCO_F746NG instance de-initialisation method.
+ printf ("sd card deinit...\n");
+ if (0 != bd.deinit ()) {
+ printf ("Deinit failed \n");
+ return -1;
+ }
+
+ // Blink led with 2 Hz
+ while (true) {
+ led = !led;
+ wait (0.5);
+ }
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mbed-os.lib Sat Mar 24 19:11:15 2018 +0000 @@ -0,0 +1,1 @@ +https://github.com/ARMmbed/mbed-os/#16bac101a6b7b4724023dcf86ece1548e3a23cbf