Permalink
Browse files

Add unknown chip output (#641)

  • Loading branch information...
1 parent 04dc7ea commit a2a707e4f75fd8aafce3fa6095dc34206c5bb801 @ruefo ruefo committed with xor-gate Oct 10, 2017
Showing with 15 additions and 1 deletion.
  1. +2 −0 include/stlink/chipid.h
  2. +11 −0 src/chipid.c
  3. +2 −1 src/common.c
View
@@ -11,6 +11,8 @@ extern "C" {
* stm32 chipids, only lower 12 bits..
*/
enum stlink_stm32_chipids {
+ STLINK_CHIPID_UNKNOWN = 0x000,
+
STLINK_CHIPID_STM32_F1_MEDIUM = 0x410,
STLINK_CHIPID_STM32_F2 = 0x411,
STLINK_CHIPID_STM32_F1_LOW = 0x412,
View
@@ -484,6 +484,17 @@ static const struct stlink_chipid_params devices[] = {
.bootrom_base = 0x1ff00000,
.bootrom_size = 0x2000
},
+ {
+ // unknown
+ .chip_id = STLINK_CHIPID_UNKNOWN,
+ .description = "unknown device",
+ .flash_type = STLINK_FLASH_TYPE_UNKNOWN,
+ .flash_size_reg = 0x0,
+ .flash_pagesize = 0x0,
+ .sram_size = 0x0,
+ .bootrom_base = 0x0,
+ .bootrom_size = 0x0
+ },
};
View
@@ -644,7 +644,8 @@ int stlink_load_device_params(stlink_t *sl) {
if (params->flash_type == STLINK_FLASH_TYPE_UNKNOWN) {
WLOG("Invalid flash type, please check device declaration\n");
- return -1;
+ sl->flash_size = 0;
+ return 0;
}
// These are fixed...

0 comments on commit a2a707e

Please sign in to comment.