Skip to content

Commit

Permalink
add dual bank flash configuration info to chipid database.
Browse files Browse the repository at this point in the history
add a 'has_dual_bank' info to flash param, helping handling a couple of cases
 - selecting over dual bank specific code path without handling multiple chip id all over the code.
 - handling dual bank mode dynamic configuration
  • Loading branch information
grevaillot committed Apr 6, 2020
1 parent 89fa734 commit 46bf0ab
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 0 deletions.
2 changes: 2 additions & 0 deletions include/stlink.h
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,8 @@ typedef struct flash_loader {
int serial_size;

enum stlink_flash_type flash_type; // stlink_chipid_params.flash_type, set by stlink_load_device_params(), values: STLINK_FLASH_TYPE_xxx
bool has_dual_bank;

stm32_addr_t flash_base; // STM32_FLASH_BASE, set by stlink_load_device_params()
size_t flash_size; // calculated by stlink_load_device_params()
size_t flash_pgsz; // stlink_chipid_params.flash_pagesize, set by stlink_load_device_params()
Expand Down
1 change: 1 addition & 0 deletions include/stlink/chipid.h
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ struct stlink_chipid_params {
uint32_t chip_id;
char *description;
enum stlink_flash_type flash_type;
bool has_dual_bank;
uint32_t flash_size_reg;
uint32_t flash_pagesize;
uint32_t sram_size;
Expand Down
2 changes: 2 additions & 0 deletions src/common.c
Original file line number Diff line number Diff line change
Expand Up @@ -885,7 +885,9 @@ int stlink_load_device_params(stlink_t *sl) {
} else {
sl->flash_size = flash_size * 1024;
}

sl->flash_type = params->flash_type;
sl->has_dual_bank = params->has_dual_bank;
sl->flash_pgsz = params->flash_pagesize;
sl->sram_size = params->sram_size;
sl->sys_base = params->bootrom_base;
Expand Down

0 comments on commit 46bf0ab

Please sign in to comment.