fix can not flash STM32_F3_SMALL
authorMax Chen <trlsmax@gmail.com>
Thu, 13 Aug 2015 06:24:09 +0000 (14:24 +0800)
committerMax Chen <trlsmax@gmail.com>
Thu, 13 Aug 2015 06:24:09 +0000 (14:24 +0800)
src/stlink-common.c

index 7bf6f7263f03cea09148f2e4a4c11c20c3a16993..3964d40e0b05bc94574ac26aff9d7f8772b8e539 100644 (file)
@@ -1267,6 +1267,7 @@ int stlink_erase_flash_page(stlink_t *sl, stm32_addr_t flashaddr)
     } else if (sl->core_id == STM32VL_CORE_ID 
             || sl->core_id == STM32F0_CORE_ID 
             || sl->chip_id == STM32_CHIPID_F3 
+            || sl->chip_id == STM32_CHIPID_F3_SMALL
             || sl->chip_id == STM32_CHIPID_F303_HIGH
             || sl->chip_id == STM32_CHIPID_F37x
             || sl->chip_id == STM32_CHIPID_F334)  {
@@ -1545,6 +1546,7 @@ int write_loader_to_sram(stlink_t *sl, stm32_addr_t* addr, size_t* size) {
         loader_size = sizeof(loader_code_stm32l);
     } else if (sl->core_id == STM32VL_CORE_ID 
             || sl->chip_id == STM32_CHIPID_F3
+            || sl->chip_id == STM32_CHIPID_F3_SMALL
             || sl->chip_id == STM32_CHIPID_F303_HIGH
             || sl->chip_id == STM32_CHIPID_F37x
             || sl->chip_id == STM32_CHIPID_F334) {
@@ -1879,6 +1881,7 @@ int stlink_write_flash(stlink_t *sl, stm32_addr_t addr, uint8_t* base, uint32_t
     } else if (sl->core_id == STM32VL_CORE_ID ||
                 sl->core_id == STM32F0_CORE_ID ||
                 sl->chip_id == STM32_CHIPID_F3  ||
+                sl->chip_id == STM32_CHIPID_F3_SMALL  ||
                 sl->chip_id == STM32_CHIPID_F303_HIGH ||
                 sl->chip_id == STM32_CHIPID_F334 ||
                 sl->chip_id == STM32_CHIPID_F37x) {
@@ -1989,6 +1992,7 @@ int run_flash_loader(stlink_t *sl, flash_loader_t* fl, stm32_addr_t target, cons
     } else if (sl->core_id == STM32VL_CORE_ID ||
                 sl->core_id == STM32F0_CORE_ID ||
                 sl->chip_id == STM32_CHIPID_F3 ||
+                sl->chip_id == STM32_CHIPID_F3_SMALL ||
                 sl->chip_id == STM32_CHIPID_F303_HIGH ||
                 sl->chip_id == STM32_CHIPID_F37x ||
                 sl->chip_id == STM32_CHIPID_F334) {
@@ -2057,6 +2061,7 @@ int run_flash_loader(stlink_t *sl, flash_loader_t* fl, stm32_addr_t target, cons
     } else if (sl->core_id == STM32VL_CORE_ID ||
                 sl->core_id == STM32F0_CORE_ID ||
                 sl->chip_id == STM32_CHIPID_F3 ||
+                sl->chip_id == STM32_CHIPID_F3_SMALL ||
                 sl->chip_id == STM32_CHIPID_F303_HIGH ||
                 sl->chip_id == STM32_CHIPID_F37x ||
                 sl->chip_id == STM32_CHIPID_F334) {