Skip to content

Commit

Permalink
Add support for STM32F412 (#538)
Browse files Browse the repository at this point in the history
  • Loading branch information
Androude authored and xor-gate committed Jan 2, 2017
1 parent 980962d commit 01b9e16
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 1 deletion.
1 change: 1 addition & 0 deletions include/stlink/chipid.h
Expand Up @@ -46,6 +46,7 @@ enum stlink_stm32_chipids {
STLINK_CHIPID_STM32_F334 = 0x438,
STLINK_CHIPID_STM32_F3_SMALL = 0x439,
STLINK_CHIPID_STM32_F0 = 0x440,
STLINK_CHIPID_STM32_F412 = 0x441,
STLINK_CHIPID_STM32_F09X = 0x442,
STLINK_CHIPID_STM32_F0_SMALL = 0x444,
STLINK_CHIPID_STM32_F04 = 0x445,
Expand Down
14 changes: 13 additions & 1 deletion src/chipid.c
Expand Up @@ -286,7 +286,19 @@ static const struct stlink_chipid_params devices[] = {
.bootrom_base = 0x1fffec00, // "System memory" starting address from Table 2
.bootrom_size = 0xC00 // "System memory" byte size in hex from Table 2
},
{
{
// RM0402 document was used to find these parameters
// Table 4.
.chip_id = STLINK_CHIPID_STM32_F412,
.description = "F4 device",
.flash_type = STLINK_FLASH_TYPE_F4,
.flash_size_reg = 0x1FFF7A22, // "Flash size data register" (pg1135)
.flash_pagesize = 0x4000, // Table 5. Flash module organization ?
.sram_size = 0x40000, // "SRAM" byte size in hex from Table 4
.bootrom_base = 0x1FFF0000, // "System memory" starting address from Table 4
.bootrom_size = 0x7800 // "System memory" byte size in hex from Table 4
},
{
.chip_id = STLINK_CHIPID_STM32_F09X,
.description = "F09X device",
.flash_type = STLINK_FLASH_TYPE_F0,
Expand Down
1 change: 1 addition & 0 deletions src/flash_loader.c
Expand Up @@ -218,6 +218,7 @@ int stlink_flash_loader_write_to_sram(stlink_t *sl, stm32_addr_t* addr, size_t*
sl->chip_id == STLINK_CHIPID_STM32_F4_DSI ||
sl->chip_id == STLINK_CHIPID_STM32_F410 ||
sl->chip_id == STLINK_CHIPID_STM32_F411RE ||
sl->chip_id == STLINK_CHIPID_STM32_F412 ||
sl->chip_id == STLINK_CHIPID_STM32_F446
) {
if( sl->version.stlink_v == 1 ) {
Expand Down

0 comments on commit 01b9e16

Please sign in to comment.