dynamic load and run users binary file. self write the flash memory.

Dependencies:   mbed

Revision:
3:5cf31386b95d
Parent:
2:c56b5e682f0c
--- a/main.cpp	Tue Dec 27 16:57:59 2011 +0000
+++ b/main.cpp	Tue Dec 27 17:02:56 2011 +0000
@@ -117,7 +117,10 @@
 
     printf( "device-ID = 0x%08X, serial# = 0x%08X, CPU running %dkHz\r\n", iap.read_ID(), iap.read_serial(), SystemCoreClock / 1000 );
 
-    loadbinary("/local/test.dat");
+    if (loadbinary("/local/test.dat")) {
+        printf("error loadbinary\r\n");
+        return -1;
+    }
 
 //    memdump( sector_start_adress[ TARGET_SECTOR ], 48 * 4);