From 3daa3f15cc5f3fe6f33f4bc33b3b61dbcc0c6ce7 Mon Sep 17 00:00:00 2001 From: Jerry Jacobs Date: Sat, 18 Jun 2016 09:41:32 +0200 Subject: [PATCH 1/3] Initial support for STM32F7x7x, for nucleo-144, STM32F767ZI issue #433 --- include/stlink/chipid.h | 1 + src/chipid.c | 11 +++++++++++ 2 files changed, 12 insertions(+) diff --git a/include/stlink/chipid.h b/include/stlink/chipid.h index a5012e3..72094a7 100644 --- a/include/stlink/chipid.h +++ b/include/stlink/chipid.h @@ -52,6 +52,7 @@ enum stlink_stm32_chipids { STLINK_CHIPID_STM32_L0_CAT5 = 0x447, STLINK_CHIPID_STM32_F0_CAN = 0x448, STLINK_CHIPID_STM32_F7 = 0x449, + STLINK_CHIPID_STM32_F7XXXX = 0x451, STLINK_CHIPID_STM32_F410 = 0x458 }; diff --git a/src/chipid.c b/src/chipid.c index c3f1a92..546e238 100644 --- a/src/chipid.c +++ b/src/chipid.c @@ -2,6 +2,17 @@ #include "stlink/chipid.h" static const struct stlink_chipid_params devices[] = { + { + //RM0410 document was used to find these paramaters + .chip_id = STLINK_CHIPID_STM32_F7XXXX, + .description = "F76xxx device", + .flash_type = STLINK_FLASH_TYPE_F4, + .flash_size_reg = 0x1ff0f442, // section 45.2 + .flash_pagesize = 0x800, // No flash pages + .sram_size = 0x5C000, // "SRAM" byte size in hex from + .bootrom_base = 0x00200000, //! "System memory" starting address from + .bootrom_size = 0xEDC0 //! @todo "System memory" byte size in hex from + }, { //RM0385 and DS10916 document was used to find these paramaters .chip_id = STLINK_CHIPID_STM32_F7, From dfeb5a4e6f253a586543e7f72753ab96391dce2c Mon Sep 17 00:00:00 2001 From: Jerry Jacobs Date: Sat, 18 Jun 2016 19:40:27 +0200 Subject: [PATCH 2/3] flash_loader.c: Add STLINK_CHIPID_STM32_F7XXXX --- src/flash_loader.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/flash_loader.c b/src/flash_loader.c index 6ea3244..2e237c4 100644 --- a/src/flash_loader.c +++ b/src/flash_loader.c @@ -231,7 +231,8 @@ int stlink_flash_loader_write_to_sram(stlink_t *sl, stm32_addr_t* addr, size_t* loader_code = loader_code_stm32f4_lv; loader_size = sizeof(loader_code_stm32f4_lv); } - } else if (sl->chip_id == STLINK_CHIPID_STM32_F7){ + } else if (sl->chip_id == STLINK_CHIPID_STM32_F7 || + sl->chip_id == STLINK_CHIPID_STM32_F7XXXX) { loader_code = loader_code_stm32f7; loader_size = sizeof(loader_code_stm32f7); } else if (sl->chip_id == STLINK_CHIPID_STM32_F0 || sl->chip_id == STLINK_CHIPID_STM32_F04 || sl->chip_id == STLINK_CHIPID_STM32_F0_CAN || sl->chip_id == STLINK_CHIPID_STM32_F0_SMALL || sl->chip_id == STLINK_CHIPID_STM32_F09X) { From 5a06869797992f3892c276a7163dedb679a8a5ea Mon Sep 17 00:00:00 2001 From: Jerry Jacobs Date: Sat, 18 Jun 2016 19:53:31 +0200 Subject: [PATCH 3/3] Add flash loader core id and chipid for STM32F767ZI with nucleo-144 --- include/stlink.h | 1 + src/flash_loader.c | 7 ++++--- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/include/stlink.h b/include/stlink.h index c930862..d1bf481 100644 --- a/include/stlink.h +++ b/include/stlink.h @@ -51,6 +51,7 @@ extern "C" { /* cortex core ids */ // TODO clean this up... #define STM32VL_CORE_ID 0x1ba01477 +#define STM32F7_CORE_ID 0x5ba02477 // Constant STM32 memory map figures #define STM32_FLASH_BASE 0x08000000 diff --git a/src/flash_loader.c b/src/flash_loader.c index 2e237c4..eee9618 100644 --- a/src/flash_loader.c +++ b/src/flash_loader.c @@ -202,7 +202,7 @@ int stlink_flash_loader_write_to_sram(stlink_t *sl, stm32_addr_t* addr, size_t* || sl->chip_id == STLINK_CHIPID_STM32_L0 || sl->chip_id == STLINK_CHIPID_STM32_L0_CAT5 || sl->chip_id == STLINK_CHIPID_STM32_L0_CAT2) { /* stm32l */ loader_code = loader_code_stm32l; loader_size = sizeof(loader_code_stm32l); - } else if (sl->core_id == STM32VL_CORE_ID + } else if (sl->core_id == STM32VL_CORE_ID || sl->chip_id == STLINK_CHIPID_STM32_F3 || sl->chip_id == STLINK_CHIPID_STM32_F3_SMALL || sl->chip_id == STLINK_CHIPID_STM32_F303_HIGH @@ -231,7 +231,8 @@ int stlink_flash_loader_write_to_sram(stlink_t *sl, stm32_addr_t* addr, size_t* loader_code = loader_code_stm32f4_lv; loader_size = sizeof(loader_code_stm32f4_lv); } - } else if (sl->chip_id == STLINK_CHIPID_STM32_F7 || + } else if (sl->core_id == STM32F7_CORE_ID || + sl->chip_id == STLINK_CHIPID_STM32_F7 || sl->chip_id == STLINK_CHIPID_STM32_F7XXXX) { loader_code = loader_code_stm32f7; loader_size = sizeof(loader_code_stm32f7); @@ -242,7 +243,7 @@ int stlink_flash_loader_write_to_sram(stlink_t *sl, stm32_addr_t* addr, size_t* loader_code = loader_code_stm32l4; loader_size = sizeof(loader_code_stm32l4); } else { - ELOG("unknown coreid, not sure what flash loader to use, aborting!: %x\n", sl->core_id); + ELOG("unknown coreid, not sure what flash loader to use, aborting! coreid: %x, chipid: %x\n", sl->core_id, sl->chip_id); return -1; }