STM32_IAP demo.

Dependencies:   STM32_IAP mbed

Fork of IAP_internal_flash_write by Tedd OKANO

FLASH_wrtie_test EEPROM_write_test

Revision:
6:2357a04a16ff
Parent:
5:806960ca964e
Child:
7:41156dd69ab5
--- a/main.cpp	Fri Jan 16 08:00:33 2015 +0000
+++ b/main.cpp	Tue Mar 10 04:27:11 2015 +0000
@@ -43,6 +43,7 @@
  *        revision 3.0  09-Jan-2015   LPC812 and LPC824 support added
  *        revision 3.1  13-Jan-2015   LPC1114 support added
  *        revision 3.1.1 16-Jan-2015  Target MCU name changed for better compatibility across the platforms
+ *        revision 3.1.2 10-Mar-2015  merged with pull requests. reinvoke_isp() added and modified read_serial() to return a pointer.
  */
 
 #include    "mbed.h"
@@ -69,10 +70,20 @@
 int main()
 {
     char    mem[ MEM_SIZE ];    //  memory, it should be aligned to word boundary
+    int     *serial_number;
     int     r;
 
     printf( "\r\n\r\n=== IAP: Flash memory writing test ===\r\n" );
-    printf( "  device-ID = 0x%08X, serial# = 0x%08X, CPU running %dkHz\r\n", iap.read_ID(), iap.read_serial(), SystemCoreClock / 1000 );
+    printf( "  device-ID = 0x%08X\r\n", iap.read_ID() );
+
+    serial_number = iap.read_serial();
+
+    printf( "  serial# =" );
+    for ( int i = 0; i < 4; i++ )
+        printf( " %08X", *(serial_number + i) );
+    printf( "\r\n" );
+
+    printf( "  CPU running %dkHz\r\n", SystemCoreClock / 1000 );
     printf( "  user reserved flash area: start_address=0x%08X, size=%d bytes\r\n", iap.reserved_flash_area_start(), iap.reserved_flash_area_size() );
     printf( "  read_BootVer=0x%08X\r\r\n", iap.read_BootVer() );