Skip to content

Commit

Permalink
Merge pull request #1062 from timothytylee/STM32F4-option_bytes
Browse files Browse the repository at this point in the history
[feature] Support for STM32F4 option bytes
  • Loading branch information
Nightwalker-87 committed Nov 11, 2020
2 parents 835b496 + e5dcb50 commit 1dff591
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 1 deletion.
1 change: 1 addition & 0 deletions inc/stm32.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
#define STM32_F2_OPTION_BYTES_BASE ((uint32_t)0x1FFFC000)
#define STM32_L4_OPTION_BYTES_BASE ((uint32_t)0x1FFF7800)
#define STM32_L1_OPTION_BYTES_BASE ((uint32_t)0x1FF80000)
#define STM32_F4_OPTION_BYTES_BASE ((uint32_t)0x40023C14)
#define STM32_F7_OPTION_BYTES_BASE ((uint32_t)0x1FFF0000)
#define STM32_H7_OPTION_BYTES_BASE ((uint32_t)0x5200201C)

Expand Down
1 change: 1 addition & 0 deletions src/common.c
Original file line number Diff line number Diff line change
Expand Up @@ -3680,6 +3680,7 @@ int stlink_read_option_bytes32(stlink_t *sl, uint32_t* option_byte) {
switch (sl->chip_id) {
case STLINK_CHIPID_STM32_F2:
return stlink_read_option_bytes_f2(sl, option_byte);
case STLINK_CHIPID_STM32_F4:
case STLINK_CHIPID_STM32_F446:
return stlink_read_option_bytes_f4(sl, option_byte);
case STLINK_CHIPID_STM32_F7XXXX:
Expand Down
4 changes: 3 additions & 1 deletion src/stlink-lib/chipid.c
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,9 @@ static const struct stlink_chipid_params devices[] = {
.flash_pagesize = 0x4000,
.sram_size = 0x30000,
.bootrom_base = 0x1fff0000,
.bootrom_size = 0x7800
.bootrom_size = 0x7800,
.option_base = STM32_F4_OPTION_BYTES_BASE,
.option_size = 4,
},
{
.chip_id = STLINK_CHIPID_STM32_F4_DSI,
Expand Down

0 comments on commit 1dff591

Please sign in to comment.