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 support for STM32G4 chips #822

Closed
wants to merge 7 commits into from
Closed
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
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
Loading