Skip to content

Commit

Permalink
Add unknown chip output (#641)
Browse files Browse the repository at this point in the history
  • Loading branch information
Rüdiger Fortanier authored and xor-gate committed Oct 10, 2017
1 parent 04dc7ea commit a2a707e
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 1 deletion.
2 changes: 2 additions & 0 deletions include/stlink/chipid.h
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
11 changes: 11 additions & 0 deletions src/chipid.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
},


};
Expand Down
3 changes: 2 additions & 1 deletion src/common.c
Original file line number Diff line number Diff line change
Expand Up @@ -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...
Expand Down

0 comments on commit a2a707e

Please sign in to comment.