Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add unknown chip dummy #641

Merged
merged 1 commit into from Oct 10, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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