From faf2c54a29ca8f8e7ea948ee8910c72911ea4663 Mon Sep 17 00:00:00 2001 From: Maciej Suminski Date: Thu, 16 Apr 2020 15:25:46 +0200 Subject: [PATCH 1/2] STM32F407ZGTx: flash layout --- tools/arm_pack_manager/index.json | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/tools/arm_pack_manager/index.json b/tools/arm_pack_manager/index.json index ca99ad89bc..156a625fa8 100644 --- a/tools/arm_pack_manager/index.json +++ b/tools/arm_pack_manager/index.json @@ -363503,7 +363503,11 @@ "units": 1 } }, - "sectors": null, + "sectors": [ + [134217728, 16384], + [134283264, 65536], + [134348800, 131072] + ], "sub_family": "STM32F407", "vendor": "STMicroelectronics:13" }, From db99b1db73c79ce9c0d0b676e9084e8b3752e8a5 Mon Sep 17 00:00:00 2001 From: Maciej Suminski Date: Thu, 16 Apr 2020 15:28:06 +0200 Subject: [PATCH 2/2] OLIMEX_STM32E407_F407ZG: bootloader support This commit modifies the Vector Table Offset Register in the startup file, so it uses address coming from the user application instead of a fixed one pointing to the bootloader. This change has been already proposed for another STM32F4 board [1] to fix bootloader issues. 1. https://github.com/ARMmbed/mbed-os/issues/1666#issuecomment-386242991 --- .../TARGET_OLIMEX_STM32E407_F407ZG/system_clock.c | 3 ++- targets/targets.json | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/targets/TARGET_STM/TARGET_STM32F4/TARGET_STM32F407xG/TARGET_OLIMEX_STM32E407_F407ZG/system_clock.c b/targets/TARGET_STM/TARGET_STM32F4/TARGET_STM32F407xG/TARGET_OLIMEX_STM32E407_F407ZG/system_clock.c index 91452cf0c5..82d73a6b1b 100644 --- a/targets/TARGET_STM/TARGET_STM32F4/TARGET_STM32F407xG/TARGET_OLIMEX_STM32E407_F407ZG/system_clock.c +++ b/targets/TARGET_STM/TARGET_STM32F4/TARGET_STM32F407xG/TARGET_OLIMEX_STM32E407_F407ZG/system_clock.c @@ -31,6 +31,7 @@ #include "stm32f4xx.h" #include "mbed_error.h" +#include "nvic_addr.h" /*!< Uncomment the following line if you need to relocate your vector Table in Internal SRAM. */ @@ -94,7 +95,7 @@ void SystemInit(void) #ifdef VECT_TAB_SRAM SCB->VTOR = SRAM_BASE | VECT_TAB_OFFSET; /* Vector Table Relocation in Internal SRAM */ #else - SCB->VTOR = FLASH_BASE | VECT_TAB_OFFSET; /* Vector Table Relocation in Internal FLASH */ + SCB->VTOR = NVIC_FLASH_VECTOR_ADDRESS; /* Vector Table Relocation in Internal FLASH */ #endif } diff --git a/targets/targets.json b/targets/targets.json index e5083ee529..0feaaa6d9b 100644 --- a/targets/targets.json +++ b/targets/targets.json @@ -4092,7 +4092,8 @@ "USBDEVICE" ], "release_versions": ["5"], - "device_name": "STM32F407ZG" + "device_name": "STM32F407ZG", + "bootloader_supported": true }, "DISCO_F429ZI": { "inherits": ["FAMILY_STM32"],