STM32_IAP demo.

Dependencies:   STM32_IAP mbed

Fork of IAP_internal_flash_write by Tedd OKANO

FLASH_wrtie_test EEPROM_write_test

Files at this revision

API Documentation at this revision

Comitter:
va009039
Date:
Sun Apr 10 11:36:00 2016 +0000
Parent:
6:2357a04a16ff
Child:
8:8273c1727a6a
Commit message:
first commit

Changed in this revision

IAP.lib Show diff for this revision Revisions of this file
STM32_IAP.lib Show annotated file Show diff for this revision Revisions of this file
main.cpp Show annotated file Show diff for this revision Revisions of this file
mbed.bld Show annotated file Show diff for this revision Revisions of this file
--- a/IAP.lib	Tue Mar 10 04:27:11 2015 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,1 +0,0 @@
-http://developer.mbed.org/users/okano/code/IAP/#c8bf974ecb33
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/STM32_IAP.lib	Sun Apr 10 11:36:00 2016 +0000
@@ -0,0 +1,1 @@
+https://developer.mbed.org/users/va009039/code/STM32_IAP/#8af7acf9dbf3
--- a/main.cpp	Tue Mar 10 04:27:11 2015 +0000
+++ b/main.cpp	Sun Apr 10 11:36:00 2016 +0000
@@ -51,7 +51,23 @@
 
 #define     MEM_SIZE        256
 
-#if defined(TARGET_LPC176X)
+#if defined(TARGET_NUCLEO_L152RE)
+#define     TARGET_SECTOR    (0x00060000/FLASH_PAGE_SIZE)
+struct {
+    char* operator[](int sector) {
+        return (char*)(sector * FLASH_PAGE_SIZE);
+    }
+} sector_start_adress;
+#elif defined(TARGET_NUCLEO_F401RE)||defined(TARGET_NUCLEO_F411RE)||defined(TARGET_NUCLEO_F446RE)
+#define     TARGET_SECTOR    3
+struct {
+    char* operator[](int sector) {
+        static const uint32_t base[8] = {0x00000, 0x04000, 0x08000, 0xc000, 0x10000, 0x20000, 0x40000, 0x60000};
+        return (char*)base[sector];
+    }
+} sector_start_adress;
+
+#elif defined(TARGET_LPC176X)
 #define     TARGET_SECTOR    29     //  use sector 29 as target sector if it is on LPC1768
 #elif defined(TARGET_LPC11UXX) || defined(TARGET_LPC11XX)
 #define     TARGET_SECTOR    7      //  use sector  7 as target sector if it is on LPC11U24
--- a/mbed.bld	Tue Mar 10 04:27:11 2015 +0000
+++ b/mbed.bld	Sun Apr 10 11:36:00 2016 +0000
@@ -1,1 +1,1 @@
-http://mbed.org/users/mbed_official/code/mbed/builds/7e07b6fb45cf
\ No newline at end of file
+http://mbed.org/users/mbed_official/code/mbed/builds/99a22ba036c9
\ No newline at end of file