Merge branch 'master' of https://github.com/burnsfisher/stlink
authorFabien Le Mentec <texane@gmail.com>
Sun, 23 Jun 2013 11:49:22 +0000 (06:49 -0500)
committerFabien Le Mentec <texane@gmail.com>
Sun, 23 Jun 2013 11:49:22 +0000 (06:49 -0500)
1  2 
src/stlink-common.c
src/stlink-common.h

index ed1583d5a5291c0e6f6fc012aa76dcb60bedcd9f,2b208bc549f81a1cdbcdfb27c7e31696c557c575..23bea5836299299c7444e658017bf7900f63bf8d
@@@ -461,10 -450,9 +461,10 @@@ int stlink_load_device_params(stlink_t 
      // read flash size from hardware, if possible...
      if (sl->chip_id == STM32_CHIPID_F2) {
          sl->flash_size = 0x100000; /* Use maximum, User must care!*/
 -    } else if (sl->chip_id == STM32_CHIPID_F4) {
 +    } else if (sl->chip_id == STM32_CHIPID_F4 ||
 +        sl->chip_id == STM32_CHIPID_F4_LP) {
                sl->flash_size = 0x100000;                      //todo: RM0090 error; size register same address as unique ID
-     } else if (sl->chip_id == STM32_CHIPID_L1_MEDIUM) {
+     } else if (sl->chip_id == STM32_CHIPID_L1_MEDIUM || sl->chip_id == STM32_CHIPID_L1_MEDIUM_PLUS) {
          // if the flash size is zero, we assume it is 128k, if not we calculate the real value
          uint32_t flash_size = stlink_read_debug32(sl,params->flash_size_reg) & 0xffff;
          if ( flash_size == 0 ) {
index 8b1be82c8b4d2bf83501ed24dfa65859066a89d5,7553224cd9ba4007c8a76a41d92618413c32d256..c17019568a90b3260f5c71568958fb6c7a70b53e
@@@ -102,10 -102,15 +102,16 @@@ extern "C" 
  #define STM32_CHIPID_F3 0x422
  #define STM32_CHIPID_F37x 0x432
  #define STM32_CHIPID_F4 0x413
 +#define STM32_CHIPID_F4_LP 0x423
  #define STM32_CHIPID_F1_HIGH 0x414
  #define STM32_CHIPID_L1_MEDIUM 0x416
- #define STM32_CHIPID_L1_MEDIUM_PLUS 0x436
+ #define STM32_CHIPID_L1_MEDIUM_PLUS 0x427
+ /*
+  * 0x436 is actually assigned to some L1 chips that are called "Medium-Plus"
+  * and some that are called "High".  0x427 is assigned to the other "Medium-
+  * plus" chips.  To make it a bit simpler we just call 427 MEDIUM_PLUS and
+  * 0x436 HIGH.
+  */
  #define STM32_CHIPID_L1_HIGH 0x436
  #define STM32_CHIPID_F1_CONN 0x418
  #define STM32_CHIPID_F1_VL_MEDIUM 0x420