Skip to content

Commit

Permalink
Added support for STM32G4 chips (#822)
Browse files Browse the repository at this point in the history
  • Loading branch information
Nightwalker-87 committed Feb 20, 2020
2 parents 1de2e4b + 8c8285f commit dfd8512
Show file tree
Hide file tree
Showing 4 changed files with 131 additions and 83 deletions.
1 change: 1 addition & 0 deletions include/stlink.h
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@ extern "C" {
STLINK_FLASH_TYPE_L4,
STLINK_FLASH_TYPE_F1_XL,
STLINK_FLASH_TYPE_G0,
STLINK_FLASH_TYPE_G4,
STLINK_FLASH_TYPE_WB
};

Expand Down
2 changes: 2 additions & 0 deletions include/stlink/chipid.h
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,8 @@ enum stlink_stm32_chipids {
STLINK_CHIPID_STM32_F413 = 0x463,
STLINK_CHIPID_STM32_L4RX = 0x470, // taken from the STM32L4R9I-DISCO board
STLINK_CHIPID_STM32_G0X1 = 0x460,
STLINK_CHIPID_STM32_G4_CAT2 = 0x468, // See: RM 0440 s46.6.1 "MCU device ID code".
STLINK_CHIPID_STM32_G4_CAT3 = 0x469,
STLINK_CHIPID_STM32_WB55 = 0x495
};

Expand Down
13 changes: 12 additions & 1 deletion src/chipid.c
Original file line number Diff line number Diff line change
Expand Up @@ -530,7 +530,18 @@ static const struct stlink_chipid_params devices[] = {
.flash_pagesize = 0x800, // 2K (sec 3.2)
.sram_size = 0x9000, // 36K (sec 2.3)
.bootrom_base = 0x1fff0000,
.bootrom_size = 0x7800 // 30K (table 2)
.bootrom_size = 0x7000 // 28K (table 2)
},
{
// STM32G431/441 (from RM0440)
.chip_id = STLINK_CHIPID_STM32_G4_CAT2,
.description = "G4 Category-2 device",
.flash_type = STLINK_FLASH_TYPE_G4,
.flash_size_reg = 0x1FFF75E0, // Section 47.2
.flash_pagesize = 0x800, // 2K (sec 3.3.1)
.sram_size = 0x8000, // 32K (sec 2.4)
.bootrom_base = 0x1fff0000,
.bootrom_size = 0x7000 // 28K (table 2)
},
{
// STM32WB55 (from RM0434)
Expand Down

0 comments on commit dfd8512

Please sign in to comment.