// 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 ) {
#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