diff --git a/docs/PORT_TARGET_FAMILY.md b/docs/PORT_TARGET_FAMILY.md index e31c20f09b..ec238e6920 100644 --- a/docs/PORT_TARGET_FAMILY.md +++ b/docs/PORT_TARGET_FAMILY.md @@ -1,5 +1,5 @@ # Adding A New Target Family -Adding new target support requires creating a flash algo blob and the implementation for some stub functions. Target support is added to the `source/family//` directory. At minimum, 3 files are needed. The first is `source/target//target_reset.c` +Adding new target family support requires creating a flash algo blob and the implementation for target family api. Target support is added to the `source/family//` directory. At minimum, 3 files are needed. The first is `source/target//target_reset.c` ```c /** @@ -25,30 +25,29 @@ Adding new target support requires creating a flash algo blob and the implementa #include "target_reset.h" #include "swd_host.h" +#include "target_family.h" -void target_before_init_debug(void) +static void target_before_init_debug(void) { // any target specific sequences needed before attaching // to the DAP across JTAG or SWD return; } -uint8_t target_unlock_sequence(void) +static uint8_t target_unlock_sequence(void) { // if the device can secure the flash and there is a way to // erase all it should be implemented here. return 1; } -uint8_t target_set_state(TARGET_RESET_STATE state) +static uint8_t target_set_state(TARGET_RESET_STATE state) { - // invoke reset by sw (VECT_REQ or SYS_REQ) or hw (hardware IO toggle) - //return swd_set_target_state_sw(state); - //or - return swd_set_target_state_hw(state); + // if a custom state machine is needed to set the TARGET_RESET_STATE state + return 1; } -uint8_t security_bits_set(uint32_t addr, uint8_t *data, uint32_t size) +static uint8_t security_bits_set(uint32_t addr, uint8_t *data, uint32_t size) { // if there are security bits in the programmable flash region // a check should be performed. This method is used when programming @@ -57,6 +56,114 @@ uint8_t security_bits_set(uint32_t addr, uint8_t *data, uint32_t size) // if needed. return 0; } + +const target_family_descriptor_t g_target_family = { + .family_id = myFamilyID, + .default_reset_type = kHardwareReset, + .target_before_init_debug = target_before_init_debug, + .target_unlock_sequence = target_unlock_sequence, + .target_set_state = target_set_state, + .security_bits_set = security_bits_set, +}; +``` + +The target family api is located in `source/target/target_family.h` and target_reset file can customize the function apis according to the family specification. Family id is a combination of vendor id and an incrementing id. There are predefined family id stubs that can be used for generic reset types; kStub_HWReset_FamilyID, kStub_SWVectReset_FamilyID and kStub_SWSysReset_FamilyID. + +```c +/** + * @file target_family.h + * @brief + * + * DAPLink Interface Firmware + * Copyright (c) 2018-2019, ARM Limited, All Rights Reserved + * SPDX-License-Identifier: Apache-2.0 + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may + * not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef TARGET_FAMILY_H +#define TARGET_FAMILY_H + +#include +#include +#include "target_reset.h" + +#define VENDOR_TO_FAMILY(x, y) (x<<8 | y) + +typedef enum _reset_type { + kHardwareReset=1, + kSoftwareReset, +} reset_type_t; + +enum _vendor_ids { + kStub_VendorID = 0, + kNXP_VendorID = 11, + kTI_VendorID = 16, + kNordic_VendorID = 54, + kToshiba_VendorID = 92, + kRenesas_VendorID = 117, + kWiznet_VendorID = 122, + kRealtek_VendorID = 124, +}; + +typedef enum _family_id { + kStub_HWReset_FamilyID = VENDOR_TO_FAMILY(kStub_VendorID, 1), + kStub_SWVectReset_FamilyID = VENDOR_TO_FAMILY(kStub_VendorID, 2), + kStub_SWSysReset_FamilyID = VENDOR_TO_FAMILY(kStub_VendorID, 3), + kNXP_KinetisK_FamilyID = VENDOR_TO_FAMILY(kNXP_VendorID, 1), + kNXP_KinetisL_FamilyID = VENDOR_TO_FAMILY(kNXP_VendorID, 2), + kNXP_Mimxrt_FamilyID = VENDOR_TO_FAMILY(kNXP_VendorID, 3), + kNXP_RapidIot_FamilyID = VENDOR_TO_FAMILY(kNXP_VendorID, 4), + kNXP_KinetisK32W_FamilyID = VENDOR_TO_FAMILY(kNXP_VendorID, 5), + kNordic_Nrf51_FamilyID = VENDOR_TO_FAMILY(kNordic_VendorID, 1), + kNordic_Nrf52_FamilyID = VENDOR_TO_FAMILY(kNordic_VendorID, 2), + kRealtek_Rtl8195am_FamilyID = VENDOR_TO_FAMILY(kRealtek_VendorID, 1), + kTI_Cc3220sf_FamilyID = VENDOR_TO_FAMILY(kTI_VendorID, 1), + kToshiba_Tz_FamilyID = VENDOR_TO_FAMILY(kToshiba_VendorID, 1), + kWiznet_W7500_FamilyID = VENDOR_TO_FAMILY(kWiznet_VendorID, 1), + kRenesas_FamilyID = VENDOR_TO_FAMILY(kRenesas_VendorID, 1), +} family_id_t; + +typedef struct target_family_descriptor { + uint16_t family_id; /*!< Use to select or identify target family from defined target family or custom ones */ + reset_type_t default_reset_type; /*!< Target family can select predefined reset from kHardwareReset and kSoftwareReset */ + uint32_t soft_reset_type; /*!< Families can override software reset type to VECTRESET or SYSRESETREQ */ + void (*target_before_init_debug)(void); /*!< Target dependant function before debug initialization */ + void (*prerun_target_config)(void); /*!< Target specific initialization */ + uint8_t (*target_unlock_sequence)(void); /*!< Unlock targets that can enter lock state */ + uint8_t (*security_bits_set)(uint32_t addr, uint8_t *data, uint32_t size); /*!< Check security bits in the programmable flash region */ + uint8_t (*target_set_state)(TARGET_RESET_STATE state); /*!< Families can customize target debug states in target_reset.h */ + void (*swd_set_target_reset)(uint8_t asserted); /*!< Families can customize how to send reset to the target */ + uint8_t (*validate_bin_nvic)(const uint8_t *buf); /*!< Validate a bin file to be flash by drag and drop */ + uint8_t (*validate_hexfile)(const uint8_t *buf); /*!< Validate a hex file to be flash by drag and drop */ +} target_family_descriptor_t; + +extern const target_family_descriptor_t *g_target_family; + +#ifdef __cplusplus +extern "C" { +#endif + +void init_family(void); +uint8_t target_family_valid(void); +uint8_t target_set_state(TARGET_RESET_STATE state); +void swd_set_target_reset(uint8_t asserted); + +#ifdef __cplusplus +} +#endif + +#endif ``` A flash algorithm blob is needed to program the target MCUs internal (or external) flash memory. This blob contains position independent functions for erasing, reading and writing to the flash controller. Flash algorithm blobs are created from the [FlashAlgo project.](https://github.com/mbedmicro/FlashAlgo) An example blob is shown below and would be added to `source/family///flash_blob.c` @@ -110,6 +217,17 @@ static const uint32_t targetname_blob[] = { 0x0105f021, 0x20006081, 0x00004770, 0x400c0000, 0x00000000, }; +/** +* List of start and size for each size of flash sector +* The size will apply to all sectors between the listed address and the next address +* in the list. +* The last pair in the list will have sectors starting at that address and ending +* at address start + size. +*/ +static const sector_info_t sectors_info[] = { + {0x00000000, 0x00001000}, + }; + static const program_target_t flash = { 0x200000B5, // Init 0x2000029D, // UnInit @@ -164,42 +282,49 @@ The last required file is the target MCU description file `source/family//< // The file flash_blob.c must only be included in target.c #include "flash_blob.c" -// target information target_cfg_t target_device = { - .sector_size = 4096, - .sector_cnt = (MB(1) / 4096), - .flash_start = 0, - .flash_end = MB(1), - .ram_start = 0x20000000, - .ram_end = 0x20010000, - .flash_algo = (program_target_t *) &flash, + .sectors_info = sectors_info, + .sector_info_length = (sizeof(sectors_info))/(sizeof(sector_info_t)), + .flash_regions[0].start = 0x00000000, + .flash_regions[0].end = 0x00200000, + .flash_regions[0].flags = kRegionIsDefault, + .flash_regions[0].flash_algo = (program_target_t *) &flash, + .ram_regions[0].start = 0x1fff0000, + .ram_regions[0].end = 0x20030000, }; ``` -At this point these target specific files could be added to a board build and developed. - -Complete target configuration api is located in `source/hic_hal_target_config.h` +Complete target configuration api is located in `source/target/target_config.h` ```c +enum _region_flags { + kRegionIsDefault = (1 << 0), //out of bounds regions will use the same flash algo if this is set + kRegionIsSecure = (1 << 1) +}; + + +typedef struct region_info { + uint32_t start; + uint32_t end; + uint32_t flags; + uint8_t alias_index; /*!flash_start) && !config_ram_get_initial_hold_in_bl()) { + if (!gpio_get_reset_btn() && g_board_info.target_cfg && validate_bin_nvic((uint8_t *)g_board_info.target_cfg->flash_regions[0].start) && !config_ram_get_initial_hold_in_bl()) { // change to the new vector table - SCB->VTOR = g_board_info.target_cfg->flash_start; + SCB->VTOR = g_board_info.target_cfg->flash_regions[0].start; //bootloaders should only have one flash region for interface // modify stack pointer and start app - modify_stack_pointer_and_start_app((*(uint32_t *)(g_board_info.target_cfg->flash_start)), (*(uint32_t *)(g_board_info.target_cfg->flash_start + 4))); + modify_stack_pointer_and_start_app((*(uint32_t *)(g_board_info.target_cfg->flash_regions[0].start)), (*(uint32_t *)(g_board_info.target_cfg->flash_regions[0].start + 4))); } // config the usb interface descriptor and web auth token before USB connects diff --git a/source/daplink/drag-n-drop/flash_decoder.c b/source/daplink/drag-n-drop/flash_decoder.c index 50b4d79f7d..fdfc813b51 100644 --- a/source/daplink/drag-n-drop/flash_decoder.c +++ b/source/daplink/drag-n-drop/flash_decoder.c @@ -143,7 +143,13 @@ error_t flash_decoder_get_flash(flash_decoder_type_t type, uint32_t addr, bool a } } else if (FLASH_DECODER_TYPE_TARGET == type) { if (g_board_info.target_cfg) { - flash_start_local = g_board_info.target_cfg->flash_start; + region_info_t * region = g_board_info.target_cfg->flash_regions; + for (; region->start != 0 || region->end != 0; ++region) { + if (addr >= region->start && addr <= region->end) { + flash_start_local = region->start; + break; + } + } flash_intf_local = flash_intf_target; } else { status = ERROR_FD_UNSUPPORTED_UPDATE; @@ -337,7 +343,7 @@ error_t flash_decoder_close(void) static bool flash_decoder_is_at_end(uint32_t addr, const uint8_t *data, uint32_t size) { - uint32_t end_addr; + uint32_t end_addr=0; switch (flash_type) { case FLASH_DECODER_TYPE_BOOTLOADER: @@ -351,7 +357,17 @@ static bool flash_decoder_is_at_end(uint32_t addr, const uint8_t *data, uint32_t case FLASH_DECODER_TYPE_TARGET: //only if we are sure it is a bin for the target; without check unordered hex files will cause to terminate flashing if (flash_type_target_bin && g_board_info.target_cfg) { - end_addr = g_board_info.target_cfg->flash_end; + region_info_t * region = g_board_info.target_cfg->flash_regions; + for (; region->start != 0 || region->end != 0; ++region) { + if (addr >= region->start && addr<=region->end) { + end_addr = region->end; + break; + } + } + if(end_addr == 0){ //invalid end_addr + return false; + } + } else { return false; diff --git a/source/daplink/interface/target_flash.c b/source/daplink/interface/target_flash.c index cc4bfb105a..14066a2d7d 100644 --- a/source/daplink/interface/target_flash.c +++ b/source/daplink/interface/target_flash.c @@ -70,14 +70,17 @@ static flash_func_t last_flash_func = FLASH_FUNC_NOP; //saved flash algo static program_target_t * current_flash_algo = NULL; +//saved default region for default flash algo +static region_info_t * default_region = NULL; + //saved flash start from flash algo static uint32_t flash_start = 0; static program_target_t * get_flash_algo(uint32_t addr) { - flash_region_info_t * flash_region = g_board_info.target_cfg->extra_flash; + region_info_t * flash_region = g_board_info.target_cfg->flash_regions; - for (; flash_region->start != 0 && flash_region->end != 0; ++flash_region) { + for (; flash_region->start != 0 || flash_region->end != 0; ++flash_region) { if (addr >= flash_region->start && addr <= flash_region->end) { flash_start = flash_region->start; //save the flash start if (flash_region->flash_algo) { @@ -89,8 +92,12 @@ static program_target_t * get_flash_algo(uint32_t addr) } //could not find a flash algo for the region; use default - flash_start = g_board_info.target_cfg->flash_start; - return g_board_info.target_cfg->flash_algo; + if (default_region) { + flash_start = default_region->start; + return default_region->flash_algo; + } else { + return NULL; + } } static error_t flash_func_start(flash_func_t func) @@ -150,6 +157,15 @@ static error_t target_flash_init() if (0 == target_set_state(RESET_PROGRAM)) { return ERROR_RESET; } + + //get default region + region_info_t * flash_region = g_board_info.target_cfg->flash_regions; + for (; flash_region->start != 0 || flash_region->end != 0; ++flash_region) { + if (flash_region->flags & kRegionIsDefault) { + default_region = flash_region; + break; + } + } state = STATE_OPEN; return ERROR_SUCCESS; @@ -307,39 +323,21 @@ static error_t target_flash_erase_chip(void) { if (g_board_info.target_cfg){ error_t status = ERROR_SUCCESS; - program_target_t * flash; - flash_region_info_t * flash_region = g_board_info.target_cfg->extra_flash; - - if (current_flash_algo != g_board_info.target_cfg->flash_algo) { - //set the initial flash algo - error_t status = target_flash_set(g_board_info.target_cfg->flash_start); + region_info_t * flash_region = g_board_info.target_cfg->flash_regions; + + for (; flash_region->start != 0 || flash_region->end != 0; ++flash_region) { + status = target_flash_set(flash_region->start); if (status != ERROR_SUCCESS) { return status; } - } - - do { - flash = current_flash_algo; status = flash_func_start(FLASH_FUNC_ERASE); if (status != ERROR_SUCCESS) { return status; } - if (0 == swd_flash_syscall_exec(&flash->sys_call_s, flash->erase_chip, 0, 0, 0, 0)) { + if (0 == swd_flash_syscall_exec(¤t_flash_algo->sys_call_s, current_flash_algo->erase_chip, 0, 0, 0, 0)) { return ERROR_ERASE_ALL; } - - while (flash_region->start != 0 && flash_region->end != 0) { - if (flash_region->flash_algo) { - status = target_flash_set(flash_region->start); - if (status != ERROR_SUCCESS) { - return status; - } - flash_region++; - break; - } - flash_region++; - } - } while (flash != current_flash_algo); //call erase on the next flash algo + } // Reset and re-initialize the target after the erase if required if (g_board_info.target_cfg->erase_reset) { @@ -376,7 +374,9 @@ static uint32_t target_flash_erase_sector_size(uint32_t addr) } } } - return g_board_info.target_cfg->sector_size; + //sector information should be in sector_info + util_assert(0); + return 0; } else { return 0; } diff --git a/source/daplink/validation.c b/source/daplink/validation.c index 5ab521f902..1f8493ed60 100644 --- a/source/daplink/validation.c +++ b/source/daplink/validation.c @@ -36,39 +36,38 @@ uint8_t validate_bin_nvic(const uint8_t *buf) return g_target_family && g_target_family->validate_bin_nvic(buf); } else if (g_board_info.target_cfg) { uint32_t i = 4, nvic_val = 0; - uint8_t index = 0, in_range = 0; + uint8_t in_range = 0; // test the initial SP value memcpy(&nvic_val, buf + 0, sizeof(nvic_val)); - if (0 == test_range(nvic_val, g_board_info.target_cfg->ram_start, g_board_info.target_cfg->ram_end)) { - while (!(g_board_info.target_cfg->extra_ram[index].start == 0 && g_board_info.target_cfg->extra_ram[index].end == 0)) { //try additional reqions if present - if (1 == test_range(nvic_val, g_board_info.target_cfg->extra_ram[index].start, g_board_info.target_cfg->extra_ram[index].end)) { - in_range = 1; - break; - } - index++; - } - if (in_range == 0) { - return 0; + + region_info_t * region = g_board_info.target_cfg->ram_regions; + for (; region->start != 0 || region->end != 0; ++region) { + if (1 == test_range(nvic_val, region->start, region->end)) { + in_range = 1; + break; } - } + } + + if (in_range == 0) { + return 0; + } + // Reset_Handler // NMI_Handler // HardFault_Handler for (; i <= 12; i += 4) { + in_range = 0; memcpy(&nvic_val, buf + i, sizeof(nvic_val)); - if (0 == test_range(nvic_val, g_board_info.target_cfg->flash_start, g_board_info.target_cfg->flash_end)) { - index = 0, in_range = 0; - while (!(g_board_info.target_cfg->extra_flash[index].start == 0 && g_board_info.target_cfg->extra_flash[index].end == 0)) { //try additional reqions if present - if (1 == test_range(nvic_val, g_board_info.target_cfg->extra_flash[index].start, g_board_info.target_cfg->extra_flash[index].end)) { - in_range = 1; - break; - } - index++; - } - if (in_range == 0) { - return 0; + region_info_t * region = g_board_info.target_cfg->flash_regions; + for (; region->start != 0 || region->end != 0; ++region) { + if (1 == test_range(nvic_val, region->start, region->end)) { + in_range = 1; + break; } } + if (in_range == 0) { + return 0; + } } return 1; diff --git a/source/family/freescale/k20dx/flash_blob.c b/source/family/freescale/k20dx/flash_blob.c index f73b17d778..cfda9cfb56 100644 --- a/source/family/freescale/k20dx/flash_blob.c +++ b/source/family/freescale/k20dx/flash_blob.c @@ -3,7 +3,7 @@ * @brief Flash algorithm for the k20dx * * DAPLink Interface Firmware - * Copyright (c) 2009-2016, ARM Limited, All Rights Reserved + * Copyright (c) 2009-2019, ARM Limited, All Rights Reserved * SPDX-License-Identifier: Apache-2.0 * * Licensed under the Apache License, Version 2.0 (the "License"); you may @@ -51,6 +51,17 @@ static const uint32_t K20D50M_FLM[] = { 0x40020004, 0x00000000, }; +/** +* List of start and size for each size of flash sector +* The size will apply to all sectors between the listed address and the next address +* in the list. +* The last pair in the list will have sectors starting at that address and ending +* at address start + size. +*/ +static const sector_info_t sectors_info[] = { + {0, 1024}, + }; + static const program_target_t flash = { 0x20000021, // Init 0x20000049, // UnInit diff --git a/source/family/freescale/k20dx/target.c b/source/family/freescale/k20dx/target.c index 47515dbfce..4442166c9a 100644 --- a/source/family/freescale/k20dx/target.c +++ b/source/family/freescale/k20dx/target.c @@ -3,7 +3,7 @@ * @brief Target information for the k20dx * * DAPLink Interface Firmware - * Copyright (c) 2009-2016, ARM Limited, All Rights Reserved + * Copyright (c) 2009-2019, ARM Limited, All Rights Reserved * SPDX-License-Identifier: Apache-2.0 * * Licensed under the Apache License, Version 2.0 (the "License"); you may @@ -26,11 +26,12 @@ // target information target_cfg_t target_device = { - .sector_size = 1024, - .sector_cnt = (KB(128) / 1024), - .flash_start = 0, - .flash_end = KB(128), - .ram_start = 0x1FFF8000, - .ram_end = 0x20008000, - .flash_algo = (program_target_t *) &flash, + .sectors_info = sectors_info, + .sector_info_length = (sizeof(sectors_info))/(sizeof(sector_info_t)), + .flash_regions[0].start = 0, + .flash_regions[0].end = KB(128), + .flash_regions[0].flags = kRegionIsDefault, + .flash_regions[0].flash_algo = (program_target_t *) &flash, + .ram_regions[0].start = 0x1FFF8000, + .ram_regions[0].end = 0x20008000, }; diff --git a/source/family/freescale/k22f/flash_blob.c b/source/family/freescale/k22f/flash_blob.c index bfbeb0c39c..5a8d00dfae 100644 --- a/source/family/freescale/k22f/flash_blob.c +++ b/source/family/freescale/k22f/flash_blob.c @@ -1,5 +1,5 @@ /* Flash OS Routines (Automagically Generated) - * Copyright (c) 2009-2015 ARM Limited + * Copyright (c) 2009-2019 ARM Limited * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -58,11 +58,11 @@ static const uint32_t flash_start = 0x00000000; static const uint32_t flash_size = 0x00080000; /** -* List of start and size for each size of flash sector - even indexes are start, odd are size +* List of start and size for each size of flash sector * The size will apply to all sectors between the listed address and the next address * in the list. * The last pair in the list will have sectors starting at that address and ending -* at address flash_start + flash_size. +* at address start + size. */ static const sector_info_t sectors_info[] = { { 0x00000000, 0x00000800 }, diff --git a/source/family/freescale/k22f/target.c b/source/family/freescale/k22f/target.c index 1a8f6ab236..d00b6ad910 100644 --- a/source/family/freescale/k22f/target.c +++ b/source/family/freescale/k22f/target.c @@ -3,7 +3,7 @@ * @brief Target information for the k22f * * DAPLink Interface Firmware - * Copyright (c) 2009-2016, ARM Limited, All Rights Reserved + * Copyright (c) 2009-2019, ARM Limited, All Rights Reserved * SPDX-License-Identifier: Apache-2.0 * * Licensed under the Apache License, Version 2.0 (the "License"); you may @@ -26,11 +26,12 @@ // target information target_cfg_t target_device = { - .sector_size = 2048, - .sector_cnt = (KB(512) / 2048), - .flash_start = 0, - .flash_end = KB(512), - .ram_start = 0x1FFF0000, - .ram_end = 0x20010000, - .flash_algo = (program_target_t *) &flash, + .sectors_info = sectors_info, + .sector_info_length = (sizeof(sectors_info))/(sizeof(sector_info_t)), + .flash_regions[0].start = 0, + .flash_regions[0].end = KB(512), + .flash_regions[0].flags = kRegionIsDefault, + .flash_regions[0].flash_algo = (program_target_t *) &flash, + .ram_regions[0].start = 0x1FFF0000, + .ram_regions[0].end = 0x20010000, }; diff --git a/source/family/freescale/k28f/flash_blob.c b/source/family/freescale/k28f/flash_blob.c index 561f630701..dbd910736b 100644 --- a/source/family/freescale/k28f/flash_blob.c +++ b/source/family/freescale/k28f/flash_blob.c @@ -3,7 +3,7 @@ * @brief Flash algorithm for the k66f * * DAPLink Interface Firmware - * Copyright (c) 2009-2016, ARM Limited, All Rights Reserved + * Copyright (c) 2009-2019, ARM Limited, All Rights Reserved * SPDX-License-Identifier: Apache-2.0 * * Licensed under the Apache License, Version 2.0 (the "License"); you may @@ -61,6 +61,17 @@ static const uint32_t mk28f15_flash_prog_blob[] = { 0x00800000, 0x01000000, 0x02000000, 0x00000000, }; +/** +* List of start and size for each size of flash sector +* The size will apply to all sectors between the listed address and the next address +* in the list. +* The last pair in the list will have sectors starting at that address and ending +* at address start + size. +*/ +static const sector_info_t sectors_info[] = { + { 0, 4096 }, +}; + static const program_target_t flash = { 0x20000021, // Init 0x20000049, // UnInit diff --git a/source/family/freescale/k28f/target.c b/source/family/freescale/k28f/target.c index 18b3e8cd9d..da950b8361 100644 --- a/source/family/freescale/k28f/target.c +++ b/source/family/freescale/k28f/target.c @@ -3,7 +3,7 @@ * @brief Target information for the k66f * * DAPLink Interface Firmware - * Copyright (c) 2009-2016, ARM Limited, All Rights Reserved + * Copyright (c) 2009-2019, ARM Limited, All Rights Reserved * SPDX-License-Identifier: Apache-2.0 * * Licensed under the Apache License, Version 2.0 (the "License"); you may @@ -26,11 +26,12 @@ // target information target_cfg_t target_device = { - .sector_size = 4096, - .sector_cnt = (MB(2) / 4096), - .flash_start = 0, - .flash_end = MB(2), - .ram_start = 0x1FFC0000, - .ram_end = 0x20040000, - .flash_algo = (program_target_t *) &flash, + .sectors_info = sectors_info, + .sector_info_length = (sizeof(sectors_info))/(sizeof(sector_info_t)), + .flash_regions[0].start = 0, + .flash_regions[0].end = MB(2), + .flash_regions[0].flags = kRegionIsDefault, + .flash_regions[0].flash_algo = (program_target_t *) &flash, + .ram_regions[0].start = 0x1FFC0000, + .ram_regions[0].end = 0x20040000, }; diff --git a/source/family/freescale/k32w042/flash_blob.c b/source/family/freescale/k32w042/flash_blob.c index 4e4e5c20fc..4047a706de 100644 --- a/source/family/freescale/k32w042/flash_blob.c +++ b/source/family/freescale/k32w042/flash_blob.c @@ -1,5 +1,5 @@ /* Flash OS Routines (Automagically Generated) - * Copyright (c) 2009-2015 ARM Limited + * Copyright (c) 2009-2019 ARM Limited * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -98,6 +98,13 @@ static const uint32_t k32w042s1m2_flash_prog_blob[] = { 0x00000000 }; +/** +* List of start and size for each size of flash sector +* The size will apply to all sectors between the listed address and the next address +* in the list. +* The last pair in the list will have sectors starting at that address and ending +* at address start + size. +*/ static const sector_info_t sectors_info[] = { {0x00000000, 0x00001000}, }; diff --git a/source/family/freescale/k32w042/target.c b/source/family/freescale/k32w042/target.c index d3958b59cd..7a97ebc7de 100644 --- a/source/family/freescale/k32w042/target.c +++ b/source/family/freescale/k32w042/target.c @@ -3,7 +3,7 @@ * @brief Target information for the k32w042 * * DAPLink Interface Firmware - * Copyright (c) 2009-2016, ARM Limited, All Rights Reserved + * Copyright (c) 2009-2019, ARM Limited, All Rights Reserved * SPDX-License-Identifier: Apache-2.0 * * Licensed under the Apache License, Version 2.0 (the "License"); you may @@ -26,11 +26,12 @@ // target information target_cfg_t target_device = { - .flash_start = 0, - .flash_end = KB(1024), - .ram_start = 0x20000000, // M4 DTCM - .ram_end = 0x20030000, - .flash_algo = (program_target_t *) &flash, - .sectors_info = sectors_info, - .sector_info_length = (sizeof(sectors_info))/(sizeof(sector_info_t)) + .sectors_info = sectors_info, + .sector_info_length = (sizeof(sectors_info))/(sizeof(sector_info_t)), + .flash_regions[0].start = 0, + .flash_regions[0].end = KB(1024), + .flash_regions[0].flags = kRegionIsDefault, + .flash_regions[0].flash_algo = (program_target_t *) &flash, + .ram_regions[0].start = 0x20000000, // M4 DTCM + .ram_regions[0].end = 0x20030000, }; diff --git a/source/family/freescale/k64f/flash_blob.c b/source/family/freescale/k64f/flash_blob.c index 29f3ff9c53..9667ee5434 100644 --- a/source/family/freescale/k64f/flash_blob.c +++ b/source/family/freescale/k64f/flash_blob.c @@ -1,5 +1,5 @@ /* Flash OS Routines (Automagically Generated) - * Copyright (c) 2009-2015 ARM Limited + * Copyright (c) 2009-2019 ARM Limited * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -66,11 +66,11 @@ static const uint32_t flash_start = 0x00000000; static const uint32_t flash_size = 0x00100000; /** -* List of start and size for each size of flash sector - even indexes are start, odd are size +* List of start and size for each size of flash sector * The size will apply to all sectors between the listed address and the next address * in the list. * The last pair in the list will have sectors starting at that address and ending -* at address flash_start + flash_size. +* at address start + size. */ static const sector_info_t sectors_info[] = { { 0x00000000, 0x00001000 }, diff --git a/source/family/freescale/k64f/target.c b/source/family/freescale/k64f/target.c index 355099ab89..458943fc42 100644 --- a/source/family/freescale/k64f/target.c +++ b/source/family/freescale/k64f/target.c @@ -3,7 +3,7 @@ * @brief Target information for the k64f * * DAPLink Interface Firmware - * Copyright (c) 2017-2017, ARM Limited, All Rights Reserved + * Copyright (c) 2017-2019, ARM Limited, All Rights Reserved * SPDX-License-Identifier: Apache-2.0 * * Licensed under the Apache License, Version 2.0 (the "License"); you may @@ -26,11 +26,12 @@ // target information target_cfg_t target_device = { - .flash_start = 0x00000000, - .flash_end = 0x00100000, - .ram_start = 0x1fff0000, - .ram_end = 0x20030000, - .flash_algo = (program_target_t *) &flash, - .sectors_info = sectors_info, - .sector_info_length = (sizeof(sectors_info))/(sizeof(sector_info_t)) + .sectors_info = sectors_info, + .sector_info_length = (sizeof(sectors_info))/(sizeof(sector_info_t)), + .flash_regions[0].start = 0x00000000, + .flash_regions[0].end = 0x00100000, + .flash_regions[0].flags = kRegionIsDefault, + .flash_regions[0].flash_algo = (program_target_t *) &flash, + .ram_regions[0].start = 0x1fff0000, + .ram_regions[0].end = 0x20030000, }; diff --git a/source/family/freescale/k66f/flash_blob.c b/source/family/freescale/k66f/flash_blob.c index 119326b5ea..a18ca320f8 100644 --- a/source/family/freescale/k66f/flash_blob.c +++ b/source/family/freescale/k66f/flash_blob.c @@ -3,7 +3,7 @@ * @brief Flash algorithm for the k66f * * DAPLink Interface Firmware - * Copyright (c) 2009-2016, ARM Limited, All Rights Reserved + * Copyright (c) 2009-2019, ARM Limited, All Rights Reserved * SPDX-License-Identifier: Apache-2.0 * * Licensed under the Apache License, Version 2.0 (the "License"); you may @@ -61,6 +61,13 @@ static const uint32_t mk66f18_flash_prog_blob[] = { 0x00800000, 0x01000000, 0x02000000, 0x00000000, }; +/** +* List of start and size for each size of flash sector +* The size will apply to all sectors between the listed address and the next address +* in the list. +* The last pair in the list will have sectors starting at that address and ending +* at address start + size. +*/ static const sector_info_t sectors_info[] = { {0x00000000, 0x00001000}, }; diff --git a/source/family/freescale/k66f/target.c b/source/family/freescale/k66f/target.c index e744fafa01..fe7d5207fb 100644 --- a/source/family/freescale/k66f/target.c +++ b/source/family/freescale/k66f/target.c @@ -3,7 +3,7 @@ * @brief Target information for the k66f * * DAPLink Interface Firmware - * Copyright (c) 2009-2016, ARM Limited, All Rights Reserved + * Copyright (c) 2009-2019, ARM Limited, All Rights Reserved * SPDX-License-Identifier: Apache-2.0 * * Licensed under the Apache License, Version 2.0 (the "License"); you may @@ -26,11 +26,12 @@ // target information target_cfg_t target_device = { - .flash_start = 0x00000000, - .flash_end = 0x00200000, - .ram_start = 0x1fff0000, - .ram_end = 0x20030000, - .flash_algo = (program_target_t *) &flash, - .sectors_info = sectors_info, - .sector_info_length = (sizeof(sectors_info))/(sizeof(sector_info_t)) + .sectors_info = sectors_info, + .sector_info_length = (sizeof(sectors_info))/(sizeof(sector_info_t)), + .flash_regions[0].start = 0x00000000, + .flash_regions[0].end = 0x00200000, + .flash_regions[0].flags = kRegionIsDefault, + .flash_regions[0].flash_algo = (program_target_t *) &flash, + .ram_regions[0].start = 0x1fff0000, + .ram_regions[0].end = 0x20030000, }; diff --git a/source/family/freescale/k82f/flash_blob.c b/source/family/freescale/k82f/flash_blob.c index f9f604d02e..cf5bda44ed 100644 --- a/source/family/freescale/k82f/flash_blob.c +++ b/source/family/freescale/k82f/flash_blob.c @@ -1,5 +1,5 @@ /* Flash OS Routines (Automagically Generated) - * Copyright (c) 2009-2015 ARM Limited + * Copyright (c) 2009-2019 ARM Limited * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -59,6 +59,17 @@ static const uint32_t mk82f25615_flash_prog_blob[] = { 0x02000180, 0x04000300, 0x00000600, 0x00000000, 0x00000000, }; +/** +* List of start and size for each size of flash sector +* The size will apply to all sectors between the listed address and the next address +* in the list. +* The last pair in the list will have sectors starting at that address and ending +* at address start + size. +*/ +static const sector_info_t sectors_info[] = { + {0, 4096}, + }; + static const program_target_t flash = { 0x20000021, // Init 0x20000071, // UnInit diff --git a/source/family/freescale/k82f/target.c b/source/family/freescale/k82f/target.c index 1b41ff4715..8c82420bff 100644 --- a/source/family/freescale/k82f/target.c +++ b/source/family/freescale/k82f/target.c @@ -3,7 +3,7 @@ * @brief Target information for the k66f * * DAPLink Interface Firmware - * Copyright (c) 2009-2016, ARM Limited, All Rights Reserved + * Copyright (c) 2009-2019, ARM Limited, All Rights Reserved * SPDX-License-Identifier: Apache-2.0 * * Licensed under the Apache License, Version 2.0 (the "License"); you may @@ -26,11 +26,12 @@ // target information target_cfg_t target_device = { - .sector_size = 4096, - .sector_cnt = (KB(256) / 4096), - .flash_start = 0, - .flash_end = KB(256), - .ram_start = 0x1FFF0000, - .ram_end = 0x20030000, - .flash_algo = (program_target_t *) &flash, + .sectors_info = sectors_info, + .sector_info_length = (sizeof(sectors_info))/(sizeof(sector_info_t)), + .flash_regions[0].start = 0, + .flash_regions[0].end = KB(256), + .flash_regions[0].flags = kRegionIsDefault, + .flash_regions[0].flash_algo = (program_target_t *) &flash, + .ram_regions[0].start = 0x1FFF0000, + .ram_regions[0].end = 0x20030000, }; diff --git a/source/family/freescale/ke15z/flash_blob.c b/source/family/freescale/ke15z/flash_blob.c index 8f3a50eca0..8550921463 100644 --- a/source/family/freescale/ke15z/flash_blob.c +++ b/source/family/freescale/ke15z/flash_blob.c @@ -3,7 +3,7 @@ * @brief Flash algorithm for the ke15z * * DAPLink Interface Firmware - * Copyright (c) 2009-2016, ARM Limited, All Rights Reserved + * Copyright (c) 2009-2019, ARM Limited, All Rights Reserved * SPDX-License-Identifier: Apache-2.0 * * Licensed under the Apache License, Version 2.0 (the "License"); you may @@ -66,6 +66,17 @@ static const uint32_t mke15z7_flash_prog_blob[] = { 0x00000000, 0x00000000, }; +/** +* List of start and size for each size of flash sector +* The size will apply to all sectors between the listed address and the next address +* in the list. +* The last pair in the list will have sectors starting at that address and ending +* at address start + size. +*/ +static const sector_info_t sectors_info[] = { + {0, 2048}, + }; + static const program_target_t flash = { 0x20000021, // Init 0x20000075, // UnInit diff --git a/source/family/freescale/ke15z/target.c b/source/family/freescale/ke15z/target.c index 06f12ef47a..cf3bc8cc22 100644 --- a/source/family/freescale/ke15z/target.c +++ b/source/family/freescale/ke15z/target.c @@ -3,7 +3,7 @@ * @brief Target information for the ke15z * * DAPLink Interface Firmware - * Copyright (c) 2009-2016, ARM Limited, All Rights Reserved + * Copyright (c) 2009-2019, ARM Limited, All Rights Reserved * SPDX-License-Identifier: Apache-2.0 * * Licensed under the Apache License, Version 2.0 (the "License"); you may @@ -26,11 +26,12 @@ // target information target_cfg_t target_device = { - .sector_size = 2048, - .sector_cnt = (KB(256) / 2048), - .flash_start = 0, - .flash_end = KB(256), - .ram_start = 0x1FFFE000, - .ram_end = 0x20006000, - .flash_algo = (program_target_t *) &flash, + .sectors_info = sectors_info, + .sector_info_length = (sizeof(sectors_info))/(sizeof(sector_info_t)), + .flash_regions[0].start = 0, + .flash_regions[0].end = KB(256), + .flash_regions[0].flags = kRegionIsDefault, + .flash_regions[0].flash_algo = (program_target_t *) &flash, + .ram_regions[0].start = 0x1FFFE000, + .ram_regions[0].end = 0x20006000, }; diff --git a/source/family/freescale/ke18f/flash_blob.c b/source/family/freescale/ke18f/flash_blob.c index 5d62d2404b..7aebdc69b2 100644 --- a/source/family/freescale/ke18f/flash_blob.c +++ b/source/family/freescale/ke18f/flash_blob.c @@ -3,7 +3,7 @@ * @brief Flash algorithm for the ke18f * * DAPLink Interface Firmware - * Copyright (c) 2009-2016, ARM Limited, All Rights Reserved + * Copyright (c) 2009-2019, ARM Limited, All Rights Reserved * SPDX-License-Identifier: Apache-2.0 * * Licensed under the Apache License, Version 2.0 (the "License"); you may @@ -67,6 +67,17 @@ static const uint32_t mke18f16_flash_prog_blob[] = { 0x00000600, 0x00000000, 0x00000000, }; +/** +* List of start and size for each size of flash sector +* The size will apply to all sectors between the listed address and the next address +* in the list. +* The last pair in the list will have sectors starting at that address and ending +* at address start + size. +*/ +static const sector_info_t sectors_info[] = { + {0, 4096}, + }; + static const program_target_t flash = { 0x20000021, // Init 0x20000073, // UnInit diff --git a/source/family/freescale/ke18f/target.c b/source/family/freescale/ke18f/target.c index 3266bb6982..163e702b21 100644 --- a/source/family/freescale/ke18f/target.c +++ b/source/family/freescale/ke18f/target.c @@ -3,7 +3,7 @@ * @brief Target information for the ke18f * * DAPLink Interface Firmware - * Copyright (c) 2009-2016, ARM Limited, All Rights Reserved + * Copyright (c) 2009-2019, ARM Limited, All Rights Reserved * SPDX-License-Identifier: Apache-2.0 * * Licensed under the Apache License, Version 2.0 (the "License"); you may @@ -26,11 +26,12 @@ // target information target_cfg_t target_device = { - .sector_size = 4096, - .sector_cnt = (KB(512) / 4096), - .flash_start = 0, - .flash_end = KB(512), - .ram_start = 0x1FFF8000, - .ram_end = 0x20008000, - .flash_algo = (program_target_t *) &flash, + .sectors_info = sectors_info, + .sector_info_length = (sizeof(sectors_info))/(sizeof(sector_info_t)), + .flash_regions[0].start = 0, + .flash_regions[0].end = KB(512), + .flash_regions[0].flags = kRegionIsDefault, + .flash_regions[0].flash_algo = (program_target_t *) &flash, + .ram_regions[0].start = 0x1FFF8000, + .ram_regions[0].end = 0x20008000, }; diff --git a/source/family/freescale/kl02z/flash_blob.c b/source/family/freescale/kl02z/flash_blob.c index eecb7ea273..c5464564ec 100644 --- a/source/family/freescale/kl02z/flash_blob.c +++ b/source/family/freescale/kl02z/flash_blob.c @@ -3,7 +3,7 @@ * @brief Flash algorithm for the kl02z * * DAPLink Interface Firmware - * Copyright (c) 2009-2016, ARM Limited, All Rights Reserved + * Copyright (c) 2009-2019, ARM Limited, All Rights Reserved * SPDX-License-Identifier: Apache-2.0 * * Licensed under the Apache License, Version 2.0 (the "License"); you may @@ -61,6 +61,17 @@ static const uint32_t KL02Z_FLM[] = { 0x00000000, 0x00000000, 0x00000020, 0x40020004, 0x00000000, }; +/** +* List of start and size for each size of flash sector +* The size will apply to all sectors between the listed address and the next address +* in the list. +* The last pair in the list will have sectors starting at that address and ending +* at address start + size. +*/ +static const sector_info_t sectors_info[] = { + {0, 1024}, + }; + static const program_target_t flash = { 0x20000021, // Init 0x20000039, // UnInit diff --git a/source/family/freescale/kl02z/target.c b/source/family/freescale/kl02z/target.c index e92af162c6..bc23899f92 100644 --- a/source/family/freescale/kl02z/target.c +++ b/source/family/freescale/kl02z/target.c @@ -3,7 +3,7 @@ * @brief Target information for the kl02z * * DAPLink Interface Firmware - * Copyright (c) 2009-2016, ARM Limited, All Rights Reserved + * Copyright (c) 2009-2019, ARM Limited, All Rights Reserved * SPDX-License-Identifier: Apache-2.0 * * Licensed under the Apache License, Version 2.0 (the "License"); you may @@ -26,11 +26,12 @@ // target information target_cfg_t target_device = { - .sector_size = 1024, - .sector_cnt = (KB(32) / 1024), - .flash_start = 0, - .flash_end = KB(32), - .ram_start = 0x1FFFFC00, - .ram_end = 0x20000C00, - .flash_algo = (program_target_t *) &flash, + .sectors_info = sectors_info, + .sector_info_length = (sizeof(sectors_info))/(sizeof(sector_info_t)), + .flash_regions[0].start = 0, + .flash_regions[0].end = KB(32), + .flash_regions[0].flags = kRegionIsDefault, + .flash_regions[0].flash_algo = (program_target_t *) &flash, + .ram_regions[0].start = 0x1FFFFC00, + .ram_regions[0].end = 0x20000C00, }; diff --git a/source/family/freescale/kl05z/flash_blob.c b/source/family/freescale/kl05z/flash_blob.c index de8013f888..549450d4b0 100644 --- a/source/family/freescale/kl05z/flash_blob.c +++ b/source/family/freescale/kl05z/flash_blob.c @@ -3,7 +3,7 @@ * @brief Flash algorithm for the kl05 * * DAPLink Interface Firmware - * Copyright (c) 2009-2016, ARM Limited, All Rights Reserved + * Copyright (c) 2009-2019, ARM Limited, All Rights Reserved * SPDX-License-Identifier: Apache-2.0 * * Licensed under the Apache License, Version 2.0 (the "License"); you may @@ -61,6 +61,17 @@ static const uint32_t KL05Z_FLM[] = { 0x00000000, 0x00000000, 0x00000020, 0x40020004, 0x00000000, }; +/** +* List of start and size for each size of flash sector +* The size will apply to all sectors between the listed address and the next address +* in the list. +* The last pair in the list will have sectors starting at that address and ending +* at address start + size. +*/ +static const sector_info_t sectors_info[] = { + {0, 1024}, + }; + static const program_target_t flash = { 0x20000021, // Init 0x20000039, // UnInit diff --git a/source/family/freescale/kl05z/target.c b/source/family/freescale/kl05z/target.c index cb3cc7257a..a038c220c6 100644 --- a/source/family/freescale/kl05z/target.c +++ b/source/family/freescale/kl05z/target.c @@ -3,7 +3,7 @@ * @brief Target information for the kl05z * * DAPLink Interface Firmware - * Copyright (c) 2009-2016, ARM Limited, All Rights Reserved + * Copyright (c) 2009-2019, ARM Limited, All Rights Reserved * SPDX-License-Identifier: Apache-2.0 * * Licensed under the Apache License, Version 2.0 (the "License"); you may @@ -26,11 +26,12 @@ // target information target_cfg_t target_device = { - .sector_size = 1024, - .sector_cnt = (KB(32) / 1024), - .flash_start = 0, - .flash_end = KB(32), - .ram_start = 0x1FFFFC00, - .ram_end = 0x20000C00, - .flash_algo = (program_target_t *) &flash, + .sectors_info = sectors_info, + .sector_info_length = (sizeof(sectors_info))/(sizeof(sector_info_t)), + .flash_regions[0].start = 0, + .flash_regions[0].end = KB(32), + .flash_regions[0].flags = kRegionIsDefault, + .flash_regions[0].flash_algo = (program_target_t *) &flash, + .ram_regions[0].start = 0x1FFFFC00, + .ram_regions[0].end = 0x20000C00, }; diff --git a/source/family/freescale/kl25z/flash_blob.c b/source/family/freescale/kl25z/flash_blob.c index def1dda705..5784a770dc 100644 --- a/source/family/freescale/kl25z/flash_blob.c +++ b/source/family/freescale/kl25z/flash_blob.c @@ -3,7 +3,7 @@ * @brief Flash algorithm for the kl25z * * DAPLink Interface Firmware - * Copyright (c) 2009-2016, ARM Limited, All Rights Reserved + * Copyright (c) 2009-2019, ARM Limited, All Rights Reserved * SPDX-License-Identifier: Apache-2.0 * * Licensed under the Apache License, Version 2.0 (the "License"); you may @@ -73,6 +73,17 @@ static const uint32_t KL25Z_FLM[] = { 0x00000020, 0x40020004, 0x00000000, }; +/** +* List of start and size for each size of flash sector +* The size will apply to all sectors between the listed address and the next address +* in the list. +* The last pair in the list will have sectors starting at that address and ending +* at address start + size. +*/ +static const sector_info_t sectors_info[] = { + {0, 1024}, + }; + static const program_target_t flash = { 0x20000021, // Init 0x20000039, // UnInit diff --git a/source/family/freescale/kl25z/target.c b/source/family/freescale/kl25z/target.c index 7014b22bda..0d6e8bde30 100644 --- a/source/family/freescale/kl25z/target.c +++ b/source/family/freescale/kl25z/target.c @@ -3,7 +3,7 @@ * @brief Target information for the kl25z * * DAPLink Interface Firmware - * Copyright (c) 2009-2016, ARM Limited, All Rights Reserved + * Copyright (c) 2009-2019, ARM Limited, All Rights Reserved * SPDX-License-Identifier: Apache-2.0 * * Licensed under the Apache License, Version 2.0 (the "License"); you may @@ -26,11 +26,12 @@ // target information target_cfg_t target_device = { - .sector_size = 1024, - .sector_cnt = (KB(128) / 1024), - .flash_start = 0, - .flash_end = KB(128), - .ram_start = 0x1FFF0000, - .ram_end = 0x20004000, - .flash_algo = (program_target_t *) &flash, + .sectors_info = sectors_info, + .sector_info_length = (sizeof(sectors_info))/(sizeof(sector_info_t)), + .flash_regions[0].start = 0, + .flash_regions[0].end = KB(128), + .flash_regions[0].flags = kRegionIsDefault, + .flash_regions[0].flash_algo = (program_target_t *) &flash, + .ram_regions[0].start = 0x1FFF0000, + .ram_regions[0].end = 0x20004000, }; diff --git a/source/family/freescale/kl26z/flash_blob.c b/source/family/freescale/kl26z/flash_blob.c index 1c0250a7a5..84aa3601dd 100644 --- a/source/family/freescale/kl26z/flash_blob.c +++ b/source/family/freescale/kl26z/flash_blob.c @@ -3,7 +3,7 @@ * @brief Flash algorithm for the kl26z * * DAPLink Interface Firmware - * Copyright (c) 2009-2016, ARM Limited, All Rights Reserved + * Copyright (c) 2009-2019, ARM Limited, All Rights Reserved * SPDX-License-Identifier: Apache-2.0 * * Licensed under the Apache License, Version 2.0 (the "License"); you may @@ -61,6 +61,17 @@ static const uint32_t KL26Z_FLM[] = { 0x00000000, 0x00000000, 0x00000020, 0x40020004, 0x00000000, }; +/** +* List of start and size for each size of flash sector +* The size will apply to all sectors between the listed address and the next address +* in the list. +* The last pair in the list will have sectors starting at that address and ending +* at address start + size. +*/ +static const sector_info_t sectors_info[] = { + {0, 1024}, + }; + static const program_target_t flash = { 0x20000021, // Init 0x20000039, // UnInit diff --git a/source/family/freescale/kl26z/target.c b/source/family/freescale/kl26z/target.c index 621259798c..583b9f0831 100644 --- a/source/family/freescale/kl26z/target.c +++ b/source/family/freescale/kl26z/target.c @@ -3,7 +3,7 @@ * @brief Target information for the kl26z * * DAPLink Interface Firmware - * Copyright (c) 2009-2016, ARM Limited, All Rights Reserved + * Copyright (c) 2009-2019, ARM Limited, All Rights Reserved * SPDX-License-Identifier: Apache-2.0 * * Licensed under the Apache License, Version 2.0 (the "License"); you may @@ -26,11 +26,12 @@ // target information target_cfg_t target_device = { - .sector_size = 1024, - .sector_cnt = (KB(128) / 1024), - .flash_start = 0, - .flash_end = KB(128), - .ram_start = 0x1FFF0000, - .ram_end = 0x20004000, - .flash_algo = (program_target_t *) &flash, + .sectors_info = sectors_info, + .sector_info_length = (sizeof(sectors_info))/(sizeof(sector_info_t)), + .flash_regions[0].start = 0, + .flash_regions[0].end = KB(128), + .flash_regions[0].flags = kRegionIsDefault, + .flash_regions[0].flash_algo = (program_target_t *) &flash, + .ram_regions[0].start = 0x1FFF0000, + .ram_regions[0].end = 0x20004000, }; diff --git a/source/family/freescale/kl27z/flash_blob.c b/source/family/freescale/kl27z/flash_blob.c index 0a88091ca8..fb8ec87819 100644 --- a/source/family/freescale/kl27z/flash_blob.c +++ b/source/family/freescale/kl27z/flash_blob.c @@ -3,7 +3,7 @@ * @brief Flash algorithm for the kl27z * * DAPLink Interface Firmware - * Copyright (c) 2009-2016, ARM Limited, All Rights Reserved + * Copyright (c) 2009-2019, ARM Limited, All Rights Reserved * SPDX-License-Identifier: Apache-2.0 * * Licensed under the Apache License, Version 2.0 (the "License"); you may @@ -61,6 +61,17 @@ static const uint32_t KL27Z_FLM[] = { 0x00000000, 0x00000000, 0x00000020, 0x40020004, 0x00000000, }; +/** +* List of start and size for each size of flash sector +* The size will apply to all sectors between the listed address and the next address +* in the list. +* The last pair in the list will have sectors starting at that address and ending +* at address start + size. +*/ +static const sector_info_t sectors_info[] = { + {0, 1024}, + }; + static const program_target_t flash = { 0x20000021, // Init 0x20000039, // UnInit diff --git a/source/family/freescale/kl27z/target.c b/source/family/freescale/kl27z/target.c index 6424bb9379..66a3b3c9d5 100644 --- a/source/family/freescale/kl27z/target.c +++ b/source/family/freescale/kl27z/target.c @@ -3,7 +3,7 @@ * @brief Target information for the kl27z * * DAPLink Interface Firmware - * Copyright (c) 2009-2016, ARM Limited, All Rights Reserved + * Copyright (c) 2009-2019, ARM Limited, All Rights Reserved * SPDX-License-Identifier: Apache-2.0 * * Licensed under the Apache License, Version 2.0 (the "License"); you may @@ -26,11 +26,12 @@ // target information target_cfg_t target_device = { - .sector_size = 1024, - .sector_cnt = (KB(64) / 1024), - .flash_start = 0, - .flash_end = KB(64), - .ram_start = 0x1FFFF000, - .ram_end = 0x20003000, - .flash_algo = (program_target_t *) &flash, + .sectors_info = sectors_info, + .sector_info_length = (sizeof(sectors_info))/(sizeof(sector_info_t)), + .flash_regions[0].start = 0, + .flash_regions[0].end = KB(64), + .flash_regions[0].flags = kRegionIsDefault, + .flash_regions[0].flash_algo = (program_target_t *) &flash, + .ram_regions[0].start = 0x1FFFF000, + .ram_regions[0].end = 0x20003000, }; diff --git a/source/family/freescale/kl28z/flash_blob.c b/source/family/freescale/kl28z/flash_blob.c index 39f9c35b47..77ef6dd811 100644 --- a/source/family/freescale/kl28z/flash_blob.c +++ b/source/family/freescale/kl28z/flash_blob.c @@ -3,7 +3,7 @@ * @brief Flash algorithm for the kl46z * * DAPLink Interface Firmware - * Copyright (c) 2009-2016, ARM Limited, All Rights Reserved + * Copyright (c) 2009-2019, ARM Limited, All Rights Reserved * SPDX-License-Identifier: Apache-2.0 * * Licensed under the Apache License, Version 2.0 (the "License"); you may @@ -75,6 +75,17 @@ static const uint32_t KL28Z_FLM[] = { 0x00800000, 0x00000000, }; +/** +* List of start and size for each size of flash sector +* The size will apply to all sectors between the listed address and the next address +* in the list. +* The last pair in the list will have sectors starting at that address and ending +* at address start + size. +*/ +static const sector_info_t sectors_info[] = { + {0, 1024}, + }; + static const program_target_t flash = { 0x20000021, // Init 0x20000049, // UnInit diff --git a/source/family/freescale/kl28z/target.c b/source/family/freescale/kl28z/target.c index 47e36eab83..815cefd154 100644 --- a/source/family/freescale/kl28z/target.c +++ b/source/family/freescale/kl28z/target.c @@ -3,7 +3,7 @@ * @brief Target information for the kl46z * * DAPLink Interface Firmware - * Copyright (c) 2009-2016, ARM Limited, All Rights Reserved + * Copyright (c) 2009-2019, ARM Limited, All Rights Reserved * SPDX-License-Identifier: Apache-2.0 * * Licensed under the Apache License, Version 2.0 (the "License"); you may @@ -26,11 +26,12 @@ // target information target_cfg_t target_device = { - .sector_size = 1024, - .sector_cnt = (KB(256) / 1024), - .flash_start = 0, - .flash_end = KB(256), - .ram_start = 0x1FFF8000, - .ram_end = 0x20018000, - .flash_algo = (program_target_t *) &flash, + .sectors_info = sectors_info, + .sector_info_length = (sizeof(sectors_info))/(sizeof(sector_info_t)), + .flash_regions[0].start = 0, + .flash_regions[0].end = KB(256), + .flash_regions[0].flags = kRegionIsDefault, + .flash_regions[0].flash_algo = (program_target_t *) &flash, + .ram_regions[0].start = 0x1FFF8000, + .ram_regions[0].end = 0x20018000, }; diff --git a/source/family/freescale/kl43z/flash_blob.c b/source/family/freescale/kl43z/flash_blob.c index 1b69986fa9..e3ef85d37f 100644 --- a/source/family/freescale/kl43z/flash_blob.c +++ b/source/family/freescale/kl43z/flash_blob.c @@ -3,7 +3,7 @@ * @brief Flash algorithm for the kl43z * * DAPLink Interface Firmware - * Copyright (c) 2009-2016, ARM Limited, All Rights Reserved + * Copyright (c) 2009-2019, ARM Limited, All Rights Reserved * SPDX-License-Identifier: Apache-2.0 * * Licensed under the Apache License, Version 2.0 (the "License"); you may @@ -64,6 +64,17 @@ static const uint32_t mkl43z4_flash_prog_blob[] = { 0x02000180, 0x04000300, 0x00000600, 0x00000000, 0x00000000, }; +/** +* List of start and size for each size of flash sector +* The size will apply to all sectors between the listed address and the next address +* in the list. +* The last pair in the list will have sectors starting at that address and ending +* at address start + size. +*/ +static const sector_info_t sectors_info[] = { + {0, 1024}, + }; + static const program_target_t flash = { 0x20000021, // Init 0x20000065, // UnInit diff --git a/source/family/freescale/kl43z/target.c b/source/family/freescale/kl43z/target.c index 3f193952f9..051efb41d2 100644 --- a/source/family/freescale/kl43z/target.c +++ b/source/family/freescale/kl43z/target.c @@ -3,7 +3,7 @@ * @brief Target information for the kl43z * * DAPLink Interface Firmware - * Copyright (c) 2009-2016, ARM Limited, All Rights Reserved + * Copyright (c) 2009-2019, ARM Limited, All Rights Reserved * SPDX-License-Identifier: Apache-2.0 * * Licensed under the Apache License, Version 2.0 (the "License"); you may @@ -26,11 +26,12 @@ // target information target_cfg_t target_device = { - .sector_size = 1024, - .sector_cnt = (KB(256) / 1024), - .flash_start = 0, - .flash_end = KB(256), - .ram_start = 0x1fffe000, - .ram_end = 0x20006000, - .flash_algo = (program_target_t *) &flash, + .sectors_info = sectors_info, + .sector_info_length = (sizeof(sectors_info))/(sizeof(sector_info_t)), + .flash_regions[0].start = 0, + .flash_regions[0].end = KB(256), + .flash_regions[0].flags = kRegionIsDefault, + .flash_regions[0].flash_algo = (program_target_t *) &flash, + .ram_regions[0].start = 0x1fffe000, + .ram_regions[0].end = 0x20006000, }; diff --git a/source/family/freescale/kl46z/flash_blob.c b/source/family/freescale/kl46z/flash_blob.c index b962229d08..70a0da4d90 100644 --- a/source/family/freescale/kl46z/flash_blob.c +++ b/source/family/freescale/kl46z/flash_blob.c @@ -3,7 +3,7 @@ * @brief Flash algorithm for the kl46z * * DAPLink Interface Firmware - * Copyright (c) 2009-2016, ARM Limited, All Rights Reserved + * Copyright (c) 2009-2019, ARM Limited, All Rights Reserved * SPDX-License-Identifier: Apache-2.0 * * Licensed under the Apache License, Version 2.0 (the "License"); you may @@ -73,6 +73,17 @@ static const uint32_t KL46Z_FLM[] = { 0x00000020, 0x40020004, 0x00000000, }; +/** +* List of start and size for each size of flash sector +* The size will apply to all sectors between the listed address and the next address +* in the list. +* The last pair in the list will have sectors starting at that address and ending +* at address start + size. +*/ +static const sector_info_t sectors_info[] = { + {0, 1024}, + }; + static const program_target_t flash = { 0x20000021, // Init 0x20000021, // UnInit diff --git a/source/family/freescale/kl46z/target.c b/source/family/freescale/kl46z/target.c index 4af164a7a7..cfdb4b60e2 100644 --- a/source/family/freescale/kl46z/target.c +++ b/source/family/freescale/kl46z/target.c @@ -3,7 +3,7 @@ * @brief Target information for the kl46z * * DAPLink Interface Firmware - * Copyright (c) 2009-2016, ARM Limited, All Rights Reserved + * Copyright (c) 2009-2019, ARM Limited, All Rights Reserved * SPDX-License-Identifier: Apache-2.0 * * Licensed under the Apache License, Version 2.0 (the "License"); you may @@ -26,11 +26,12 @@ // target information target_cfg_t target_device = { - .sector_size = 1024, - .sector_cnt = (KB(256) / 1024), - .flash_start = 0, - .flash_end = KB(256), - .ram_start = 0x1FFFE000, - .ram_end = 0x20006000, - .flash_algo = (program_target_t *) &flash, + .sectors_info = sectors_info, + .sector_info_length = (sizeof(sectors_info))/(sizeof(sector_info_t)), + .flash_regions[0].start = 0, + .flash_regions[0].end = KB(256), + .flash_regions[0].flags = kRegionIsDefault, + .flash_regions[0].flash_algo = (program_target_t *) &flash, + .ram_regions[0].start = 0x1FFFE000, + .ram_regions[0].end = 0x20006000, }; diff --git a/source/family/freescale/kl82z/flash_blob.c b/source/family/freescale/kl82z/flash_blob.c index 25681124c6..d0e8b15527 100644 --- a/source/family/freescale/kl82z/flash_blob.c +++ b/source/family/freescale/kl82z/flash_blob.c @@ -1,5 +1,5 @@ /* Flash OS Routines (Automagically Generated) - * Copyright (c) 2009-2015 ARM Limited + * Copyright (c) 2009-2019 ARM Limited * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -58,6 +58,17 @@ static const uint32_t mkl82z7_flash_prog_blob[] = { 0x00800060, 0x010000c0, 0x02000180, 0x04000300, 0x00000600, 0x00000000, 0x00000000, }; +/** +* List of start and size for each size of flash sector +* The size will apply to all sectors between the listed address and the next address +* in the list. +* The last pair in the list will have sectors starting at that address and ending +* at address start + size. +*/ +static const sector_info_t sectors_info[] = { + {0, 1024}, + }; + static const program_target_t flash = { 0x20000021, // Init 0x20000071, // UnInit diff --git a/source/family/freescale/kl82z/target.c b/source/family/freescale/kl82z/target.c index 2e03f6a2f7..2b5ca95d37 100644 --- a/source/family/freescale/kl82z/target.c +++ b/source/family/freescale/kl82z/target.c @@ -3,7 +3,7 @@ * @brief Target information for the kl46z * * DAPLink Interface Firmware - * Copyright (c) 2009-2016, ARM Limited, All Rights Reserved + * Copyright (c) 2009-2019, ARM Limited, All Rights Reserved * SPDX-License-Identifier: Apache-2.0 * * Licensed under the Apache License, Version 2.0 (the "License"); you may @@ -26,11 +26,12 @@ // target information target_cfg_t target_device = { - .sector_size = 1024, - .sector_cnt = (KB(96) / 1024), - .flash_start = 0, - .flash_end = KB(128), - .ram_start = 0x1FFFA000, - .ram_end = 0x20012000, - .flash_algo = (program_target_t *) &flash, + .sectors_info = sectors_info, + .sector_info_length = (sizeof(sectors_info))/(sizeof(sector_info_t)), + .flash_regions[0].start = 0, + .flash_regions[0].end = KB(128), + .flash_regions[0].flags = kRegionIsDefault, + .flash_regions[0].flash_algo = (program_target_t *) &flash, + .ram_regions[0].start = 0x1FFFA000, + .ram_regions[0].end = 0x20012000, }; diff --git a/source/family/freescale/kw24d/flash_blob.c b/source/family/freescale/kw24d/flash_blob.c index 95e2a50322..fefedb713f 100644 --- a/source/family/freescale/kw24d/flash_blob.c +++ b/source/family/freescale/kw24d/flash_blob.c @@ -3,7 +3,7 @@ * @brief Flash algorithm for the kw24d * * DAPLink Interface Firmware - * Copyright (c) 2009-2016, ARM Limited, All Rights Reserved + * Copyright (c) 2009-2019, ARM Limited, All Rights Reserved * SPDX-License-Identifier: Apache-2.0 * * Licensed under the Apache License, Version 2.0 (the "License"); you may @@ -66,6 +66,17 @@ const uint32_t mkw24d5_flash_prog_blob[] = { 0x04000300, 0x00000600, 0x00000000, 0x00000000, }; +/** +* List of start and size for each size of flash sector +* The size will apply to all sectors between the listed address and the next address +* in the list. +* The last pair in the list will have sectors starting at that address and ending +* at address start + size. +*/ +static const sector_info_t sectors_info[] = { + {0, 2048}, + }; + static const program_target_t flash = { 0x20000021, // Init 0x20000071, // UnInit diff --git a/source/family/freescale/kw24d/target.c b/source/family/freescale/kw24d/target.c index a7ae7d5410..b09bdcaa09 100644 --- a/source/family/freescale/kw24d/target.c +++ b/source/family/freescale/kw24d/target.c @@ -3,7 +3,7 @@ * @brief Target information for the kw24d * * DAPLink Interface Firmware - * Copyright (c) 2009-2016, ARM Limited, All Rights Reserved + * Copyright (c) 2009-2019, ARM Limited, All Rights Reserved * SPDX-License-Identifier: Apache-2.0 * * Licensed under the Apache License, Version 2.0 (the "License"); you may @@ -26,11 +26,12 @@ // target information target_cfg_t target_device = { - .sector_size = 2048, - .sector_cnt = (KB(512) / 2048), - .flash_start = 0, - .flash_end = KB(512), - .ram_start = 0x1FFF8000, - .ram_end = 0x20008000, - .flash_algo = (program_target_t *) &flash, + .sectors_info = sectors_info, + .sector_info_length = (sizeof(sectors_info))/(sizeof(sector_info_t)), + .flash_regions[0].start = 0, + .flash_regions[0].end = KB(512), + .flash_regions[0].flags = kRegionIsDefault, + .flash_regions[0].flash_algo = (program_target_t *) &flash, + .ram_regions[0].start = 0x1FFF8000, + .ram_regions[0].end = 0x20008000, }; diff --git a/source/family/freescale/kw41z/flash_blob.c b/source/family/freescale/kw41z/flash_blob.c index a18dac6aba..b902e8dd26 100644 --- a/source/family/freescale/kw41z/flash_blob.c +++ b/source/family/freescale/kw41z/flash_blob.c @@ -3,7 +3,7 @@ * @brief Flash algorithm for the kw41z * * DAPLink Interface Firmware - * Copyright (c) 2009-2016, ARM Limited, All Rights Reserved + * Copyright (c) 2009-2019, ARM Limited, All Rights Reserved * SPDX-License-Identifier: Apache-2.0 * * Licensed under the Apache License, Version 2.0 (the "License"); you may @@ -90,6 +90,17 @@ static const uint32_t mkw41z4_flash_prog_blob[] = { 0x00800000, 0x00000000, 0x00800000, 0x00000000, }; +/** +* List of start and size for each size of flash sector +* The size will apply to all sectors between the listed address and the next address +* in the list. +* The last pair in the list will have sectors starting at that address and ending +* at address start + size. +*/ +static const sector_info_t sectors_info[] = { + {0, 2048}, + }; + static const program_target_t flash = { 0x20000021, // Init 0x20000039, // UnInit diff --git a/source/family/freescale/kw41z/target.c b/source/family/freescale/kw41z/target.c index fe6d80e5ee..37a801dc4f 100644 --- a/source/family/freescale/kw41z/target.c +++ b/source/family/freescale/kw41z/target.c @@ -26,11 +26,12 @@ // target information target_cfg_t target_device = { - .sector_size = 2048, - .sector_cnt = (KB(512) / 2048), - .flash_start = 0, - .flash_end = KB(512), - .ram_start = 0x1FFF8000, - .ram_end = 0x20018000, - .flash_algo = (program_target_t *) &flash, + .sectors_info = sectors_info, + .sector_info_length = (sizeof(sectors_info))/(sizeof(sector_info_t)), + .flash_regions[0].start = 0, + .flash_regions[0].end = KB(512), + .flash_regions[0].flags = kRegionIsDefault, + .flash_regions[0].flash_algo = (program_target_t *) &flash, + .ram_regions[0].start = 0x1FFF8000, + .ram_regions[0].end = 0x20018000, }; diff --git a/source/family/freescale/mimxrt1020_spi_flash/flash_blob.c b/source/family/freescale/mimxrt1020_spi_flash/flash_blob.c index 643739f3f1..17b6a1b859 100644 --- a/source/family/freescale/mimxrt1020_spi_flash/flash_blob.c +++ b/source/family/freescale/mimxrt1020_spi_flash/flash_blob.c @@ -1,5 +1,5 @@ /* Flash OS Routines (Automagically Generated) - * Copyright (c) 2009-2015 ARM Limited + * Copyright (c) 2009-2019 ARM Limited * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,6 +14,8 @@ * limitations under the License. */ +#include "flash_blob.h" + static const uint32_t RT1020_S25LP064A_flash_prog_blob[] = { 0xE00ABE00, 0x062D780D, 0x24084068, 0xD3000040, 0x1E644058, 0x1C49D1FA, 0x2A001E52, 0x4770D1F2, 0x4605b570, 0x4616460c, 0xcc0fe002, 0x3e10c50f, 0xd2fa2e10, 0xd3022e08, 0xc503cc03, 0x2e043e08, @@ -609,15 +611,15 @@ static const uint32_t flash_start = 0x60000000; static const uint32_t flash_size = 0x00800000; /** -* List of start and size for each size of flash sector - even indexes are start, odd are size +* List of start and size for each size of flash sector * The size will apply to all sectors between the listed address and the next address * in the list. * The last pair in the list will have sectors starting at that address and ending -* at address flash_start + flash_size. +* at address start + size. */ -static const uint32_t sectors_info[] = { - 0x60000000, 0x00001000, -}; +static const sector_info_t sectors_info[] = { + {0x60000000, 0x00001000}, + }; static const program_target_t flash = { 0x20000b01, // Init diff --git a/source/family/freescale/mimxrt1020_spi_flash/target.c b/source/family/freescale/mimxrt1020_spi_flash/target.c index 82f027700e..725104884d 100644 --- a/source/family/freescale/mimxrt1020_spi_flash/target.c +++ b/source/family/freescale/mimxrt1020_spi_flash/target.c @@ -3,7 +3,7 @@ * @brief Target information for the i.MXRT1020 * * DAPLink Interface Firmware - * Copyright (c) 2009-2016, ARM Limited, All Rights Reserved + * Copyright (c) 2009-2019, ARM Limited, All Rights Reserved * SPDX-License-Identifier: Apache-2.0 * * Licensed under the Apache License, Version 2.0 (the "License"); you may @@ -27,11 +27,12 @@ // target information target_cfg_t target_device = { - .sector_size = KB(4), - .sector_cnt = 2048, - .flash_start = 0x60000000, - .flash_end = 0x60000000 + MB(64), - .ram_start = 0x20000000, - .ram_end = 0x20000000 + MB(64), - .flash_algo = (program_target_t *) &flash, + .sectors_info = sectors_info, + .sector_info_length = (sizeof(sectors_info))/(sizeof(sector_info_t)), + .flash_regions[0].start = 0x60000000, + .flash_regions[0].end = 0x60000000 + MB(64), + .flash_regions[0].flags = kRegionIsDefault, + .flash_regions[0].flash_algo = (program_target_t *) &flash, + .ram_regions[0].start = 0x20000000, + .ram_regions[0].end = 0x20000000 + MB(64), }; diff --git a/source/family/freescale/mimxrt1050_hyper_flash/flash_blob.c b/source/family/freescale/mimxrt1050_hyper_flash/flash_blob.c index bf9dce2a1d..3814f0560e 100644 --- a/source/family/freescale/mimxrt1050_hyper_flash/flash_blob.c +++ b/source/family/freescale/mimxrt1050_hyper_flash/flash_blob.c @@ -3,7 +3,7 @@ * @brief Flash algorithm for the i.MXRT1050 HyperFlash * * DAPLink Interface Firmware - * Copyright (c) 2009-2016, ARM Limited, All Rights Reserved + * Copyright (c) 2009-2019, ARM Limited, All Rights Reserved * SPDX-License-Identifier: Apache-2.0 * * Licensed under the Apache License, Version 2.0 (the "License"); you may @@ -446,6 +446,17 @@ static const uint32_t MIMXRT_HYPER_FLASH_FLM[] = { 0x00000000, 0x00000000, 0x00000000, 0x00b71b00, 0x00000000, 0x00000000, 0x00000000, }; +/** +* List of start and size for each size of flash sector +* The size will apply to all sectors between the listed address and the next address +* in the list. +* The last pair in the list will have sectors starting at that address and ending +* at address start + size. +*/ +static const sector_info_t sectors_info[] = { + {0x60002000, 0x00000400}, + }; + static const program_target_t flash = { 0x200003A9, // Init 0x20000C79, // UnInit diff --git a/source/family/freescale/mimxrt1050_hyper_flash/target.c b/source/family/freescale/mimxrt1050_hyper_flash/target.c index 2e9bc485a6..f1e9ba4d87 100644 --- a/source/family/freescale/mimxrt1050_hyper_flash/target.c +++ b/source/family/freescale/mimxrt1050_hyper_flash/target.c @@ -3,7 +3,7 @@ * @brief Target information for the i.MXRT1050 * * DAPLink Interface Firmware - * Copyright (c) 2009-2016, ARM Limited, All Rights Reserved + * Copyright (c) 2009-2019, ARM Limited, All Rights Reserved * SPDX-License-Identifier: Apache-2.0 * * Licensed under the Apache License, Version 2.0 (the "License"); you may @@ -26,11 +26,12 @@ // target information target_cfg_t target_device = { - .sector_size = KB(1), - .sector_cnt = 1024, - .flash_start = 0x60002000, - .flash_end = 0x60002000 + MB(64), - .ram_start = 0x20000000, - .ram_end = 0x20000000 + MB(64), - .flash_algo = (program_target_t *) &flash, + .sectors_info = sectors_info, + .sector_info_length = (sizeof(sectors_info))/(sizeof(sector_info_t)), + .flash_regions[0].start = 0x60002000, + .flash_regions[0].end = 0x60002000 + MB(64), + .flash_regions[0].flags = kRegionIsDefault, + .flash_regions[0].flash_algo = (program_target_t *) &flash, + .ram_regions[0].start = 0x20000000, + .ram_regions[0].end = 0x20000000 + MB(64), }; diff --git a/source/family/freescale/mimxrt1050_spi_flash/flash_blob.c b/source/family/freescale/mimxrt1050_spi_flash/flash_blob.c index c310c4aea1..9e1e72eb8c 100644 --- a/source/family/freescale/mimxrt1050_spi_flash/flash_blob.c +++ b/source/family/freescale/mimxrt1050_spi_flash/flash_blob.c @@ -3,7 +3,7 @@ * @brief Flash algorithm for the i.MXRT1050 QSPI * * DAPLink Interface Firmware - * Copyright (c) 2009-2016, ARM Limited, All Rights Reserved + * Copyright (c) 2009-2019, ARM Limited, All Rights Reserved * SPDX-License-Identifier: Apache-2.0 * * Licensed under the Apache License, Version 2.0 (the "License"); you may @@ -447,6 +447,17 @@ static const uint32_t MIMXRT_SPI_FLASH_FLM[] = { 0x00000000, 0x00000000, 0x00000000, 0x00b71b00, 0x00000000, 0x00000000, 0x00000000, }; +/** +* List of start and size for each size of flash sector +* The size will apply to all sectors between the listed address and the next address +* in the list. +* The last pair in the list will have sectors starting at that address and ending +* at address start + size. +*/ +static const sector_info_t sectors_info[] = { + {0x60002000, 0x00001000}, + }; + static const program_target_t flash = { 0x200003A1, // Init 0x20000C99, // UnInit diff --git a/source/family/freescale/mimxrt1050_spi_flash/target.c b/source/family/freescale/mimxrt1050_spi_flash/target.c index b853e3606c..f1e9ba4d87 100644 --- a/source/family/freescale/mimxrt1050_spi_flash/target.c +++ b/source/family/freescale/mimxrt1050_spi_flash/target.c @@ -3,7 +3,7 @@ * @brief Target information for the i.MXRT1050 * * DAPLink Interface Firmware - * Copyright (c) 2009-2016, ARM Limited, All Rights Reserved + * Copyright (c) 2009-2019, ARM Limited, All Rights Reserved * SPDX-License-Identifier: Apache-2.0 * * Licensed under the Apache License, Version 2.0 (the "License"); you may @@ -26,11 +26,12 @@ // target information target_cfg_t target_device = { - .sector_size = KB(4), - .sector_cnt = 2048, - .flash_start = 0x60002000, - .flash_end = 0x60002000 + MB(64), - .ram_start = 0x20000000, - .ram_end = 0x20000000 + MB(64), - .flash_algo = (program_target_t *) &flash, + .sectors_info = sectors_info, + .sector_info_length = (sizeof(sectors_info))/(sizeof(sector_info_t)), + .flash_regions[0].start = 0x60002000, + .flash_regions[0].end = 0x60002000 + MB(64), + .flash_regions[0].flags = kRegionIsDefault, + .flash_regions[0].flash_algo = (program_target_t *) &flash, + .ram_regions[0].start = 0x20000000, + .ram_regions[0].end = 0x20000000 + MB(64), }; diff --git a/source/family/freescale/rapid_iot/flash_blob_k64.c b/source/family/freescale/rapid_iot/flash_blob_k64.c index 054a54dd04..f9cf278774 100644 --- a/source/family/freescale/rapid_iot/flash_blob_k64.c +++ b/source/family/freescale/rapid_iot/flash_blob_k64.c @@ -3,7 +3,7 @@ * @brief Flash algorithm for the k64f * * DAPLink Interface Firmware - * Copyright (c) 2009-2016, ARM Limited, All Rights Reserved + * Copyright (c) 2009-2019, ARM Limited, All Rights Reserved * SPDX-License-Identifier: Apache-2.0 * * Licensed under the Apache License, Version 2.0 (the "License"); you may @@ -61,8 +61,15 @@ static const uint32_t K64F_FLM[] = { 0x00400000, 0x00800000, 0x01000000, 0x01000000, 0x40020004, 0x00000000, }; -static const sector_info_t sectors_info[] = { - {0x00000000, 0x00001000}, +/** +* List of start and size for each size of flash sector +* The size will apply to all sectors between the listed address and the next address +* in the list. +* The last pair in the list will have sectors starting at that address and ending +* at address start + size. +*/ +static const sector_info_t sectors_info_k64[] = { + {0, 4096}, }; static const program_target_t flash_k64 = { diff --git a/source/family/freescale/rapid_iot/flash_blob_kw40.c b/source/family/freescale/rapid_iot/flash_blob_kw40.c index c749e1af86..8306e26570 100644 --- a/source/family/freescale/rapid_iot/flash_blob_kw40.c +++ b/source/family/freescale/rapid_iot/flash_blob_kw40.c @@ -3,7 +3,7 @@ * @brief Flash algorithm for the kw40z * * DAPLink Interface Firmware - * Copyright (c) 2009-2016, ARM Limited, All Rights Reserved + * Copyright (c) 2009-2019, ARM Limited, All Rights Reserved * SPDX-License-Identifier: Apache-2.0 * * Licensed under the Apache License, Version 2.0 (the "License"); you may @@ -76,6 +76,17 @@ static const uint32_t mkw40z4_flash_prog_blob[] = { 0x00280000, 0x40020004, 0x00000000, }; +/** +* List of start and size for each size of flash sector +* The size will apply to all sectors between the listed address and the next address +* in the list. +* The last pair in the list will have sectors starting at that address and ending +* at address start + size. +*/ +static const sector_info_t sectors_info_kw40[] = { + {0, 1024}, + }; + static const program_target_t flash_kw40 = { 0x2000027D, // Init 0x200002E5, // UnInit diff --git a/source/family/freescale/rapid_iot/flash_blob_kw41.c b/source/family/freescale/rapid_iot/flash_blob_kw41.c index 4c212b2284..80a6f44f9f 100644 --- a/source/family/freescale/rapid_iot/flash_blob_kw41.c +++ b/source/family/freescale/rapid_iot/flash_blob_kw41.c @@ -3,7 +3,7 @@ * @brief Flash algorithm for the kw41z * * DAPLink Interface Firmware - * Copyright (c) 2009-2016, ARM Limited, All Rights Reserved + * Copyright (c) 2009-2019, ARM Limited, All Rights Reserved * SPDX-License-Identifier: Apache-2.0 * * Licensed under the Apache License, Version 2.0 (the "License"); you may @@ -82,6 +82,17 @@ static const uint32_t mkw41z4_flash_prog_blob[] = { 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000 }; +/** +* List of start and size for each size of flash sector +* The size will apply to all sectors between the listed address and the next address +* in the list. +* The last pair in the list will have sectors starting at that address and ending +* at address start + size. +*/ +static const sector_info_t sectors_info_kw41[] = { + {0, 2048}, + }; + static const program_target_t flash_kw41 = { 0x20000021, // Init 0x20000065, // UnInit diff --git a/source/family/freescale/rapid_iot/target.c b/source/family/freescale/rapid_iot/target.c index 46610c9d3c..a76abcf39a 100644 --- a/source/family/freescale/rapid_iot/target.c +++ b/source/family/freescale/rapid_iot/target.c @@ -3,7 +3,7 @@ * @brief Target information for the rapid-iot * * DAPLink Interface Firmware - * Copyright (c) 2009-2016, ARM Limited, All Rights Reserved + * Copyright (c) 2009-2019, ARM Limited, All Rights Reserved * SPDX-License-Identifier: Apache-2.0 * * Licensed under the Apache License, Version 2.0 (the "License"); you may @@ -28,39 +28,38 @@ // default target information is k64f target_cfg_t target_device = { - .sector_size = 4096, + .sectors_info = sectors_info_k64, + .sector_info_length = (sizeof(sectors_info_k64))/(sizeof(sectors_info_k64)), #ifdef BOARD_RAPID_IOT - /* Rapid-IoT boards reserve flash at the beginning for bootloader */ - .sector_cnt = (0xEC000 / 4096), - .flash_start = 0x00014000, + .flash_regions[0].start = 0x00014000, #else - /* Hexiwear boards do not have a bootloader at the start of flash */ - .sector_cnt = (MB(1) / 4096), - .flash_start = 0x00000000, -#endif - .flash_end = MB(1), - .ram_start = 0x1fff0000, - .ram_end = 0x20030000, - .flash_algo = (program_target_t *) &flash_k64, + .flash_regions[0].start = 0x00000000, +#endif + .flash_regions[0].end = MB(1), + .flash_regions[0].flags = kRegionIsDefault, + .flash_regions[0].flash_algo = (program_target_t *) &flash_k64, + .ram_regions[0].start = 0x20000000, + .ram_regions[0].end = 0x20030000, }; target_cfg_t target_device_kw40 = { - .sector_size = 1024, - .sector_cnt = (KB(160) / 1024), - .flash_start = 0, - .flash_end = KB(160), - .ram_start = 0x1FFFF000, - .ram_end = 0x20004000, - .flash_algo = (program_target_t *) &flash_kw40, + .sectors_info = sectors_info_kw40, + .sector_info_length = (sizeof(sectors_info_kw40))/(sizeof(sectors_info_kw40)), + .flash_regions[0].start = 0, + .flash_regions[0].end = KB(160), + .flash_regions[0].flags = kRegionIsDefault, + .flash_regions[0].flash_algo = (program_target_t *) &flash_kw40, + .ram_regions[0].start = 0x1FFFF000, + .ram_regions[0].end = 0x20004000, }; target_cfg_t target_device_kw41 = { - .sector_size = 2048, - /* Rapid-IoT boards reserve flash at the beginning for bootloader */ - .sector_cnt = (0x7C000 / 2048), - .flash_start = 0x4000, - .flash_end = KB(512), - .ram_start = 0x1FFF8000, - .ram_end = 0x20018000, - .flash_algo = (program_target_t *) &flash_kw41, + .sectors_info = sectors_info_kw41, + .sector_info_length = (sizeof(sectors_info_kw41))/(sizeof(sectors_info_kw41)), + .flash_regions[0].start = 0x4000, + .flash_regions[0].end = KB(512), + .flash_regions[0].flags = kRegionIsDefault, + .flash_regions[0].flash_algo = (program_target_t *) &flash_kw41, + .ram_regions[0].start = 0x1FFF8000, + .ram_regions[0].end = 0x20018000, }; diff --git a/source/family/maxim/max32620/flash_blob.c b/source/family/maxim/max32620/flash_blob.c index f93d5ea9ea..4a90aad958 100644 --- a/source/family/maxim/max32620/flash_blob.c +++ b/source/family/maxim/max32620/flash_blob.c @@ -3,7 +3,7 @@ * @brief Flash algorithm for the MAX32620 * * DAPLink Interface Firmware - * Copyright (c) 2009-2016, ARM Limited, All Rights Reserved + * Copyright (c) 2009-2019, ARM Limited, All Rights Reserved * SPDX-License-Identifier: Apache-2.0 * * Licensed under the Apache License, Version 2.0 (the "License"); you may @@ -56,6 +56,17 @@ const uint32_t flash_algo_blob[] = { FLC_BASE, CLK_DIV, BRST_SIZE, FLASH_BASE, FLASH_SIZE, FLASH_SECTOR, }; +/** +* List of start and size for each size of flash sector +* The size will apply to all sectors between the listed address and the next address +* in the list. +* The last pair in the list will have sectors starting at that address and ending +* at address start + size. +*/ +static const sector_info_t sectors_info[] = { + {0, 0x2000}, + }; + const program_target_t flash = { 0x20000021, // Init 0x20000045, // UnInit diff --git a/source/family/maxim/max32620/target.c b/source/family/maxim/max32620/target.c index 582a278bbb..ca12cc13f8 100644 --- a/source/family/maxim/max32620/target.c +++ b/source/family/maxim/max32620/target.c @@ -3,7 +3,7 @@ * @brief Target information for the MAX32620 * * DAPLink Interface Firmware - * Copyright (c) 2009-2016, ARM Limited, All Rights Reserved + * Copyright (c) 2009-2019, ARM Limited, All Rights Reserved * SPDX-License-Identifier: Apache-2.0 * * Licensed under the Apache License, Version 2.0 (the "License"); you may @@ -21,15 +21,16 @@ #include "target_config.h" -extern const program_target_t flash; +#include "flash_blob.c" /* ME02 -- MAX32620 2MiB Flash, 256KiB RAM */ target_cfg_t target_device = { - .sector_size = 0x2000, - .sector_cnt = (0x200000 / 0x2000), - .flash_start = 0, - .flash_end = 0x200000, - .ram_start = 0x20000000, - .ram_end = 0x20040000, - .flash_algo = (program_target_t *) &flash, + .sectors_info = sectors_info, + .sector_info_length = (sizeof(sectors_info))/(sizeof(sector_info_t)), + .flash_regions[0].start = 0, + .flash_regions[0].end = 0x200000, + .flash_regions[0].flags = kRegionIsDefault, + .flash_regions[0].flash_algo = (program_target_t *) &flash, + .ram_regions[0].start = 0x20000000, + .ram_regions[0].end = 0x20040000, }; diff --git a/source/family/maxim/max32625/flash_blob.c b/source/family/maxim/max32625/flash_blob.c index 9c10b5e7dc..9f9e82f346 100644 --- a/source/family/maxim/max32625/flash_blob.c +++ b/source/family/maxim/max32625/flash_blob.c @@ -3,7 +3,7 @@ * @brief Flash algorithm for the MAX32625 * * DAPLink Interface Firmware - * Copyright (c) 2009-2016, ARM Limited, All Rights Reserved + * Copyright (c) 2009-2019, ARM Limited, All Rights Reserved * SPDX-License-Identifier: Apache-2.0 * * Licensed under the Apache License, Version 2.0 (the "License"); you may @@ -56,6 +56,17 @@ const uint32_t flash_algo_blob[] = { FLC_BASE, CLK_DIV, BRST_SIZE, FLASH_BASE, FLASH_SIZE, FLASH_SECTOR, }; +/** +* List of start and size for each size of flash sector +* The size will apply to all sectors between the listed address and the next address +* in the list. +* The last pair in the list will have sectors starting at that address and ending +* at address start + size. +*/ +static const sector_info_t sectors_info[] = { + {0, 0x2000}, + }; + const program_target_t flash = { 0x20000021, // Init 0x20000045, // UnInit diff --git a/source/family/maxim/max32625/target.c b/source/family/maxim/max32625/target.c index 5bd35b7b9d..402d33b872 100644 --- a/source/family/maxim/max32625/target.c +++ b/source/family/maxim/max32625/target.c @@ -3,7 +3,7 @@ * @brief Target information for the MAX32625 * * DAPLink Interface Firmware - * Copyright (c) 2009-2016, ARM Limited, All Rights Reserved + * Copyright (c) 2009-2019, ARM Limited, All Rights Reserved * SPDX-License-Identifier: Apache-2.0 * * Licensed under the Apache License, Version 2.0 (the "License"); you may @@ -21,15 +21,16 @@ #include "target_config.h" -extern const program_target_t flash; +#include "flash_blob.c" /* ME03 -- MAX32625 512KiB Flash, 160KiB RAM */ target_cfg_t target_device = { - .sector_size = 0x2000, - .sector_cnt = (0x80000 / 0x2000), - .flash_start = 0, - .flash_end = 0x80000, - .ram_start = 0x20000000, - .ram_end = 0x20028000, - .flash_algo = (program_target_t *) &flash, + .sectors_info = sectors_info, + .sector_info_length = (sizeof(sectors_info))/(sizeof(sector_info_t)), + .flash_regions[0].start = 0, + .flash_regions[0].end = 0x80000, + .flash_regions[0].flags = kRegionIsDefault, + .flash_regions[0].flash_algo = (program_target_t *) &flash, + .ram_regions[0].start = 0x20000000, + .ram_regions[0].end = 0x20028000, }; diff --git a/source/family/maxim/max32630/flash_blob.c b/source/family/maxim/max32630/flash_blob.c index 8c7645c4c6..e9193e1deb 100644 --- a/source/family/maxim/max32630/flash_blob.c +++ b/source/family/maxim/max32630/flash_blob.c @@ -3,7 +3,7 @@ * @brief Flash algorithm for the MAX32630 * * DAPLink Interface Firmware - * Copyright (c) 2009-2016, ARM Limited, All Rights Reserved + * Copyright (c) 2009-2019, ARM Limited, All Rights Reserved * SPDX-License-Identifier: Apache-2.0 * * Licensed under the Apache License, Version 2.0 (the "License"); you may @@ -56,6 +56,17 @@ const uint32_t flash_algo_blob[] = { FLC_BASE, CLK_DIV, BRST_SIZE, FLASH_BASE, FLASH_SIZE, FLASH_SECTOR, }; +/** +* List of start and size for each size of flash sector +* The size will apply to all sectors between the listed address and the next address +* in the list. +* The last pair in the list will have sectors starting at that address and ending +* at address start + size. +*/ +static const sector_info_t sectors_info[] = { + {0, 0x2000}, + }; + const program_target_t flash = { 0x20000021, // Init 0x20000045, // UnInit diff --git a/source/family/maxim/max32630/target.c b/source/family/maxim/max32630/target.c index 92afc42397..5713bad564 100644 --- a/source/family/maxim/max32630/target.c +++ b/source/family/maxim/max32630/target.c @@ -3,7 +3,7 @@ * @brief Target information for the MAX32630 * * DAPLink Interface Firmware - * Copyright (c) 2009-2016, ARM Limited, All Rights Reserved + * Copyright (c) 2009-2019, ARM Limited, All Rights Reserved * SPDX-License-Identifier: Apache-2.0 * * Licensed under the Apache License, Version 2.0 (the "License"); you may @@ -21,15 +21,16 @@ #include "target_config.h" -extern const program_target_t flash; +#include "flash_blob.c" /* ME03 -- MAX32630 2MiB Flash, 512KiB RAM */ target_cfg_t target_device = { - .sector_size = 0x2000, - .sector_cnt = (0x200000 / 0x2000), - .flash_start = 0, - .flash_end = 0x200000, - .ram_start = 0x20000000, - .ram_end = 0x20080000, - .flash_algo = (program_target_t *) &flash, + .sectors_info = sectors_info, + .sector_info_length = (sizeof(sectors_info))/(sizeof(sector_info_t)), + .flash_regions[0].start = 0, + .flash_regions[0].end = 0x200000, + .flash_regions[0].flags = kRegionIsDefault, + .flash_regions[0].flash_algo = (program_target_t *) &flash, + .ram_regions[0].start = 0x20000000, + .ram_regions[0].end = 0x20080000, }; diff --git a/source/family/nordic/nrf51822/flash_blob.c b/source/family/nordic/nrf51822/flash_blob.c index 191991b301..37b7239645 100644 --- a/source/family/nordic/nrf51822/flash_blob.c +++ b/source/family/nordic/nrf51822/flash_blob.c @@ -3,7 +3,7 @@ * @brief Flash algorithm for the nrf51 * * DAPLink Interface Firmware - * Copyright (c) 2009-2016, ARM Limited, All Rights Reserved + * Copyright (c) 2009-2019, ARM Limited, All Rights Reserved * SPDX-License-Identifier: Apache-2.0 * * Licensed under the Apache License, Version 2.0 (the "License"); you may @@ -33,6 +33,17 @@ static const uint32_t nRF51822AA_FLM[] = { /*0x0E0*/ 0x0, }; +/** +* List of start and size for each size of flash sector +* The size will apply to all sectors between the listed address and the next address +* in the list. +* The last pair in the list will have sectors starting at that address and ending +* at address start + size. +*/ +static const sector_info_t sectors_info[] = { + {0, 1024}, + }; + static const program_target_t flash = { .init = 0x20000021, .uninit = 0x20000025, diff --git a/source/family/nordic/nrf51822/target_16.c b/source/family/nordic/nrf51822/target_16.c index 0717829ac0..eabd3af1ce 100644 --- a/source/family/nordic/nrf51822/target_16.c +++ b/source/family/nordic/nrf51822/target_16.c @@ -3,7 +3,7 @@ * @brief Target information for the nrf51 * * DAPLink Interface Firmware - * Copyright (c) 2009-2016, ARM Limited, All Rights Reserved + * Copyright (c) 2009-2019, ARM Limited, All Rights Reserved * SPDX-License-Identifier: Apache-2.0 * * Licensed under the Apache License, Version 2.0 (the "License"); you may @@ -26,12 +26,13 @@ // target information target_cfg_t target_device = { - .sector_size = 1024, - .sector_cnt = (KB(256) / 1024), - .flash_start = 0, - .flash_end = KB(256), - .ram_start = 0x20000000, - .ram_end = 0x20004000, - .flash_algo = (program_target_t *) &flash, + .sectors_info = sectors_info, + .sector_info_length = (sizeof(sectors_info))/(sizeof(sector_info_t)), + .flash_regions[0].start = 0, + .flash_regions[0].end = KB(256), + .flash_regions[0].flags = kRegionIsDefault, + .flash_regions[0].flash_algo = (program_target_t *) &flash, + .ram_regions[0].start = 0x20000000, + .ram_regions[0].end = 0x20004000, .erase_reset = 1, }; diff --git a/source/family/nordic/nrf51822/target_32.c b/source/family/nordic/nrf51822/target_32.c index b291a531e6..1b273f715b 100644 --- a/source/family/nordic/nrf51822/target_32.c +++ b/source/family/nordic/nrf51822/target_32.c @@ -3,7 +3,7 @@ * @brief Target information for the nrf51 * * DAPLink Interface Firmware - * Copyright (c) 2009-2016, ARM Limited, All Rights Reserved + * Copyright (c) 2009-2019, ARM Limited, All Rights Reserved * SPDX-License-Identifier: Apache-2.0 * * Licensed under the Apache License, Version 2.0 (the "License"); you may @@ -26,12 +26,13 @@ // target information target_cfg_t target_device = { - .sector_size = 1024, - .sector_cnt = (KB(256) / 1024), - .flash_start = 0, - .flash_end = KB(256), - .ram_start = 0x20000000, - .ram_end = 0x20008000, - .flash_algo = (program_target_t *) &flash, + .sectors_info = sectors_info, + .sector_info_length = (sizeof(sectors_info))/(sizeof(sector_info_t)), + .flash_regions[0].start = 0, + .flash_regions[0].end = KB(256), + .flash_regions[0].flags = kRegionIsDefault, + .flash_regions[0].flash_algo = (program_target_t *) &flash, + .ram_regions[0].start = 0x20000000, + .ram_regions[0].end = 0x20008000, .erase_reset = 1, }; diff --git a/source/family/nordic/nrf5x/flash_blob.c b/source/family/nordic/nrf5x/flash_blob.c index e2a7b95fca..1d50b84daf 100644 --- a/source/family/nordic/nrf5x/flash_blob.c +++ b/source/family/nordic/nrf5x/flash_blob.c @@ -3,7 +3,7 @@ * @brief Flash algorithm for the nrf51 * * DAPLink Interface Firmware - * Copyright (c) 2009-2016, ARM Limited, All Rights Reserved + * Copyright (c) 2009-2019, ARM Limited, All Rights Reserved * SPDX-License-Identifier: Apache-2.0 * * Licensed under the Apache License, Version 2.0 (the "License"); you may @@ -44,6 +44,17 @@ static const uint32_t nRF52832AA_FLM[] = { 0x40010404, 0x40010504, 0x6e524635, 0x00000000, }; +/** +* List of start and size for each size of flash sector +* The size will apply to all sectors between the listed address and the next address +* in the list. +* The last pair in the list will have sectors starting at that address and ending +* at address start + size. +*/ +static const sector_info_t sectors_info[] = { + {0, 1024}, + }; + static const program_target_t flash = { // Default is nrf51 .init = 0x20000021, .uninit = 0x20000025, @@ -63,6 +74,10 @@ static const program_target_t flash = { // Default is nrf51 .program_buffer_size = 512 // should be USBD_MSC_BlockSize }; +static const sector_info_t sectors_info_nrf52[] = { + {0, 4096}, + }; + static const program_target_t flash_nrf52 = { .init = 0x20000021, .uninit = 0x20000025, diff --git a/source/family/nordic/nrf5x/target.c b/source/family/nordic/nrf5x/target.c index 8575e2fd52..007a1ca0d3 100644 --- a/source/family/nordic/nrf5x/target.c +++ b/source/family/nordic/nrf5x/target.c @@ -3,7 +3,7 @@ * @brief Target information for the nrf51 * * DAPLink Interface Firmware - * Copyright (c) 2009-2016, ARM Limited, All Rights Reserved + * Copyright (c) 2009-2019, ARM Limited, All Rights Reserved * SPDX-License-Identifier: Apache-2.0 * * Licensed under the Apache License, Version 2.0 (the "License"); you may @@ -26,56 +26,61 @@ // target information target_cfg_t target_device = { // Default is nRF51 - .sector_size = 1024, - .sector_cnt = (KB(256) / 1024), - .flash_start = 0, - .flash_end = KB(256), - .ram_start = 0x20000000, - .ram_end = 0x20004000, - .flash_algo = (program_target_t *) &flash, - .erase_reset = 1, + .sectors_info = sectors_info, + .sector_info_length = (sizeof(sectors_info))/(sizeof(sector_info_t)), + .flash_regions[0].start = 0, + .flash_regions[0].end = KB(256), + .flash_regions[0].flags = kRegionIsDefault, + .flash_regions[0].flash_algo = (program_target_t *) &flash, + .ram_regions[0].start = 0x20000000, + .ram_regions[0].end = 0x20004000, + .erase_reset = 1, }; target_cfg_t target_device_nrf52 = { - .sector_size = 4096, - .sector_cnt = (KB(512) / 4096), - .flash_start = 0, - .flash_end = KB(512), - .ram_start = 0x20000000, - .ram_end = 0x20008000, - .flash_algo = (program_target_t *) &flash_nrf52, - .erase_reset = 1, + .sectors_info = sectors_info_nrf52, + .sector_info_length = (sizeof(sectors_info_nrf52))/(sizeof(sectors_info_nrf52)), + .flash_regions[0].start = 0, + .flash_regions[0].end = KB(512), + .flash_regions[0].flags = kRegionIsDefault, + .flash_regions[0].flash_algo = (program_target_t *) &flash_nrf52, + .ram_regions[0].start = 0x20000000, + .ram_regions[0].end = 0x20008000, + .erase_reset = 1, }; target_cfg_t target_device_nrf52840 = { - .sector_size = 4096, - .sector_cnt = (KB(1024) / 4096), - .flash_start = 0, - .flash_end = KB(1024), - .ram_start = 0x20000000, - .ram_end = 0x20008000, - .flash_algo = (program_target_t *) &flash_nrf52, - .erase_reset = 1, + .sectors_info = sectors_info_nrf52, + .sector_info_length = (sizeof(sectors_info_nrf52))/(sizeof(sectors_info_nrf52)), + .flash_regions[0].start = 0, + .flash_regions[0].end = KB(1024), + .flash_regions[0].flags = kRegionIsDefault, + .flash_regions[0].flash_algo = (program_target_t *) &flash_nrf52, + .ram_regions[0].start = 0x20000000, + .ram_regions[0].end = 0x20008000, + .erase_reset = 1, }; target_cfg_t target_device_nrf52840_256 = { - .sector_size = 4096, - .sector_cnt = (KB(1024) / 4096), - .flash_start = 0, - .flash_end = KB(1024), - .ram_start = 0x20000000, - .ram_end = 0x20040000, - .flash_algo = (program_target_t *) &flash_nrf52, - .erase_reset = 1, + .sectors_info = sectors_info_nrf52, + .sector_info_length = (sizeof(sectors_info_nrf52))/(sizeof(sectors_info_nrf52)), + .flash_regions[0].start = 0, + .flash_regions[0].end = KB(1024), + .flash_regions[0].flags = kRegionIsDefault, + .flash_regions[0].flash_algo = (program_target_t *) &flash_nrf52, + .ram_regions[0].start = 0x20000000, + .ram_regions[0].end = 0x20040000, + .erase_reset = 1, }; target_cfg_t target_device_nrf52_64 = { - .sector_size = 4096, - .sector_cnt = (KB(512) / 4096), - .flash_start = 0, - .flash_end = KB(512), - .ram_start = 0x20000000, - .ram_end = 0x20010000, - .flash_algo = (program_target_t *) &flash_nrf52, - .erase_reset = 1, + .sectors_info = sectors_info_nrf52, + .sector_info_length = (sizeof(sectors_info_nrf52))/(sizeof(sectors_info_nrf52)), + .flash_regions[0].start = 0, + .flash_regions[0].end = KB(512), + .flash_regions[0].flags = kRegionIsDefault, + .flash_regions[0].flash_algo = (program_target_t *) &flash_nrf52, + .ram_regions[0].start = 0x20000000, + .ram_regions[0].end = 0x20010000, + .erase_reset = 1, }; diff --git a/source/family/nxp/lpc1114/flash_blob.c b/source/family/nxp/lpc1114/flash_blob.c index f467766f03..d8e0cb83c5 100644 --- a/source/family/nxp/lpc1114/flash_blob.c +++ b/source/family/nxp/lpc1114/flash_blob.c @@ -3,7 +3,7 @@ * @brief Flash algorithm for the lpc1114 * * DAPLink Interface Firmware - * Copyright (c) 2009-2016, ARM Limited, All Rights Reserved + * Copyright (c) 2009-2019, ARM Limited, All Rights Reserved * SPDX-License-Identifier: Apache-2.0 * * Licensed under the Apache License, Version 2.0 (the "License"); you may @@ -34,6 +34,17 @@ static const uint32_t LPC1114_FLM[] = { /*0x120*/ 0x696847b8, 0xd0002800, 0xbdf82001, 0x40048040, 0x00000004, 0x1fff1ff1, 0x00002ee0, 0x00000000, }; +/** +* List of start and size for each size of flash sector +* The size will apply to all sectors between the listed address and the next address +* in the list. +* The last pair in the list will have sectors starting at that address and ending +* at address start + size. +*/ +static const sector_info_t sectors_info[] = { + {0, 4096}, + }; + static const program_target_t flash = { 0x10000025, // Init 0x10000047, // UnInit diff --git a/source/family/nxp/lpc1114/target.c b/source/family/nxp/lpc1114/target.c index 8d9b041624..dbb1cecabc 100644 --- a/source/family/nxp/lpc1114/target.c +++ b/source/family/nxp/lpc1114/target.c @@ -3,7 +3,7 @@ * @brief Target information for the lpc1114 * * DAPLink Interface Firmware - * Copyright (c) 2009-2016, ARM Limited, All Rights Reserved + * Copyright (c) 2009-2019, ARM Limited, All Rights Reserved * SPDX-License-Identifier: Apache-2.0 * * Licensed under the Apache License, Version 2.0 (the "License"); you may @@ -26,11 +26,12 @@ // target information target_cfg_t target_device = { - .sector_size = 4096, - .sector_cnt = (KB(32) / 4096), - .flash_start = 0, - .flash_end = KB(32), - .ram_start = 0x10000000, - .ram_end = 0x10001000, - .flash_algo = (program_target_t *) &flash, + .sectors_info = sectors_info, + .sector_info_length = (sizeof(sectors_info))/(sizeof(sector_info_t)), + .flash_regions[0].start = 0, + .flash_regions[0].end = KB(32), + .flash_regions[0].flags = kRegionIsDefault, + .flash_regions[0].flash_algo = (program_target_t *) &flash, + .ram_regions[0].start = 0x10000000, + .ram_regions[0].end = 0x10001000, }; diff --git a/source/family/nxp/lpc1768/flash_blob.c b/source/family/nxp/lpc1768/flash_blob.c index 2a4c00eb23..7c49213710 100644 --- a/source/family/nxp/lpc1768/flash_blob.c +++ b/source/family/nxp/lpc1768/flash_blob.c @@ -3,7 +3,7 @@ * @brief Flash algorithm for the lpc1768 * * DAPLink Interface Firmware - * Copyright (c) 2009-2016, ARM Limited, All Rights Reserved + * Copyright (c) 2009-2019, ARM Limited, All Rights Reserved * SPDX-License-Identifier: Apache-2.0 * * Licensed under the Apache License, Version 2.0 (the "License"); you may @@ -38,6 +38,17 @@ static const uint32_t LPC1768_FLM[] = { /*0x180*/ 0x12345678, 0x87654321L, 0x0, 0x0 }; +/** +* List of start and size for each size of flash sector +* The size will apply to all sectors between the listed address and the next address +* in the list. +* The last pair in the list will have sectors starting at that address and ending +* at address start + size. +*/ +static const sector_info_t sectors_info[] = { + {0, 1024}, + }; + static const program_target_t flash = { 0x1000002f, // init 0x10000051, // uninit diff --git a/source/family/nxp/lpc1768/target.c b/source/family/nxp/lpc1768/target.c index 24f0fb7cf1..dcc29406d5 100644 --- a/source/family/nxp/lpc1768/target.c +++ b/source/family/nxp/lpc1768/target.c @@ -3,7 +3,7 @@ * @brief Target information for the lpc1768 * * DAPLink Interface Firmware - * Copyright (c) 2009-2016, ARM Limited, All Rights Reserved + * Copyright (c) 2009-2019, ARM Limited, All Rights Reserved * SPDX-License-Identifier: Apache-2.0 * * Licensed under the Apache License, Version 2.0 (the "License"); you may @@ -26,11 +26,12 @@ // target information target_cfg_t target_device = { - .sector_size = 1024, - .sector_cnt = (KB(512) / 1024), - .flash_start = 0, - .flash_end = KB(512), - .ram_start = 0x10000000, - .ram_end = 0x10008000, - .flash_algo = (program_target_t *) &flash, + .sectors_info = sectors_info, + .sector_info_length = (sizeof(sectors_info))/(sizeof(sector_info_t)), + .flash_regions[0].start = 0, + .flash_regions[0].end = KB(512), + .flash_regions[0].flags = kRegionIsDefault, + .flash_regions[0].flash_algo = (program_target_t *) &flash, + .ram_regions[0].start = 0x10000000, + .ram_regions[0].end = 0x10008000, }; diff --git a/source/family/nxp/lpc4088/flash_blob.c b/source/family/nxp/lpc4088/flash_blob.c index 6c0ed61182..62b623b256 100644 --- a/source/family/nxp/lpc4088/flash_blob.c +++ b/source/family/nxp/lpc4088/flash_blob.c @@ -3,7 +3,7 @@ * @brief Flash algorithm for the lpc4088 * * DAPLink Interface Firmware - * Copyright (c) 2009-2016, ARM Limited, All Rights Reserved + * Copyright (c) 2009-2019, ARM Limited, All Rights Reserved * SPDX-License-Identifier: Apache-2.0 * * Licensed under the Apache License, Version 2.0 (the "License"); you may @@ -54,6 +54,17 @@ static const uint32_t lpc4088_flash_prog_blob[] = { 0x00000001, 0x00000000, 0x00000000, 0x00000000, }; +/** +* List of start and size for each size of flash sector +* The size will apply to all sectors between the listed address and the next address +* in the list. +* The last pair in the list will have sectors starting at that address and ending +* at address start + size. +*/ +static const sector_info_t sectors_info[] = { + {0, KB(4)}, + }; + static const program_target_t flash = { 0x200000D5, // Init 0x200001D9, // UnInit diff --git a/source/family/nxp/lpc4088/target_lpc4088dm.c b/source/family/nxp/lpc4088/target_lpc4088dm.c index a872813943..4d7ce909e4 100644 --- a/source/family/nxp/lpc4088/target_lpc4088dm.c +++ b/source/family/nxp/lpc4088/target_lpc4088dm.c @@ -3,7 +3,7 @@ * @brief Target information for the lpc4088 * * DAPLink Interface Firmware - * Copyright (c) 2009-2016, ARM Limited, All Rights Reserved + * Copyright (c) 2009-2019, ARM Limited, All Rights Reserved * SPDX-License-Identifier: Apache-2.0 * * Licensed under the Apache License, Version 2.0 (the "License"); you may @@ -26,11 +26,12 @@ // The LPC4088 Display Module has 512K internal flash and 16M external QSPI flash target_cfg_t target_device = { - .sector_size = KB(4), - .sector_cnt = ((MB(16) + KB(512)) / KB(4)), - .flash_start = 0, - .flash_end = MB(16) + KB(512), - .ram_start = 0x10000000, - .ram_end = 0x10010000, - .flash_algo = (program_target_t *) &flash, + .sectors_info = sectors_info, + .sector_info_length = (sizeof(sectors_info))/(sizeof(sector_info_t)), + .flash_regions[0].start = 0, + .flash_regions[0].end = MB(16) + KB(512), + .flash_regions[0].flags = kRegionIsDefault, + .flash_regions[0].flash_algo = (program_target_t *) &flash, + .ram_regions[0].start = 0x10000000, + .ram_regions[0].end = 0x10010000, }; diff --git a/source/family/nxp/lpc4088/target_lpc4088qsb.c b/source/family/nxp/lpc4088/target_lpc4088qsb.c index d4e5656827..ef2f6ecfac 100644 --- a/source/family/nxp/lpc4088/target_lpc4088qsb.c +++ b/source/family/nxp/lpc4088/target_lpc4088qsb.c @@ -3,7 +3,7 @@ * @brief Target information for the lpc4088 * * DAPLink Interface Firmware - * Copyright (c) 2009-2016, ARM Limited, All Rights Reserved + * Copyright (c) 2009-2019, ARM Limited, All Rights Reserved * SPDX-License-Identifier: Apache-2.0 * * Licensed under the Apache License, Version 2.0 (the "License"); you may @@ -26,11 +26,12 @@ // The LPC4088 QuickStart Board has 512K internal flash and 8M external QSPI flash target_cfg_t target_device = { - .sector_size = KB(4), - .sector_cnt = ((MB(8) + KB(512)) / KB(4)), - .flash_start = 0, - .flash_end = MB(8) + KB(512), - .ram_start = 0x10000000, - .ram_end = 0x10010000, - .flash_algo = (program_target_t *) &flash, + .sectors_info = sectors_info, + .sector_info_length = (sizeof(sectors_info))/(sizeof(sector_info_t)), + .flash_regions[0].start = 0, + .flash_regions[0].end = MB(8) + KB(512), + .flash_regions[0].flags = kRegionIsDefault, + .flash_regions[0].flash_algo = (program_target_t *) &flash, + .ram_regions[0].start = 0x10000000, + .ram_regions[0].end = 0x10010000, }; diff --git a/source/family/nxp/lpc54018/flash_blob.c b/source/family/nxp/lpc54018/flash_blob.c index b7b4277c4c..0c984c2ef2 100644 --- a/source/family/nxp/lpc54018/flash_blob.c +++ b/source/family/nxp/lpc54018/flash_blob.c @@ -1,5 +1,5 @@ /* Flash OS Routines (Automagically Generated) - * Copyright (c) 2009-2015 ARM Limited + * Copyright (c) 2009-2019 ARM Limited * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -67,14 +67,14 @@ static const uint32_t flash_start = 0x10000000; static const uint32_t flash_size = 0x01000000; /** -* List of start and size for each size of flash sector - even indexes are start, odd are size +* List of start and size for each size of flash sector * The size will apply to all sectors between the listed address and the next address * in the list. * The last pair in the list will have sectors starting at that address and ending -* at address flash_start + flash_size. +* at address start + size. */ -static const uint32_t sectors_info[] = { - 0x10000000, 0x00001000, +static const sector_info_t sectors_info[] = { + {0x10000000, 0x00001000}, }; static const program_target_t flash = { diff --git a/source/family/nxp/lpc54018/target.c b/source/family/nxp/lpc54018/target.c index 142f7d5858..d4b01ac171 100644 --- a/source/family/nxp/lpc54018/target.c +++ b/source/family/nxp/lpc54018/target.c @@ -3,7 +3,7 @@ * @brief Target information for the lpc54018 * * DAPLink Interface Firmware - * Copyright (c) 2018, ARM Limited, All Rights Reserved + * Copyright (c) 2018-2019, ARM Limited, All Rights Reserved * SPDX-License-Identifier: Apache-2.0 * * Licensed under the Apache License, Version 2.0 (the "License"); you may @@ -26,11 +26,12 @@ // target information target_cfg_t target_device = { - .sector_size = 4096, - .sector_cnt = (MB(16) / 4096), - .flash_start = 0x10000000, - .flash_end = 0x11000000, - .ram_start = 0x00000000, - .ram_end = 0x00030000, - .flash_algo = (program_target_t *) &flash, + .sectors_info = sectors_info, + .sector_info_length = (sizeof(sectors_info))/(sizeof(sector_info_t)), + .flash_regions[0].start = 0x10000000, + .flash_regions[0].end = 0x11000000, + .flash_regions[0].flags = kRegionIsDefault, + .flash_regions[0].flash_algo = (program_target_t *) &flash, + .ram_regions[0].start = 0x00000000, + .ram_regions[0].end = 0x00030000, }; diff --git a/source/family/nxp/lpc54114/flash_blob.c b/source/family/nxp/lpc54114/flash_blob.c index feebb582fd..46fcbeff47 100644 --- a/source/family/nxp/lpc54114/flash_blob.c +++ b/source/family/nxp/lpc54114/flash_blob.c @@ -1,5 +1,5 @@ /* Flash OS Routines (Automagically Generated) - * Copyright (c) 2009-2015 ARM Limited + * Copyright (c) 2009-2019 ARM Limited * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -33,6 +33,17 @@ static const uint32_t lpc54114_flash_prog_blob[] = { 0x00000000 }; +/** +* List of start and size for each size of flash sector +* The size will apply to all sectors between the listed address and the next address +* in the list. +* The last pair in the list will have sectors starting at that address and ending +* at address start + size. +*/ +static const sector_info_t sectors_info[] = { + {0, 32768}, +}; + static const program_target_t flash = { 0x20000021, // Init 0x20000053, // UnInit diff --git a/source/family/nxp/lpc54114/target.c b/source/family/nxp/lpc54114/target.c index 6871874ee3..e26f366d5f 100644 --- a/source/family/nxp/lpc54114/target.c +++ b/source/family/nxp/lpc54114/target.c @@ -3,7 +3,7 @@ * @brief Target information for the lpc812 * * DAPLink Interface Firmware - * Copyright (c) 2009-2016, ARM Limited, All Rights Reserved + * Copyright (c) 2009-2019, ARM Limited, All Rights Reserved * SPDX-License-Identifier: Apache-2.0 * * Licensed under the Apache License, Version 2.0 (the "License"); you may @@ -26,11 +26,12 @@ // target information target_cfg_t target_device = { - .sector_size = 32768, - .sector_cnt = (KB(256) / 32768), - .flash_start = 0, - .flash_end = KB(256), - .ram_start = 0x20000000, - .ram_end = 0x20028000, - .flash_algo = (program_target_t *) &flash, + .sectors_info = sectors_info, + .sector_info_length = (sizeof(sectors_info))/(sizeof(sector_info_t)), + .flash_regions[0].start = 0, + .flash_regions[0].end = KB(256), + .flash_regions[0].flags = kRegionIsDefault, + .flash_regions[0].flash_algo = (program_target_t *) &flash, + .ram_regions[0].start = 0x20000000, + .ram_regions[0].end = 0x20028000, }; diff --git a/source/family/nxp/lpc54608/flash_blob.c b/source/family/nxp/lpc54608/flash_blob.c index 633021c4dd..dd0b7ac7bf 100644 --- a/source/family/nxp/lpc54608/flash_blob.c +++ b/source/family/nxp/lpc54608/flash_blob.c @@ -1,5 +1,5 @@ /* Flash OS Routines (Automagically Generated) - * Copyright (c) 2009-2015 ARM Limited + * Copyright (c) 2009-2019 ARM Limited * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -39,14 +39,14 @@ static const uint32_t flash_start = 0x00000000; static const uint32_t flash_size = 0x00080000; /** -* List of start and size for each size of flash sector - even indexes are start, odd are size +* List of start and size for each size of flash sector * The size will apply to all sectors between the listed address and the next address * in the list. * The last pair in the list will have sectors starting at that address and ending -* at address flash_start + flash_size. +* at address start + size. */ -static const uint32_t sectors_info[] = { - 0x00000000, 0x00008000, +static const sector_info_t sectors_info[] = { + {0x00000000, 0x00008000}, }; static const program_target_t flash = { diff --git a/source/family/nxp/lpc54608/target.c b/source/family/nxp/lpc54608/target.c index 2afe597f5f..bbe9e222a5 100644 --- a/source/family/nxp/lpc54608/target.c +++ b/source/family/nxp/lpc54608/target.c @@ -3,7 +3,7 @@ * @brief Target information for the lpc54608 * * DAPLink Interface Firmware - * Copyright (c) 2009-2016, ARM Limited, All Rights Reserved + * Copyright (c) 2009-2019, ARM Limited, All Rights Reserved * SPDX-License-Identifier: Apache-2.0 * * Licensed under the Apache License, Version 2.0 (the "License"); you may @@ -26,11 +26,12 @@ // target information target_cfg_t target_device = { - .sector_size = 32768, - .sector_cnt = (KB(512) / 32768), - .flash_start = 0, - .flash_end = KB(512), - .ram_start = 0x20000000, - .ram_end = 0x20028000, - .flash_algo = (program_target_t *) &flash, + .sectors_info = sectors_info, + .sector_info_length = (sizeof(sectors_info))/(sizeof(sector_info_t)), + .flash_regions[0].start = 0, + .flash_regions[0].end = KB(512), + .flash_regions[0].flags = kRegionIsDefault, + .flash_regions[0].flash_algo = (program_target_t *) &flash, + .ram_regions[0].start = 0x20000000, + .ram_regions[0].end = 0x20028000, }; diff --git a/source/family/nxp/lpc55S6X/flash_blob.c b/source/family/nxp/lpc55S6X/flash_blob.c index a4ad7d322a..86899b3e33 100644 --- a/source/family/nxp/lpc55S6X/flash_blob.c +++ b/source/family/nxp/lpc55S6X/flash_blob.c @@ -1,5 +1,5 @@ /* Flash OS Routines (Automagically Generated) - * Copyright (c) 2009-2015 ARM Limited + * Copyright (c) 2009-2019 ARM Limited * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -69,14 +69,14 @@ static const uint32_t flash_start = 0x00000000; static const uint32_t flash_size = 0x00098000; /** -* List of start and size for each size of flash sector - even indexes are start, odd are size +* List of start and size for each size of flash sector * The size will apply to all sectors between the listed address and the next address * in the list. * The last pair in the list will have sectors starting at that address and ending -* at address flash_start + flash_size. +* at address start + size. */ -static const uint32_t sectors_info[] = { - 0x00000000, 0x00008000, +static const sector_info_t sectors_info[] = { + {0x00000000, 0x00008000}, }; static const program_target_t flash = { diff --git a/source/family/nxp/lpc55S6X/target.c b/source/family/nxp/lpc55S6X/target.c index cb88a8c19a..cee0db0fec 100644 --- a/source/family/nxp/lpc55S6X/target.c +++ b/source/family/nxp/lpc55S6X/target.c @@ -3,7 +3,7 @@ * @brief Target information for the lpc55S6X * * DAPLink Interface Firmware - * Copyright (c) 2009-2016, ARM Limited, All Rights Reserved + * Copyright (c) 2009-2019, ARM Limited, All Rights Reserved * SPDX-License-Identifier: Apache-2.0 * * Licensed under the Apache License, Version 2.0 (the "License"); you may @@ -26,16 +26,17 @@ // target information target_cfg_t target_device = { - .sector_size = 32768, - .sector_cnt = (KB(608) / 32768), - .flash_start = 0, - .flash_end = KB(608), - .ram_start = 0x20000000, - .ram_end = 0x20044000, - .flash_algo = (program_target_t *) &flash, - .extra_flash[0].start = 0x10000000, - .extra_flash[0].end = 0x10000000 + KB(608), - .extra_flash[0].flash_algo = (program_target_t *) &flash, //each extra flash region requires a flash algo - .extra_ram[0].start = 0x30000000, - .extra_ram[0].end = 0x30000000 + 0x00044000, + .sectors_info = sectors_info, + .sector_info_length = (sizeof(sectors_info))/(sizeof(sector_info_t)), + .flash_regions[0].start = 0, + .flash_regions[0].end = KB(608), + .flash_regions[0].flags = kRegionIsDefault, + .flash_regions[0].flash_algo = (program_target_t *) &flash, + .flash_regions[1].start = 0x10000000, + .flash_regions[1].end = 0x10000000 + KB(608), + .flash_regions[1].flash_algo = (program_target_t *) &flash, + .ram_regions[0].start = 0x20000000, + .ram_regions[0].end = 0x20044000, + .ram_regions[1].start = 0x30000000, + .ram_regions[1].end = 0x30000000 + 0x00044000, }; diff --git a/source/family/nxp/lpc812/flash_blob.c b/source/family/nxp/lpc812/flash_blob.c index 1a07b20d3b..be1c15e920 100644 --- a/source/family/nxp/lpc812/flash_blob.c +++ b/source/family/nxp/lpc812/flash_blob.c @@ -3,7 +3,7 @@ * @brief Flash algorithm for the lpc812 * * DAPLink Interface Firmware - * Copyright (c) 2009-2016, ARM Limited, All Rights Reserved + * Copyright (c) 2009-2019, ARM Limited, All Rights Reserved * SPDX-License-Identifier: Apache-2.0 * * Licensed under the Apache License, Version 2.0 (the "License"); you may @@ -37,6 +37,17 @@ static const uint32_t LPC812_FLM[] = { /* 0x140 */ 0x4, 0x40048040, 0x8, 0x1fff1ff1 }; +/** +* List of start and size for each size of flash sector +* The size will apply to all sectors between the listed address and the next address +* in the list. +* The last pair in the list will have sectors starting at that address and ending +* at address start + size. +*/ +static const sector_info_t sectors_info[] = { + {0x00000000, 0x1000}, +}; + static const program_target_t flash = { 0x10000025, // init 0x10000049, // uninit diff --git a/source/family/nxp/lpc812/target.c b/source/family/nxp/lpc812/target.c index d6623ec784..21a41d7642 100644 --- a/source/family/nxp/lpc812/target.c +++ b/source/family/nxp/lpc812/target.c @@ -3,7 +3,7 @@ * @brief Target information for the lpc812 * * DAPLink Interface Firmware - * Copyright (c) 2009-2016, ARM Limited, All Rights Reserved + * Copyright (c) 2009-2019, ARM Limited, All Rights Reserved * SPDX-License-Identifier: Apache-2.0 * * Licensed under the Apache License, Version 2.0 (the "License"); you may @@ -26,11 +26,12 @@ // target information target_cfg_t target_device = { - .sector_size = 0x1000, - .sector_cnt = (KB(64) / 0x1000), - .flash_start = 0, - .flash_end = KB(64), - .ram_start = 0x10000000, - .ram_end = 0x10001000, - .flash_algo = (program_target_t *) &flash, + .sectors_info = sectors_info, + .sector_info_length = (sizeof(sectors_info))/(sizeof(sector_info_t)), + .flash_regions[0].start = 0, + .flash_regions[0].end = KB(64), + .flash_regions[0].flags = kRegionIsDefault, + .flash_regions[0].flash_algo = (program_target_t *) &flash, + .ram_regions[0].start = 0x10000000, + .ram_regions[0].end = 0x10001000, }; diff --git a/source/family/nxp/lpc824/flash_blob.c b/source/family/nxp/lpc824/flash_blob.c index 39e10bd9e4..51777484f3 100644 --- a/source/family/nxp/lpc824/flash_blob.c +++ b/source/family/nxp/lpc824/flash_blob.c @@ -3,7 +3,7 @@ * @brief Flash algorithm for the lpc824 * * DAPLink Interface Firmware - * Copyright (c) 2009-2016, ARM Limited, All Rights Reserved + * Copyright (c) 2009-2019, ARM Limited, All Rights Reserved * SPDX-License-Identifier: Apache-2.0 * * Licensed under the Apache License, Version 2.0 (the "License"); you may @@ -36,6 +36,17 @@ static const uint32_t LPC824_FLM[] = { /*0x140*/ }; +/** +* List of start and size for each size of flash sector +* The size will apply to all sectors between the listed address and the next address +* in the list. +* The last pair in the list will have sectors starting at that address and ending +* at address start + size. +*/ +static const sector_info_t sectors_info[] = { + {0, 1024}, +}; + static const program_target_t flash = { 0x10000025, // Init 0x10000047, // UnInit diff --git a/source/family/nxp/lpc824/target.c b/source/family/nxp/lpc824/target.c index cc16b186b6..e0acd0a293 100644 --- a/source/family/nxp/lpc824/target.c +++ b/source/family/nxp/lpc824/target.c @@ -3,7 +3,7 @@ * @brief Target information for the lpc824 * * DAPLink Interface Firmware - * Copyright (c) 2009-2016, ARM Limited, All Rights Reserved + * Copyright (c) 2009-2019, ARM Limited, All Rights Reserved * SPDX-License-Identifier: Apache-2.0 * * Licensed under the Apache License, Version 2.0 (the "License"); you may @@ -26,11 +26,12 @@ // target information target_cfg_t target_device = { - .sector_size = 1024, - .sector_cnt = (KB(32) / 1024), - .flash_start = 0, - .flash_end = KB(32), - .ram_start = 0x10000000, - .ram_end = 0x10002000, - .flash_algo = (program_target_t *) &flash, + .sectors_info = sectors_info, + .sector_info_length = (sizeof(sectors_info))/(sizeof(sector_info_t)), + .flash_regions[0].start = 0, + .flash_regions[0].end = KB(32), + .flash_regions[0].flags = kRegionIsDefault, + .flash_regions[0].flash_algo = (program_target_t *) &flash, + .ram_regions[0].start = 0x10000000, + .ram_regions[0].end = 0x10002000, }; diff --git a/source/family/onsemi/ncs36510/flash_blob.c b/source/family/onsemi/ncs36510/flash_blob.c index 96bfd5b3ee..4404022448 100644 --- a/source/family/onsemi/ncs36510/flash_blob.c +++ b/source/family/onsemi/ncs36510/flash_blob.c @@ -1,5 +1,5 @@ /* Flash OS Routines (Automagically Generated) - * Copyright (c) 2009-2015 ARM Limited + * Copyright (c) 2009-2019 ARM Limited * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -47,6 +47,17 @@ static const uint32_t ncs36510_flash_prog_blob[] = { 0x00000008, 0x00000000, 0x00000000, 0x00000000, 0x00000000 }; +/** +* List of start and size for each size of flash sector +* The size will apply to all sectors between the listed address and the next address +* in the list. +* The last pair in the list will have sectors starting at that address and ending +* at address start + size. +*/ +static const sector_info_t sectors_info[] = { + {0x00002000, 0x800}, +}; + static const program_target_t flash = { 0x3fff4259, // Init 0x3fff4299, // UnInit diff --git a/source/family/onsemi/ncs36510/target.c b/source/family/onsemi/ncs36510/target.c index cc92db6cba..e14b9c6240 100644 --- a/source/family/onsemi/ncs36510/target.c +++ b/source/family/onsemi/ncs36510/target.c @@ -21,14 +21,12 @@ // target information target_cfg_t target_device = { - .sector_size = 0x800, - // Assume memory is regions are same size. Flash algo should ignore requests - // when variable sized sectors exist - // .sector_cnt = ((.flash_end - .flash_start) / .sector_size); - .sector_cnt = 0x0000002A0, - .flash_start = 0x00002000, - .flash_end = 0x00151FFF, - .ram_start = 0x3FFF4000, - .ram_end = 0x3FFFFFFF, - .flash_algo = (program_target_t*)&flash, + .sectors_info = sectors_info, + .sector_info_length = (sizeof(sectors_info))/(sizeof(sector_info_t)), + .flash_regions[0].start = 0x00002000, + .flash_regions[0].end = 0x00151FFF, + .flash_regions[0].flags = kRegionIsDefault, + .flash_regions[0].flash_algo = (program_target_t *) &flash, + .ram_regions[0].start = 0x3FFF4000, + .ram_regions[0].end = 0x3FFFFFFF, }; diff --git a/source/family/realtek/rtl8195am/flash_blob.c b/source/family/realtek/rtl8195am/flash_blob.c index 5599cf0812..e5a3fac577 100644 --- a/source/family/realtek/rtl8195am/flash_blob.c +++ b/source/family/realtek/rtl8195am/flash_blob.c @@ -1,5 +1,5 @@ /* Flash OS Routines (Automagically Generated) - * Copyright (c) 2009-2015 ARM Limited + * Copyright (c) 2009-2019 ARM Limited * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -63,6 +63,17 @@ static const uint32_t rtl8195am_flash_prog_blob[] = { 0x00000000, 0x00000000, 0x005e0101, 0x00000101, 0x00230201, 0x00050501 }; +/** +* List of start and size for each size of flash sector +* The size will apply to all sectors between the listed address and the next address +* in the list. +* The last pair in the list will have sectors starting at that address and ending +* at address start + size. +*/ +static const sector_info_t sectors_info[] = { + {0, KB(4)}, +}; + static const program_target_t flash = { 0x10007237, // Init 0x10007353, // UnInit diff --git a/source/family/realtek/rtl8195am/target.c b/source/family/realtek/rtl8195am/target.c index 585d4cf00c..845fd160cb 100644 --- a/source/family/realtek/rtl8195am/target.c +++ b/source/family/realtek/rtl8195am/target.c @@ -3,7 +3,7 @@ * @brief Target information for Realtek RTL8195AM * * DAPLink Interface Firmware - * Copyright (c) 2016-2017, Realtek Semiconductor Corp., All Rights Reserved + * Copyright (c) 2016-2019, Realtek Semiconductor Corp., All Rights Reserved * SPDX-License-Identifier: Apache-2.0 * * Licensed under the Apache License, Version 2.0 (the "License"); you may @@ -26,14 +26,14 @@ // target information target_cfg_t target_device = { - .sector_size = KB(4), - .sector_cnt = MB(2) / KB(4), - .flash_start = 0x00000000, - .flash_end = 0x00000000 + MB(2), - .ram_start = 0x10007000, - .ram_end = 0x10070000, - .flash_algo = (program_target_t *) &flash, - .erase_reset = 0, + .sectors_info = sectors_info, + .sector_info_length = (sizeof(sectors_info))/(sizeof(sector_info_t)), + .flash_regions[0].start = 0x00000000, + .flash_regions[0].end = 0x00000000 + MB(2), + .flash_regions[0].flags = kRegionIsDefault, + .flash_regions[0].flash_algo = (program_target_t *) &flash, + .ram_regions[0].start = 0x10007000, + .ram_regions[0].end = 0x10070000, }; // RTL8195AM's main cpu can only talk 38400 with DAP UART diff --git a/source/family/renesas/rza1h/gr-peach/flash_blob.c b/source/family/renesas/rza1h/gr-peach/flash_blob.c index 44de2eb232..844e91c1d3 100644 --- a/source/family/renesas/rza1h/gr-peach/flash_blob.c +++ b/source/family/renesas/rza1h/gr-peach/flash_blob.c @@ -1,5 +1,5 @@ /* Flash OS Routines (Automagically Generated) - * Copyright (c) 2009-2015 ARM Limited + * Copyright (c) 2009-2019 ARM Limited * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -80,14 +80,14 @@ static const uint32_t flash_start = 0x18000000; static const uint32_t flash_size = 0x00800000; /** -* List of start and size for each size of flash sector - even indexes are start, odd are size +* List of start and size for each size of flash sector * The size will apply to all sectors between the listed address and the next address * in the list. * The last pair in the list will have sectors starting at that address and ending -* at address flash_start + flash_size. +* at address start + size. */ -static const uint32_t sectors_info[] = { - 0x18000000, 0x00001000, +static const sector_info_t sectors_info[] = { + {0, KB(4)}, }; static const program_target_t flash = { diff --git a/source/family/renesas/rza1h/gr-peach/target.c b/source/family/renesas/rza1h/gr-peach/target.c index cd0b4c5ecc..9ef6c4a6fa 100644 --- a/source/family/renesas/rza1h/gr-peach/target.c +++ b/source/family/renesas/rza1h/gr-peach/target.c @@ -3,7 +3,7 @@ * @brief Target information for the GR-PEACH * * DAPLink Interface Firmware - * Copyright (c) 2009-2016, ARM Limited, All Rights Reserved + * Copyright (c) 2009-2019, ARM Limited, All Rights Reserved * SPDX-License-Identifier: Apache-2.0 * * Licensed under the Apache License, Version 2.0 (the "License"); you may @@ -26,11 +26,12 @@ // target information target_cfg_t target_device = { - .sector_size = KB(4), - .sector_cnt = (MB(8) / KB(4)), - .flash_start = 0, - .flash_end = MB(8), - .ram_start = 0x20000000, - .ram_end = 0x20A00000, - .flash_algo = (program_target_t *) &flash, + .sectors_info = sectors_info, + .sector_info_length = (sizeof(sectors_info))/(sizeof(sector_info_t)), + .flash_regions[0].start = 0, + .flash_regions[0].end = MB(8), + .flash_regions[0].flags = kRegionIsDefault, + .flash_regions[0].flash_algo = (program_target_t *) &flash, + .ram_regions[0].start = 0x20000000, + .ram_regions[0].end = 0x20A00000, }; diff --git a/source/family/renesas/rza1lu/gr-lychee/flash_blob.c b/source/family/renesas/rza1lu/gr-lychee/flash_blob.c index ced2e23de3..3acb302d78 100644 --- a/source/family/renesas/rza1lu/gr-lychee/flash_blob.c +++ b/source/family/renesas/rza1lu/gr-lychee/flash_blob.c @@ -1,5 +1,5 @@ /* Flash OS Routines (Automagically Generated) - * Copyright (c) 2009-2015 ARM Limited + * Copyright (c) 2009-2019 ARM Limited * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -83,14 +83,14 @@ static const uint32_t flash_start = 0x18000000; static const uint32_t flash_size = 0x00800000; /** -* List of start and size for each size of flash sector - even indexes are start, odd are size +* List of start and size for each size of flash sector * The size will apply to all sectors between the listed address and the next address * in the list. * The last pair in the list will have sectors starting at that address and ending -* at address flash_start + flash_size. +* at address start + size. */ -static const uint32_t sectors_info[] = { - 0x18000000, 0x00001000, +static const sector_info_t sectors_info[] = { + {0, KB(4)}, }; static const program_target_t flash = { diff --git a/source/family/renesas/rza1lu/gr-lychee/target.c b/source/family/renesas/rza1lu/gr-lychee/target.c index 7e401a2ee4..1377a6955e 100644 --- a/source/family/renesas/rza1lu/gr-lychee/target.c +++ b/source/family/renesas/rza1lu/gr-lychee/target.c @@ -3,7 +3,7 @@ * @brief Target information for the GR-LYCHEE * * DAPLink Interface Firmware - * Copyright (c) 2009-2016, ARM Limited, All Rights Reserved + * Copyright (c) 2009-2019, ARM Limited, All Rights Reserved * SPDX-License-Identifier: Apache-2.0 * * Licensed under the Apache License, Version 2.0 (the "License"); you may @@ -26,11 +26,12 @@ // target information target_cfg_t target_device = { - .sector_size = KB(4), - .sector_cnt = (MB(8) / KB(4)), - .flash_start = 0, - .flash_end = MB(8), - .ram_start = 0x20000000, - .ram_end = 0x20300000, - .flash_algo = (program_target_t *) &flash, + .sectors_info = sectors_info, + .sector_info_length = (sizeof(sectors_info))/(sizeof(sector_info_t)), + .flash_regions[0].start = 0, + .flash_regions[0].end = MB(8), + .flash_regions[0].flags = kRegionIsDefault, + .flash_regions[0].flash_algo = (program_target_t *) &flash, + .ram_regions[0].start = 0x20000000, + .ram_regions[0].end = 0x20300000, }; diff --git a/source/family/siliconlabs/efm32gg/flash_blob.c b/source/family/siliconlabs/efm32gg/flash_blob.c index b00977c065..1da2c4d2cd 100644 --- a/source/family/siliconlabs/efm32gg/flash_blob.c +++ b/source/family/siliconlabs/efm32gg/flash_blob.c @@ -3,7 +3,7 @@ * @brief Flash algorithm for the efm32gg * * DAPLink Interface Firmware - * Copyright (c) 2009-2016, ARM Limited, All Rights Reserved + * Copyright (c) 2009-2019, ARM Limited, All Rights Reserved * SPDX-License-Identifier: Apache-2.0 * * Licensed under the Apache License, Version 2.0 (the "License"); you may @@ -46,6 +46,17 @@ static const uint32_t efm32gg_flash_prog_blob[] = { 0x0105f021, 0x20006081, 0x00004770, 0x400c0000, 0x00000000, }; +/** +* List of start and size for each size of flash sector +* The size will apply to all sectors between the listed address and the next address +* in the list. +* The last pair in the list will have sectors starting at that address and ending +* at address start + size. +*/ +static const sector_info_t sectors_info[] = { + {0, 4096}, +}; + static const program_target_t flash = { 0x200000B5, // Init 0x2000029D, // UnInit diff --git a/source/family/siliconlabs/efm32gg/target.c b/source/family/siliconlabs/efm32gg/target.c index d3c4840d83..3304f6ef02 100644 --- a/source/family/siliconlabs/efm32gg/target.c +++ b/source/family/siliconlabs/efm32gg/target.c @@ -3,7 +3,7 @@ * @brief Target information for the efm32gg * * DAPLink Interface Firmware - * Copyright (c) 2009-2016, ARM Limited, All Rights Reserved + * Copyright (c) 2009-2019, ARM Limited, All Rights Reserved * SPDX-License-Identifier: Apache-2.0 * * Licensed under the Apache License, Version 2.0 (the "License"); you may @@ -26,11 +26,12 @@ // target information target_cfg_t target_device = { - .sector_size = 4096, - .sector_cnt = (MB(1) / 4096), - .flash_start = 0, - .flash_end = MB(1), - .ram_start = 0x20000000, - .ram_end = 0x20010000, - .flash_algo = (program_target_t *) &flash, + .sectors_info = sectors_info, + .sector_info_length = (sizeof(sectors_info))/(sizeof(sector_info_t)), + .flash_regions[0].start = 0, + .flash_regions[0].end = MB(1), + .flash_regions[0].flags = kRegionIsDefault, + .flash_regions[0].flash_algo = (program_target_t *) &flash, + .ram_regions[0].start = 0x20000000, + .ram_regions[0].end = 0x20010000, }; diff --git a/source/family/st/nz32_sc151/flash_blob.c b/source/family/st/nz32_sc151/flash_blob.c index 7c69da291c..2aac74eac1 100644 --- a/source/family/st/nz32_sc151/flash_blob.c +++ b/source/family/st/nz32_sc151/flash_blob.c @@ -1,5 +1,5 @@ /* Flash OS Routines (Automagically Generated) - * Copyright (c) 2009-2017 ARM Limited + * Copyright (c) 2009-2019 ARM Limited * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -41,6 +41,17 @@ static const uint32_t stm32l1xx_256_flash_prog_blob[] = { 0x40023c04, 0x40023c10, 0x08040000, 0x00000000 }; +/** +* List of start and size for each size of flash sector +* The size will apply to all sectors between the listed address and the next address +* in the list. +* The last pair in the list will have sectors starting at that address and ending +* at address start + size. +*/ +static const sector_info_t sectors_info[] = { + {0x08000000, 256}, +}; + static const program_target_t flash = { 0x20000021, // Init 0x2000006d, // UnInit diff --git a/source/family/st/nz32_sc151/target.c b/source/family/st/nz32_sc151/target.c index 5a2452f5e1..310d0b28d5 100644 --- a/source/family/st/nz32_sc151/target.c +++ b/source/family/st/nz32_sc151/target.c @@ -3,7 +3,7 @@ * @brief Target information for the stm32l151 * * DAPLink Interface Firmware - * Copyright (c) 2009-2017, ARM Limited, All Rights Reserved + * Copyright (c) 2009-2019, ARM Limited, All Rights Reserved * SPDX-License-Identifier: Apache-2.0 * * Licensed under the Apache License, Version 2.0 (the "License"); you may @@ -26,11 +26,12 @@ // target information target_cfg_t target_device = { - .sector_size = 256, - .sector_cnt = KB(1), - .flash_start = 0x08000000, - .flash_end = 0x08000000 + KB(256), - .ram_start = 0x20000000, - .ram_end = 0x20000000 + KB(32), - .flash_algo = (program_target_t *) &flash, + .sectors_info = sectors_info, + .sector_info_length = (sizeof(sectors_info))/(sizeof(sector_info_t)), + .flash_regions[0].start = 0x08000000, + .flash_regions[0].end = 0x08000000 + KB(256), + .flash_regions[0].flags = kRegionIsDefault, + .flash_regions[0].flash_algo = (program_target_t *) &flash, + .ram_regions[0].start = 0x20000000, + .ram_regions[0].end = 0x20000000 + KB(32), }; diff --git a/source/family/st/stm32f072rb/flash_blob.c b/source/family/st/stm32f072rb/flash_blob.c index 6a5cd3d4c2..0e1fc5051b 100644 --- a/source/family/st/stm32f072rb/flash_blob.c +++ b/source/family/st/stm32f072rb/flash_blob.c @@ -1,5 +1,5 @@ /* Flash OS Routines (Automagically Generated) - * Copyright (c) 2009-2015 ARM Limited + * Copyright (c) 2009-2019 ARM Limited * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -28,6 +28,17 @@ static const uint32_t STM32F072RB_flash_prog_blob[] = { 0xcdef89ab, 0x00005555, 0x40003000, 0x00000fff, 0x0000aaaa, 0x00000000 }; +/** +* List of start and size for each size of flash sector +* The size will apply to all sectors between the listed address and the next address +* in the list. +* The last pair in the list will have sectors starting at that address and ending +* at address start + size. +*/ +static const sector_info_t sectors_info[] = { + {0x08000000, 0x400}, +}; + static const program_target_t flash = { 0x20000021, // Init 0x2000004f, // UnInit diff --git a/source/family/st/stm32f072rb/target.c b/source/family/st/stm32f072rb/target.c index b486406949..bfa98cb481 100644 --- a/source/family/st/stm32f072rb/target.c +++ b/source/family/st/stm32f072rb/target.c @@ -3,7 +3,7 @@ * @brief Target information for the * * DAPLink Interface Firmware - * Copyright (c) 2017-2017, ARM Limited, All Rights Reserved + * Copyright (c) 2017-2019, ARM Limited, All Rights Reserved * SPDX-License-Identifier: Apache-2.0 * * Licensed under the Apache License, Version 2.0 (the "License"); you may @@ -26,11 +26,12 @@ // target information target_cfg_t target_device = { - .sector_size = 0x400, - .sector_cnt = (0x20000 / 0x400), - .flash_start = 0x08000000, - .flash_end = 0x08020000, - .ram_start = 0x20000000, - .ram_end = 0x20004000, - .flash_algo = (program_target_t *) &flash, + .sectors_info = sectors_info, + .sector_info_length = (sizeof(sectors_info))/(sizeof(sector_info_t)), + .flash_regions[0].start = 0x08000000, + .flash_regions[0].end = 0x08020000, + .flash_regions[0].flags = kRegionIsDefault, + .flash_regions[0].flash_algo = (program_target_t *) &flash, + .ram_regions[0].start = 0x20000000, + .ram_regions[0].end = 0x20004000, }; diff --git a/source/family/st/stm32f103rb/flash_blob.c b/source/family/st/stm32f103rb/flash_blob.c index 55b2a15589..2f83aad827 100644 --- a/source/family/st/stm32f103rb/flash_blob.c +++ b/source/family/st/stm32f103rb/flash_blob.c @@ -1,5 +1,5 @@ /* Flash OS Routines (Automagically Generated) - * Copyright (c) 2009-2015 ARM Limited + * Copyright (c) 2009-2019 ARM Limited * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -28,6 +28,17 @@ static const uint32_t STM32F103RB_flash_prog_blob[] = { 0xcdef89ab, 0x40003000, 0x00000000 }; +/** +* List of start and size for each size of flash sector +* The size will apply to all sectors between the listed address and the next address +* in the list. +* The last pair in the list will have sectors starting at that address and ending +* at address start + size. +*/ +static const sector_info_t sectors_info[] = { + {0x08000000, 0x400}, +}; + static const program_target_t flash = { 0x20000021, // Init 0x20000053, // UnInit diff --git a/source/family/st/stm32f103rb/target.c b/source/family/st/stm32f103rb/target.c index 1c0b02354c..d1b3bba108 100644 --- a/source/family/st/stm32f103rb/target.c +++ b/source/family/st/stm32f103rb/target.c @@ -3,7 +3,7 @@ * @brief Target information for the * * DAPLink Interface Firmware - * Copyright (c) 2017-2017, ARM Limited, All Rights Reserved + * Copyright (c) 2017-2019, ARM Limited, All Rights Reserved * SPDX-License-Identifier: Apache-2.0 * * Licensed under the Apache License, Version 2.0 (the "License"); you may @@ -26,11 +26,12 @@ // target information target_cfg_t target_device = { - .sector_size = 0x400, - .sector_cnt = (0x20000 / 0x400), - .flash_start = 0x08000000, - .flash_end = 0x08020000, - .ram_start = 0x20000000, - .ram_end = 0x20005000, - .flash_algo = (program_target_t *) &flash, + .sectors_info = sectors_info, + .sector_info_length = (sizeof(sectors_info))/(sizeof(sector_info_t)), + .flash_regions[0].start = 0x08000000, + .flash_regions[0].end = 0x08020000, + .flash_regions[0].flags = kRegionIsDefault, + .flash_regions[0].flash_algo = (program_target_t *) &flash, + .ram_regions[0].start = 0x20000000, + .ram_regions[0].end = 0x20005000, }; diff --git a/source/family/st/stm32f207zg/flash_blob.c b/source/family/st/stm32f207zg/flash_blob.c index 5802817954..cd3ec68d8d 100644 --- a/source/family/st/stm32f207zg/flash_blob.c +++ b/source/family/st/stm32f207zg/flash_blob.c @@ -1,5 +1,5 @@ /* Flash OS Routines (Automagically Generated) - * Copyright (c) 2009-2015 ARM Limited + * Copyright (c) 2009-2019 ARM Limited * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -29,6 +29,17 @@ static const uint32_t STM32F207ZG_flash_prog_blob[] = { 0x00000201, 0x00000000 }; +/** +* List of start and size for each size of flash sector +* The size will apply to all sectors between the listed address and the next address +* in the list. +* The last pair in the list will have sectors starting at that address and ending +* at address start + size. +*/ +static const sector_info_t sectors_info[] = { + {0x08000000, 0x4000}, +}; + static const program_target_t flash = { 0x2000003d, // Init 0x2000006b, // UnInit diff --git a/source/family/st/stm32f207zg/target.c b/source/family/st/stm32f207zg/target.c index 80f7499e2b..ce076e435c 100644 --- a/source/family/st/stm32f207zg/target.c +++ b/source/family/st/stm32f207zg/target.c @@ -3,7 +3,7 @@ * @brief Target information for the * * DAPLink Interface Firmware - * Copyright (c) 2017-2017, ARM Limited, All Rights Reserved + * Copyright (c) 2017-2019, ARM Limited, All Rights Reserved * SPDX-License-Identifier: Apache-2.0 * * Licensed under the Apache License, Version 2.0 (the "License"); you may @@ -26,11 +26,12 @@ // target information target_cfg_t target_device = { - .sector_size = 0x4000, - .sector_cnt = (0x100000 / 0x4000), - .flash_start = 0x08000000, - .flash_end = 0x08100000, - .ram_start = 0x20000000, - .ram_end = 0x20020000, - .flash_algo = (program_target_t *) &flash, + .sectors_info = sectors_info, + .sector_info_length = (sizeof(sectors_info))/(sizeof(sector_info_t)), + .flash_regions[0].start = 0x08000000, + .flash_regions[0].end = 0x08100000, + .flash_regions[0].flags = kRegionIsDefault, + .flash_regions[0].flash_algo = (program_target_t *) &flash, + .ram_regions[0].start = 0x20000000, + .ram_regions[0].end = 0x20020000, }; diff --git a/source/family/st/stm32f334r8/flash_blob.c b/source/family/st/stm32f334r8/flash_blob.c index d20e7b65cb..09b768972f 100644 --- a/source/family/st/stm32f334r8/flash_blob.c +++ b/source/family/st/stm32f334r8/flash_blob.c @@ -1,5 +1,5 @@ /* Flash OS Routines (Automagically Generated) - * Copyright (c) 2009-2015 ARM Limited + * Copyright (c) 2009-2019 ARM Limited * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -26,6 +26,17 @@ static const uint32_t STM32F334R8_flash_prog_blob[] = { 0x40022000, 0xcdef89ab, 0x00005555, 0x40003000, 0x00000fff, 0x0000aaaa, 0x00000000 }; +/** +* List of start and size for each size of flash sector +* The size will apply to all sectors between the listed address and the next address +* in the list. +* The last pair in the list will have sectors starting at that address and ending +* at address start + size. +*/ +static const sector_info_t sectors_info[] = { + {0x08000000, 0x800}, +}; + static const program_target_t flash = { 0x20000021, // Init 0x2000004f, // UnInit diff --git a/source/family/st/stm32f334r8/target.c b/source/family/st/stm32f334r8/target.c index 185a2c0a5e..858ed83b44 100644 --- a/source/family/st/stm32f334r8/target.c +++ b/source/family/st/stm32f334r8/target.c @@ -3,7 +3,7 @@ * @brief Target information for the * * DAPLink Interface Firmware - * Copyright (c) 2017-2017, ARM Limited, All Rights Reserved + * Copyright (c) 2017-2019, ARM Limited, All Rights Reserved * SPDX-License-Identifier: Apache-2.0 * * Licensed under the Apache License, Version 2.0 (the "License"); you may @@ -26,11 +26,12 @@ // target information target_cfg_t target_device = { - .sector_size = 0x800, - .sector_cnt = (0x10000 / 0x800), - .flash_start = 0x08000000, - .flash_end = 0x08010000, - .ram_start = 0x20000000, - .ram_end = 0x20003000, - .flash_algo = (program_target_t *) &flash, + .sectors_info = sectors_info, + .sector_info_length = (sizeof(sectors_info))/(sizeof(sector_info_t)), + .flash_regions[0].start = 0x08000000, + .flash_regions[0].end = 0x08010000, + .flash_regions[0].flags = kRegionIsDefault, + .flash_regions[0].flash_algo = (program_target_t *) &flash, + .ram_regions[0].start = 0x20000000, + .ram_regions[0].end = 0x20003000, }; diff --git a/source/family/st/stm32f401re/flash_blob.c b/source/family/st/stm32f401re/flash_blob.c index eda188cf98..3c7a4743f3 100644 --- a/source/family/st/stm32f401re/flash_blob.c +++ b/source/family/st/stm32f401re/flash_blob.c @@ -1,5 +1,5 @@ /* Flash OS Routines (Automagically Generated) - * Copyright (c) 2009-2015 ARM Limited + * Copyright (c) 2009-2019 ARM Limited * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -29,6 +29,17 @@ static const uint32_t STM32F401RE_flash_prog_blob[] = { 0x00000fff, 0x0000aaaa, 0x00000201, 0x00000000 }; +/** +* List of start and size for each size of flash sector +* The size will apply to all sectors between the listed address and the next address +* in the list. +* The last pair in the list will have sectors starting at that address and ending +* at address start + size. +*/ +static const sector_info_t sectors_info[] = { + {0x08000000, 0x4000}, +}; + static const program_target_t flash = { 0x20000047, // Init 0x20000075, // UnInit diff --git a/source/family/st/stm32f401re/target.c b/source/family/st/stm32f401re/target.c index 212aac5b91..3d4d35c8eb 100644 --- a/source/family/st/stm32f401re/target.c +++ b/source/family/st/stm32f401re/target.c @@ -3,7 +3,7 @@ * @brief Target information for the * * DAPLink Interface Firmware - * Copyright (c) 2017-2017, ARM Limited, All Rights Reserved + * Copyright (c) 2017-2019, ARM Limited, All Rights Reserved * SPDX-License-Identifier: Apache-2.0 * * Licensed under the Apache License, Version 2.0 (the "License"); you may @@ -26,11 +26,12 @@ // target information target_cfg_t target_device = { - .sector_size = 0x4000, - .sector_cnt = (0x80000 / 0x4000), - .flash_start = 0x08000000, - .flash_end = 0x08080000, - .ram_start = 0x20000000, - .ram_end = 0x20018000, - .flash_algo = (program_target_t *) &flash, + .sectors_info = sectors_info, + .sector_info_length = (sizeof(sectors_info))/(sizeof(sector_info_t)), + .flash_regions[0].start = 0x08000000, + .flash_regions[0].end = 0x08080000, + .flash_regions[0].flags = kRegionIsDefault, + .flash_regions[0].flash_algo = (program_target_t *) &flash, + .ram_regions[0].start = 0x20000000, + .ram_regions[0].end = 0x20018000, }; diff --git a/source/family/st/stm32f407/flash_blob.c b/source/family/st/stm32f407/flash_blob.c index 9aa7c30726..246e90c68e 100644 --- a/source/family/st/stm32f407/flash_blob.c +++ b/source/family/st/stm32f407/flash_blob.c @@ -3,7 +3,7 @@ * @brief Flash algorithm for the stm32f407 * * DAPLink Interface Firmware - * Copyright (c) 2009-2016, ARM Limited, All Rights Reserved + * Copyright (c) 2009-2019, ARM Limited, All Rights Reserved * SPDX-License-Identifier: Apache-2.0 * * Licensed under the Apache License, Version 2.0 (the "License"); you may @@ -38,6 +38,17 @@ static const uint32_t STM32F407_FLM[] = { /*0x160*/ 0x201, 0x0, }; +/** +* List of start and size for each size of flash sector +* The size will apply to all sectors between the listed address and the next address +* in the list. +* The last pair in the list will have sectors starting at that address and ending +* at address start + size. +*/ +static const sector_info_t sectors_info[] = { + {0x08000000, 1024}, +}; + static const program_target_t flash = { 0x2000003D, // Init 0x2000006B, // UnInit diff --git a/source/family/st/stm32f407/target.c b/source/family/st/stm32f407/target.c index a7f853a697..c526e8f883 100644 --- a/source/family/st/stm32f407/target.c +++ b/source/family/st/stm32f407/target.c @@ -3,7 +3,7 @@ * @brief Target information for the stm32f407 * * DAPLink Interface Firmware - * Copyright (c) 2009-2016, ARM Limited, All Rights Reserved + * Copyright (c) 2009-2019, ARM Limited, All Rights Reserved * SPDX-License-Identifier: Apache-2.0 * * Licensed under the Apache License, Version 2.0 (the "License"); you may @@ -26,11 +26,12 @@ // target information target_cfg_t target_device = { - .sector_size = 1024, - .sector_cnt = (0x100000 / 1024), - .flash_start = 0x08000000, - .flash_end = 0x08100000, - .ram_start = 0x20000000, - .ram_end = 0x20020000, - .flash_algo = (program_target_t *) &flash, + .sectors_info = sectors_info, + .sector_info_length = (sizeof(sectors_info))/(sizeof(sector_info_t)), + .flash_regions[0].start = 0x08000000, + .flash_regions[0].end = 0x08100000, + .flash_regions[0].flags = kRegionIsDefault, + .flash_regions[0].flash_algo = (program_target_t *) &flash, + .ram_regions[0].start = 0x20000000, + .ram_regions[0].end = 0x20020000, }; diff --git a/source/family/st/stm32f411/flash_blob.c b/source/family/st/stm32f411/flash_blob.c index 5d7ebd4431..849993612c 100644 --- a/source/family/st/stm32f411/flash_blob.c +++ b/source/family/st/stm32f411/flash_blob.c @@ -3,7 +3,7 @@ * @brief Flash algorithm for the stm32f411 * * DAPLink Interface Firmware - * Copyright (c) 2009-2016, ARM Limited, All Rights Reserved + * Copyright (c) 2009-2019, ARM Limited, All Rights Reserved * SPDX-License-Identifier: Apache-2.0 * * Licensed under the Apache License, Version 2.0 (the "License"); you may @@ -36,6 +36,17 @@ static const uint32_t output_flash_prog_blob[] = { 0x00000fff, 0x0000aaaa, 0x00000201, 0x00000000, }; +/** +* List of start and size for each size of flash sector +* The size will apply to all sectors between the listed address and the next address +* in the list. +* The last pair in the list will have sectors starting at that address and ending +* at address start + size. +*/ +static const sector_info_t sectors_info[] = { + {0x08000000, KB(16)}, +}; + static const program_target_t flash = { 0x20000047, // Init 0x20000075, // UnInit diff --git a/source/family/st/stm32f411/target.c b/source/family/st/stm32f411/target.c index 1243e57780..ed2f9fd1a5 100644 --- a/source/family/st/stm32f411/target.c +++ b/source/family/st/stm32f411/target.c @@ -3,7 +3,7 @@ * @brief Target information for the stm32f411 * * DAPLink Interface Firmware - * Copyright (c) 2009-2016, ARM Limited, All Rights Reserved + * Copyright (c) 2009-2019, ARM Limited, All Rights Reserved * SPDX-License-Identifier: Apache-2.0 * * Licensed under the Apache License, Version 2.0 (the "License"); you may @@ -26,11 +26,12 @@ // target information target_cfg_t target_device = { - .sector_size = KB(16), - .sector_cnt = 32, - .flash_start = 0x08000000, - .flash_end = 0x08000000 + KB(512), - .ram_start = 0x20000000, - .ram_end = 0x20020000, - .flash_algo = (program_target_t *) &flash, + .sectors_info = sectors_info, + .sector_info_length = (sizeof(sectors_info))/(sizeof(sector_info_t)), + .flash_regions[0].start = 0x08000000, + .flash_regions[0].end = 0x08000000 + KB(512), + .flash_regions[0].flags = kRegionIsDefault, + .flash_regions[0].flash_algo = (program_target_t *) &flash, + .ram_regions[0].start = 0x20000000, + .ram_regions[0].end = 0x20020000, }; diff --git a/source/family/st/stm32f412re/flash_blob.c b/source/family/st/stm32f412re/flash_blob.c index ae0953c717..68bf4b8151 100644 --- a/source/family/st/stm32f412re/flash_blob.c +++ b/source/family/st/stm32f412re/flash_blob.c @@ -1,5 +1,5 @@ /* Flash OS Routines (Automagically Generated) - * Copyright (c) 2009-2015 ARM Limited + * Copyright (c) 2009-2019 ARM Limited * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/source/family/st/stm32f412re/target.c b/source/family/st/stm32f412re/target.c index de53c7dd4d..9416b2f80c 100644 --- a/source/family/st/stm32f412re/target.c +++ b/source/family/st/stm32f412re/target.c @@ -3,7 +3,7 @@ * @brief Target information for the stm32f412re * * DAPLink Interface Firmware - * Copyright (c) 2017-2017, ARM Limited, All Rights Reserved + * Copyright (c) 2017-2019, ARM Limited, All Rights Reserved * SPDX-License-Identifier: Apache-2.0 * * Licensed under the Apache License, Version 2.0 (the "License"); you may @@ -26,11 +26,12 @@ // target information target_cfg_t target_device = { - .flash_start = 0x08000000, - .flash_end = 0x08080000, - .ram_start = 0x20000000, - .ram_end = 0x20040000, - .flash_algo = (program_target_t *) &flash, - .sectors_info = sectors_info, - .sector_info_length = (sizeof(sectors_info))/(sizeof(sector_info_t)) + .sectors_info = sectors_info, + .sector_info_length = (sizeof(sectors_info))/(sizeof(sector_info_t)), + .flash_regions[0].start = 0x08000000, + .flash_regions[0].end = 0x08080000, + .flash_regions[0].flags = kRegionIsDefault, + .flash_regions[0].flash_algo = (program_target_t *) &flash, + .ram_regions[0].start = 0x20000000, + .ram_regions[0].end = 0x20040000, }; diff --git a/source/family/st/stm32f412rg/flash_blob.c b/source/family/st/stm32f412rg/flash_blob.c index cd8e71a77f..a1a10c85d6 100644 --- a/source/family/st/stm32f412rg/flash_blob.c +++ b/source/family/st/stm32f412rg/flash_blob.c @@ -1,5 +1,5 @@ /* Flash OS Routines (Automagically Generated) - * Copyright (c) 2009-2015 ARM Limited + * Copyright (c) 2009-2019 ARM Limited * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/source/family/st/stm32f412rg/target.c b/source/family/st/stm32f412rg/target.c index fb0efbffda..646d29fd38 100644 --- a/source/family/st/stm32f412rg/target.c +++ b/source/family/st/stm32f412rg/target.c @@ -3,7 +3,7 @@ * @brief Target information for the stm32f412rg * * DAPLink Interface Firmware - * Copyright (c) 2017-2017, ARM Limited, All Rights Reserved + * Copyright (c) 2017-2019, ARM Limited, All Rights Reserved * SPDX-License-Identifier: Apache-2.0 * * Licensed under the Apache License, Version 2.0 (the "License"); you may @@ -26,11 +26,12 @@ // target information target_cfg_t target_device = { - .flash_start = 0x08000000, - .flash_end = 0x08100000, - .ram_start = 0x20000000, - .ram_end = 0x20040000, - .flash_algo = (program_target_t *) &flash, - .sectors_info = sectors_info, - .sector_info_length = (sizeof(sectors_info))/(sizeof(sector_info_t)) + .sectors_info = sectors_info, + .sector_info_length = (sizeof(sectors_info))/(sizeof(sector_info_t)), + .flash_regions[0].start = 0x08000000, + .flash_regions[0].end = 0x08100000, + .flash_regions[0].flags = kRegionIsDefault, + .flash_regions[0].flash_algo = (program_target_t *) &flash, + .ram_regions[0].start = 0x20000000, + .ram_regions[0].end = 0x20040000, }; diff --git a/source/family/st/stm32f429zi/flash_blob.c b/source/family/st/stm32f429zi/flash_blob.c index 955a73b196..fa9bd47020 100644 --- a/source/family/st/stm32f429zi/flash_blob.c +++ b/source/family/st/stm32f429zi/flash_blob.c @@ -1,5 +1,5 @@ /* Flash OS Routines (Automagically Generated) - * Copyright (c) 2009-2015 ARM Limited + * Copyright (c) 2009-2019 ARM Limited * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/source/family/st/stm32f429zi/target.c b/source/family/st/stm32f429zi/target.c index f8b0e9a2c5..5f165fedd4 100644 --- a/source/family/st/stm32f429zi/target.c +++ b/source/family/st/stm32f429zi/target.c @@ -3,7 +3,7 @@ * @brief Target information for the * * DAPLink Interface Firmware - * Copyright (c) 2017-2017, ARM Limited, All Rights Reserved + * Copyright (c) 2017-2019, ARM Limited, All Rights Reserved * SPDX-License-Identifier: Apache-2.0 * * Licensed under the Apache License, Version 2.0 (the "License"); you may @@ -26,11 +26,12 @@ // target information target_cfg_t target_device = { - .flash_start = 0x08000000, - .flash_end = 0x08200000, - .ram_start = 0x20000000, - .ram_end = 0x20030000, - .flash_algo = (program_target_t *) &flash, - .sectors_info = sectors_info, - .sector_info_length = (sizeof(sectors_info))/(sizeof(sector_info_t)) + .sectors_info = sectors_info, + .sector_info_length = (sizeof(sectors_info))/(sizeof(sector_info_t)), + .flash_regions[0].start = 0x08000000, + .flash_regions[0].end = 0x08200000, + .flash_regions[0].flags = kRegionIsDefault, + .flash_regions[0].flash_algo = (program_target_t *) &flash, + .ram_regions[0].start = 0x20000000, + .ram_regions[0].end = 0x20030000, }; diff --git a/source/family/st/stm32f437vg/flash_blob.c b/source/family/st/stm32f437vg/flash_blob.c index c31ef0f68a..4d303dfe72 100644 --- a/source/family/st/stm32f437vg/flash_blob.c +++ b/source/family/st/stm32f437vg/flash_blob.c @@ -1,5 +1,5 @@ /* Flash OS Routines (Automagically Generated) - * Copyright (c) 2009-2015 ARM Limited + * Copyright (c) 2009-2019 ARM Limited * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -29,6 +29,17 @@ static const uint32_t STM32F437VG_flash_prog_blob[] = { 0x00000201, 0x00000000 }; +/** +* List of start and size for each size of flash sector +* The size will apply to all sectors between the listed address and the next address +* in the list. +* The last pair in the list will have sectors starting at that address and ending +* at address start + size. +*/ +static const sector_info_t sectors_info[] = { + {0x08000000, 0x4000}, +}; + static const program_target_t flash = { 0x2000003d, // Init 0x2000006b, // UnInit diff --git a/source/family/st/stm32f437vg/target.c b/source/family/st/stm32f437vg/target.c index 7e1d5757fd..ad14015796 100644 --- a/source/family/st/stm32f437vg/target.c +++ b/source/family/st/stm32f437vg/target.c @@ -3,7 +3,7 @@ * @brief Target information for the * * DAPLink Interface Firmware - * Copyright (c) 2017-2017, ARM Limited, All Rights Reserved + * Copyright (c) 2017-2019, ARM Limited, All Rights Reserved * SPDX-License-Identifier: Apache-2.0 * * Licensed under the Apache License, Version 2.0 (the "License"); you may @@ -26,11 +26,12 @@ // target information target_cfg_t target_device = { - .sector_size = 0x4000, - .sector_cnt = (0x100000 / 0x4000), - .flash_start = 0x08000000, - .flash_end = 0x08100000, - .ram_start = 0x20000000, - .ram_end = 0x20030000, - .flash_algo = (program_target_t *) &flash, + .sectors_info = sectors_info, + .sector_info_length = (sizeof(sectors_info))/(sizeof(sector_info_t)), + .flash_regions[0].start = 0x08000000, + .flash_regions[0].end = 0x08100000, + .flash_regions[0].flags = kRegionIsDefault, + .flash_regions[0].flash_algo = (program_target_t *) &flash, + .ram_regions[0].start = 0x20000000, + .ram_regions[0].end = 0x20030000, }; diff --git a/source/family/st/stm32f439zi/flash_blob.c b/source/family/st/stm32f439zi/flash_blob.c index e03e4c5d08..e5767ffb84 100644 --- a/source/family/st/stm32f439zi/flash_blob.c +++ b/source/family/st/stm32f439zi/flash_blob.c @@ -1,5 +1,5 @@ /* Flash OS Routines (Automagically Generated) - * Copyright (c) 2009-2015 ARM Limited + * Copyright (c) 2009-2019 ARM Limited * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/source/family/st/stm32f439zi/target.c b/source/family/st/stm32f439zi/target.c index f8b0e9a2c5..5f165fedd4 100644 --- a/source/family/st/stm32f439zi/target.c +++ b/source/family/st/stm32f439zi/target.c @@ -3,7 +3,7 @@ * @brief Target information for the * * DAPLink Interface Firmware - * Copyright (c) 2017-2017, ARM Limited, All Rights Reserved + * Copyright (c) 2017-2019, ARM Limited, All Rights Reserved * SPDX-License-Identifier: Apache-2.0 * * Licensed under the Apache License, Version 2.0 (the "License"); you may @@ -26,11 +26,12 @@ // target information target_cfg_t target_device = { - .flash_start = 0x08000000, - .flash_end = 0x08200000, - .ram_start = 0x20000000, - .ram_end = 0x20030000, - .flash_algo = (program_target_t *) &flash, - .sectors_info = sectors_info, - .sector_info_length = (sizeof(sectors_info))/(sizeof(sector_info_t)) + .sectors_info = sectors_info, + .sector_info_length = (sizeof(sectors_info))/(sizeof(sector_info_t)), + .flash_regions[0].start = 0x08000000, + .flash_regions[0].end = 0x08200000, + .flash_regions[0].flags = kRegionIsDefault, + .flash_regions[0].flash_algo = (program_target_t *) &flash, + .ram_regions[0].start = 0x20000000, + .ram_regions[0].end = 0x20030000, }; diff --git a/source/family/st/stm32f746zg/flash_blob.c b/source/family/st/stm32f746zg/flash_blob.c index 5e64efcc8f..9fce82abfd 100644 --- a/source/family/st/stm32f746zg/flash_blob.c +++ b/source/family/st/stm32f746zg/flash_blob.c @@ -1,5 +1,5 @@ /* Flash OS Routines (Automagically Generated) - * Copyright (c) 2009-2015 ARM Limited + * Copyright (c) 2009-2019 ARM Limited * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -29,6 +29,17 @@ static const uint32_t STM32F746ZG_flash_prog_blob[] = { 0xcdef89ab, 0x00005555, 0x40003000, 0x00000fff, 0x0000aaaa, 0x00000201, 0x00000000 }; +/** +* List of start and size for each size of flash sector +* The size will apply to all sectors between the listed address and the next address +* in the list. +* The last pair in the list will have sectors starting at that address and ending +* at address start + size. +*/ +static const sector_info_t sectors_info[] = { + {0x08000000, 0x8000}, +}; + static const program_target_t flash = { 0x20000039, // Init 0x20000067, // UnInit diff --git a/source/family/st/stm32f746zg/target.c b/source/family/st/stm32f746zg/target.c index 11335fc23e..8e642ac336 100644 --- a/source/family/st/stm32f746zg/target.c +++ b/source/family/st/stm32f746zg/target.c @@ -3,7 +3,7 @@ * @brief Target information for the * * DAPLink Interface Firmware - * Copyright (c) 2017-2017, ARM Limited, All Rights Reserved + * Copyright (c) 2017-2019, ARM Limited, All Rights Reserved * SPDX-License-Identifier: Apache-2.0 * * Licensed under the Apache License, Version 2.0 (the "License"); you may @@ -26,11 +26,12 @@ // target information target_cfg_t target_device = { - .sector_size = 0x8000, - .sector_cnt = (0x100000 / 0x8000), - .flash_start = 0x08000000, - .flash_end = 0x08100000, - .ram_start = 0x20000000, - .ram_end = 0x20000000 + 0x50000, - .flash_algo = (program_target_t *) &flash, + .sectors_info = sectors_info, + .sector_info_length = (sizeof(sectors_info))/(sizeof(sector_info_t)), + .flash_regions[0].start = 0x08000000, + .flash_regions[0].end = 0x08100000, + .flash_regions[0].flags = kRegionIsDefault, + .flash_regions[0].flash_algo = (program_target_t *) &flash, + .ram_regions[0].start = 0x20000000, + .ram_regions[0].end = 0x20000000 + 0x50000, }; diff --git a/source/family/st/stm32l082cz/flash_blob.c b/source/family/st/stm32l082cz/flash_blob.c index d42669844a..8adb8a9255 100644 --- a/source/family/st/stm32l082cz/flash_blob.c +++ b/source/family/st/stm32l082cz/flash_blob.c @@ -1,5 +1,5 @@ /* Flash OS Routines (Automagically Generated) - * Copyright (c) 2009-2015 ARM Limited + * Copyright (c) 2009-2019 ARM Limited * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -38,14 +38,14 @@ static const uint32_t flash_start = 0x08000000; static const uint32_t flash_size = 0x00030000; /** -* List of start and size for each size of flash sector - even indexes are start, odd are size +* List of start and size for each size of flash sector * The size will apply to all sectors between the listed address and the next address * in the list. * The last pair in the list will have sectors starting at that address and ending -* at address flash_start + flash_size. +* at address start + size. */ -static const uint32_t sectors_info[] = { - 0x08000000, 0x00000080, +static const sector_info_t sectors_info[] = { + {0x08000000, 0x00000080}, }; static const program_target_t flash = { diff --git a/source/family/st/stm32l082cz/target.c b/source/family/st/stm32l082cz/target.c index b071eb49aa..b6bdba721a 100644 --- a/source/family/st/stm32l082cz/target.c +++ b/source/family/st/stm32l082cz/target.c @@ -3,7 +3,7 @@ * @brief Target information for the stm32l082cz * * DAPLink Interface Firmware - * Copyright (c) 2017-2017, ARM Limited, All Rights Reserved + * Copyright (c) 2017-2019, ARM Limited, All Rights Reserved * SPDX-License-Identifier: Apache-2.0 * * Licensed under the Apache License, Version 2.0 (the "License"); you may @@ -26,11 +26,12 @@ // target information target_cfg_t target_device = { - .sector_size = 0x80, - .sector_cnt = (0x30000 / 0x80), - .flash_start = 0x08000000, - .flash_end = 0x08030000, - .ram_start = 0x20000000, - .ram_end = 0x20005000, - .flash_algo = (program_target_t *) &flash + .sectors_info = sectors_info, + .sector_info_length = (sizeof(sectors_info))/(sizeof(sector_info_t)), + .flash_regions[0].start = 0x08000000, + .flash_regions[0].end = 0x08030000, + .flash_regions[0].flags = kRegionIsDefault, + .flash_regions[0].flash_algo = (program_target_t *) &flash, + .ram_regions[0].start = 0x20000000, + .ram_regions[0].end = 0x20005000, }; diff --git a/source/family/st/stm32l151cbxxa/flash_blob.c b/source/family/st/stm32l151cbxxa/flash_blob.c index a8922cf845..719b592b5d 100644 --- a/source/family/st/stm32l151cbxxa/flash_blob.c +++ b/source/family/st/stm32l151cbxxa/flash_blob.c @@ -1,5 +1,5 @@ /* Flash OS Routines (Automagically Generated) - * Copyright (c) 2009-2015 ARM Limited + * Copyright (c) 2009-2019 ARM Limited * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -40,14 +40,14 @@ static const uint32_t flash_start = 0x08000000; static const uint32_t flash_size = 0x00020000; /** -* List of start and size for each size of flash sector - even indexes are start, odd are size +* List of start and size for each size of flash sector * The size will apply to all sectors between the listed address and the next address * in the list. * The last pair in the list will have sectors starting at that address and ending -* at address flash_start + flash_size. +* at address start + size. */ -static const uint32_t sectors_info[] = { - 0x08000000, 0x00000100, +static const sector_info_t sectors_info[] = { + {0x08000000, 0x00000100}, }; static const program_target_t flash = { diff --git a/source/family/st/stm32l151cbxxa/target.c b/source/family/st/stm32l151cbxxa/target.c index 48bc723758..1da0c81e38 100644 --- a/source/family/st/stm32l151cbxxa/target.c +++ b/source/family/st/stm32l151cbxxa/target.c @@ -3,7 +3,7 @@ * @brief Target information for the stm32l151cbxxa * * DAPLink Interface Firmware - * Copyright (c) 2018-2018, ARM Limited, All Rights Reserved + * Copyright (c) 2018-2019, ARM Limited, All Rights Reserved * SPDX-License-Identifier: Apache-2.0 * * Licensed under the Apache License, Version 2.0 (the "License"); you may @@ -26,11 +26,12 @@ // target information target_cfg_t target_device = { - .sector_size = 256, - .sector_cnt = 512, - .flash_start = 0x08000000, - .flash_end = 0x08000000 + KB(128), - .ram_start = 0x20000000, - .ram_end = 0x20000000 + KB(32), - .flash_algo = (program_target_t *) &flash, + .sectors_info = sectors_info, + .sector_info_length = (sizeof(sectors_info))/(sizeof(sector_info_t)), + .flash_regions[0].start = 0x08000000, + .flash_regions[0].end = 0x08000000 + KB(128), + .flash_regions[0].flags = kRegionIsDefault, + .flash_regions[0].flash_algo = (program_target_t *) &flash, + .ram_regions[0].start = 0x20000000, + .ram_regions[0].end = 0x20000000 + KB(32), }; diff --git a/source/family/st/stm32l443rc/flash_blob.c b/source/family/st/stm32l443rc/flash_blob.c index 998e1c3f0c..896501394f 100644 --- a/source/family/st/stm32l443rc/flash_blob.c +++ b/source/family/st/stm32l443rc/flash_blob.c @@ -1,5 +1,5 @@ /* Flash OS Routines (Automagically Generated) - * Copyright (c) 2009-2015 ARM Limited + * Copyright (c) 2009-2019 ARM Limited * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -38,14 +38,14 @@ static const uint32_t flash_start = 0x08000000; static const uint32_t flash_size = 0x00040000; /** -* List of start and size for each size of flash sector - even indexes are start, odd are size +* List of start and size for each size of flash sector * The size will apply to all sectors between the listed address and the next address * in the list. * The last pair in the list will have sectors starting at that address and ending -* at address flash_start + flash_size. +* at address start + size. */ -static const uint32_t sectors_info[] = { - 0x08000000, 0x00000800, +static const sector_info_t sectors_info[] = { + {0x08000000, 0x00000800}, }; static const program_target_t flash = { diff --git a/source/family/st/stm32l443rc/target.c b/source/family/st/stm32l443rc/target.c index ca2209bdce..a98dbccc0d 100644 --- a/source/family/st/stm32l443rc/target.c +++ b/source/family/st/stm32l443rc/target.c @@ -3,7 +3,7 @@ * @brief Target information for the stm32l443rc * * DAPLink Interface Firmware - * Copyright (c) 2017-2017, ARM Limited, All Rights Reserved + * Copyright (c) 2017-2019, ARM Limited, All Rights Reserved * SPDX-License-Identifier: Apache-2.0 * * Licensed under the Apache License, Version 2.0 (the "License"); you may @@ -26,11 +26,12 @@ // target information target_cfg_t target_device = { - .sector_size = 0x800, - .sector_cnt = (0x40000 / 0x800), - .flash_start = 0x08000000, - .flash_end = 0x08040000, - .ram_start = 0x20000000, - .ram_end = 0x2000c000, - .flash_algo = (program_target_t *) &flash + .sectors_info = sectors_info, + .sector_info_length = (sizeof(sectors_info))/(sizeof(sector_info_t)), + .flash_regions[0].start = 0x08000000, + .flash_regions[0].end = 0x08040000, + .flash_regions[0].flags = kRegionIsDefault, + .flash_regions[0].flash_algo = (program_target_t *) &flash, + .ram_regions[0].start = 0x20000000, + .ram_regions[0].end = 0x2000c000, }; diff --git a/source/family/st/stm32l476rg/flash_blob.c b/source/family/st/stm32l476rg/flash_blob.c index 6638dcb1ee..fb987a6632 100644 --- a/source/family/st/stm32l476rg/flash_blob.c +++ b/source/family/st/stm32l476rg/flash_blob.c @@ -1,5 +1,5 @@ /* Flash OS Routines (Automagically Generated) - * Copyright (c) 2009-2015 ARM Limited + * Copyright (c) 2009-2019 ARM Limited * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -30,6 +30,17 @@ static const uint32_t STM32L476RG_flash_prog_blob[] = { 0x40003000, 0x00000000 }; +/** +* List of start and size for each size of flash sector +* The size will apply to all sectors between the listed address and the next address +* in the list. +* The last pair in the list will have sectors starting at that address and ending +* at address start + size. +*/ +static const sector_info_t sectors_info[] = { + {0x08000000, 0x800}, +}; + static const program_target_t flash = { 0x20000037, // Init 0x20000067, // UnInit diff --git a/source/family/st/stm32l476rg/target.c b/source/family/st/stm32l476rg/target.c index df5aac6822..441c48f1ef 100644 --- a/source/family/st/stm32l476rg/target.c +++ b/source/family/st/stm32l476rg/target.c @@ -3,7 +3,7 @@ * @brief Target information for the * * DAPLink Interface Firmware - * Copyright (c) 2017-2017, ARM Limited, All Rights Reserved + * Copyright (c) 2017-2019, ARM Limited, All Rights Reserved * SPDX-License-Identifier: Apache-2.0 * * Licensed under the Apache License, Version 2.0 (the "License"); you may @@ -26,11 +26,12 @@ // target information target_cfg_t target_device = { - .sector_size = 0x800, - .sector_cnt = (0x100000 / 0x800), - .flash_start = 0x08000000, - .flash_end = 0x08100000, - .ram_start = 0x20000000, - .ram_end = 0x20018000, - .flash_algo = (program_target_t *) &flash, + .sectors_info = sectors_info, + .sector_info_length = (sizeof(sectors_info))/(sizeof(sector_info_t)), + .flash_regions[0].start = 0x08000000, + .flash_regions[0].end = 0x08100000, + .flash_regions[0].flags = kRegionIsDefault, + .flash_regions[0].flash_algo = (program_target_t *) &flash, + .ram_regions[0].start = 0x20000000, + .ram_regions[0].end = 0x20018000, }; diff --git a/source/family/st/stm32l486jg/flash_blob.c b/source/family/st/stm32l486jg/flash_blob.c index 75ea536237..646072f3fa 100644 --- a/source/family/st/stm32l486jg/flash_blob.c +++ b/source/family/st/stm32l486jg/flash_blob.c @@ -1,5 +1,5 @@ /* Flash OS Routines (Automagically Generated) - * Copyright (c) 2009-2015 ARM Limited + * Copyright (c) 2009-2019 ARM Limited * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -38,14 +38,14 @@ static const uint32_t flash_start = 0x08000000; static const uint32_t flash_size = 0x00100000; /** -* List of start and size for each size of flash sector - even indexes are start, odd are size +* List of start and size for each size of flash sector * The size will apply to all sectors between the listed address and the next address * in the list. * The last pair in the list will have sectors starting at that address and ending -* at address flash_start + flash_size. +* at address start + size. */ -static const uint32_t sectors_info[] = { - 0x08000000, 0x00000800, +static const sector_info_t sectors_info[] = { + {0x08000000, 0x00000800}, }; static const program_target_t flash = { diff --git a/source/family/st/stm32l486jg/target.c b/source/family/st/stm32l486jg/target.c index 2755e25bd3..d84764cd3c 100644 --- a/source/family/st/stm32l486jg/target.c +++ b/source/family/st/stm32l486jg/target.c @@ -3,7 +3,7 @@ * @brief Target information for the stm32l486jg * * DAPLink Interface Firmware - * Copyright (c) 2017-2017, ARM Limited, All Rights Reserved + * Copyright (c) 2017-2019, ARM Limited, All Rights Reserved * SPDX-License-Identifier: Apache-2.0 * * Licensed under the Apache License, Version 2.0 (the "License"); you may @@ -26,11 +26,12 @@ // target information target_cfg_t target_device = { - .sector_size = 0x800, - .sector_cnt = (0x100000 / 0x800), - .flash_start = 0x08000000, - .flash_end = 0x08100000, - .ram_start = 0x20000000, - .ram_end = 0x20018000, - .flash_algo = (program_target_t *) &flash + .sectors_info = sectors_info, + .sector_info_length = (sizeof(sectors_info))/(sizeof(sector_info_t)), + .flash_regions[0].start = 0x08000000, + .flash_regions[0].end = 0x08100000, + .flash_regions[0].flags = kRegionIsDefault, + .flash_regions[0].flash_algo = (program_target_t *) &flash, + .ram_regions[0].start = 0x20000000, + .ram_regions[0].end = 0x20018000, }; diff --git a/source/family/st/stm32l4xx_1024/flash_blob.c b/source/family/st/stm32l4xx_1024/flash_blob.c index 68cd8adfa5..8a1d9c6896 100644 --- a/source/family/st/stm32l4xx_1024/flash_blob.c +++ b/source/family/st/stm32l4xx_1024/flash_blob.c @@ -1,5 +1,5 @@ /* Flash OS Routines (Automagically Generated) - * Copyright (c) 2009-2015 ARM Limited + * Copyright (c) 2009-2019ARM Limited * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -37,14 +37,14 @@ static const uint32_t flash_start = 0x08000000; static const uint32_t flash_size = 0x00100000; /** -* List of start and size for each size of flash sector - even indexes are start, odd are size +* List of start and size for each size of flash sector * The size will apply to all sectors between the listed address and the next address * in the list. * The last pair in the list will have sectors starting at that address and ending -* at address flash_start + flash_size. +* at address start + size. */ -static const uint32_t sectors_info[] = { - 0x08000000, 0x00000800, +static const sector_info_t sectors_info[] = { + {0x08000000, 0x00000800}, }; static const program_target_t flash = { diff --git a/source/family/st/stm32l4xx_1024/target.c b/source/family/st/stm32l4xx_1024/target.c index 477a2ac795..6082776640 100644 --- a/source/family/st/stm32l4xx_1024/target.c +++ b/source/family/st/stm32l4xx_1024/target.c @@ -3,7 +3,7 @@ * @brief Target information for the stm32l486jg * * DAPLink Interface Firmware - * Copyright (c) 2017-2017, ARM Limited, All Rights Reserved + * Copyright (c) 2017-2019, ARM Limited, All Rights Reserved * SPDX-License-Identifier: Apache-2.0 * * Licensed under the Apache License, Version 2.0 (the "License"); you may @@ -26,12 +26,14 @@ // target information target_cfg_t target_device_stm32l475 = { - .sector_size = 0x800, - .sector_cnt = (0x100000 / 0x800), - .flash_start = 0x08000000, - .flash_end = 0x08100000, - .ram_start = 0x20000000, //SRAM1 start - .ram_end = 0x20000000 + 0x00018000, //SRAM1 end - .flash_algo = (program_target_t *) &flash, - .extra_ram = {{ 0x10000188, 0x10008000 },}, //SRAM2 + .sectors_info = sectors_info, + .sector_info_length = (sizeof(sectors_info))/(sizeof(sector_info_t)), + .flash_regions[0].start = 0x08000000, + .flash_regions[0].end = 0x08100000, + .flash_regions[0].flags = kRegionIsDefault, + .flash_regions[0].flash_algo = (program_target_t *) &flash, + .ram_regions[0].start = 0x20000000, + .ram_regions[0].end = 0x20000000 + 0x00018000, + .ram_regions[1].start = 0x10000188, + .ram_regions[1].end = 0x10008000, }; diff --git a/source/family/st/xDot-L151/flash_blob.c b/source/family/st/xDot-L151/flash_blob.c index 33c70f95e8..f4f8e20d68 100644 --- a/source/family/st/xDot-L151/flash_blob.c +++ b/source/family/st/xDot-L151/flash_blob.c @@ -1,5 +1,5 @@ /* Flash OS Routines (Automagically Generated) - * Copyright (c) 2009-2015 ARM Limited + * Copyright (c) 2009-2019 ARM Limited * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -38,6 +38,17 @@ static const uint32_t stm32l151_flash_prog_blob[] = { 0x13141516, 0x08040000, 0x00000000, }; +/** +* List of start and size for each size of flash sector +* The size will apply to all sectors between the listed address and the next address +* in the list. +* The last pair in the list will have sectors starting at that address and ending +* at address start + size. +*/ +static const sector_info_t sectors_info[] = { + {0x08000000, 256}, +}; + static const program_target_t flash = { 0x20000021, // Init 0x20000037, // UnInit diff --git a/source/family/st/xDot-L151/target.c b/source/family/st/xDot-L151/target.c index 32aaa823cd..310d0b28d5 100644 --- a/source/family/st/xDot-L151/target.c +++ b/source/family/st/xDot-L151/target.c @@ -3,7 +3,7 @@ * @brief Target information for the stm32l151 * * DAPLink Interface Firmware - * Copyright (c) 2009-2016, ARM Limited, All Rights Reserved + * Copyright (c) 2009-2019, ARM Limited, All Rights Reserved * SPDX-License-Identifier: Apache-2.0 * * Licensed under the Apache License, Version 2.0 (the "License"); you may @@ -26,11 +26,12 @@ // target information target_cfg_t target_device = { - .sector_size = 256, - .sector_cnt = KB(1), - .flash_start = 0x08000000, - .flash_end = 0x08000000 + KB(256), - .ram_start = 0x20000000, - .ram_end = 0x20000000 + KB(32), - .flash_algo = (program_target_t *) &flash, + .sectors_info = sectors_info, + .sector_info_length = (sizeof(sectors_info))/(sizeof(sector_info_t)), + .flash_regions[0].start = 0x08000000, + .flash_regions[0].end = 0x08000000 + KB(256), + .flash_regions[0].flags = kRegionIsDefault, + .flash_regions[0].flash_algo = (program_target_t *) &flash, + .ram_regions[0].start = 0x20000000, + .ram_regions[0].end = 0x20000000 + KB(32), }; diff --git a/source/family/ti/cc3220sf/flash_blob.c b/source/family/ti/cc3220sf/flash_blob.c index 207f033506..6272c1c17c 100644 --- a/source/family/ti/cc3220sf/flash_blob.c +++ b/source/family/ti/cc3220sf/flash_blob.c @@ -1,5 +1,5 @@ /* Flash OS Routines (Automagically Generated) - * Copyright (c) 2009-2018 ARM Limited + * Copyright (c) 2009-2019 ARM Limited * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -50,6 +50,17 @@ static const uint32_t flash_start = 0x01000000; // Size of flash static const uint32_t flash_size = 0x00100000; +/** +* List of start and size for each size of flash sector +* The size will apply to all sectors between the listed address and the next address +* in the list. +* The last pair in the list will have sectors starting at that address and ending +* at address start + size. +*/ +static const sector_info_t sectors_info[] = { + {0x01000000, 2048}, +}; + static const program_target_t flash = { 0x20000027, // Init 0x200001e3, // UnInit diff --git a/source/family/ti/cc3220sf/target.c b/source/family/ti/cc3220sf/target.c index b70ab93899..d7aa1f94d9 100644 --- a/source/family/ti/cc3220sf/target.c +++ b/source/family/ti/cc3220sf/target.c @@ -3,7 +3,7 @@ * @brief Target information for the cc3220sf * * DAPLink Interface Firmware - * Copyright (c) 2009-2018, ARM Limited, All Rights Reserved + * Copyright (c) 2009-2019, ARM Limited, All Rights Reserved * SPDX-License-Identifier: Apache-2.0 * * Licensed under the Apache License, Version 2.0 (the "License"); you may @@ -26,11 +26,12 @@ // target information target_cfg_t target_device = { - .sector_size = 2048, - .sector_cnt = (MB(1) / 2048), - .flash_start = 0x01000000, - .flash_end = (0x01000000 + MB(1)), - .ram_start = 0x20000000, - .ram_end = 0x20040000, - .flash_algo = (program_target_t *) &flash, + .sectors_info = sectors_info, + .sector_info_length = (sizeof(sectors_info))/(sizeof(sector_info_t)), + .flash_regions[0].start = 0x01000000, + .flash_regions[0].end = 0x01000000 + MB(1), + .flash_regions[0].flags = kRegionIsDefault, + .flash_regions[0].flash_algo = (program_target_t *) &flash, + .ram_regions[0].start = 0x20000000, + .ram_regions[0].end = 0x20040000, }; diff --git a/source/family/toshiba/tz10xx/target_remap0.c b/source/family/toshiba/tz10xx/target_remap0.c index 046bc7e29b..0a0a47fa48 100644 --- a/source/family/toshiba/tz10xx/target_remap0.c +++ b/source/family/toshiba/tz10xx/target_remap0.c @@ -3,7 +3,7 @@ * @brief Target information for the lpc1114 * * DAPLink Interface Firmware - * Copyright (c) 2009-2016, ARM Limited, All Rights Reserved + * Copyright (c) 2009-2019, ARM Limited, All Rights Reserved * SPDX-License-Identifier: Apache-2.0 * * Licensed under the Apache License, Version 2.0 (the "License"); you may @@ -27,11 +27,12 @@ // target information target_cfg_t target_device = { - .sector_size = 1024, - .sector_cnt = (MB(1) / 1024), - .flash_start = 0, - .flash_end = MB(1), - .ram_start = 0x20000000, - .ram_end = 0x20008000, - .flash_algo = (program_target_t *) &flash, + .sectors_info = sectors_info, + .sector_info_length = (sizeof(sectors_info))/(sizeof(sector_info_t)), + .flash_regions[0].start = 0, + .flash_regions[0].end = MB(1), + .flash_regions[0].flags = kRegionIsDefault, + .flash_regions[0].flash_algo = (program_target_t *) &flash, + .ram_regions[0].start = 0x20000000, + .ram_regions[0].end = 0x20008000, }; diff --git a/source/family/toshiba/tz10xx/tz10xx_prog_blob.h b/source/family/toshiba/tz10xx/tz10xx_prog_blob.h index 32e5fe0c49..c85cb40fde 100644 --- a/source/family/toshiba/tz10xx/tz10xx_prog_blob.h +++ b/source/family/toshiba/tz10xx/tz10xx_prog_blob.h @@ -1,5 +1,5 @@ /* Flash OS Routines (Automagically Generated) - * Copyright (c) 2009-2015 ARM Limited + * Copyright (c) 2009-2019 ARM Limited * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -45,6 +45,17 @@ static const uint32_t tz10xx_flash_prog_blob[] = { 0x40004200, 0x00000000, }; +/** +* List of start and size for each size of flash sector +* The size will apply to all sectors between the listed address and the next address +* in the list. +* The last pair in the list will have sectors starting at that address and ending +* at address start + size. +*/ +static const sector_info_t sectors_info[] = { + {0, 1024}, +}; + static const program_target_t flash = { 0x2000009F, // Init 0x200000B7, // UnInit diff --git a/source/family/wiznet/w7500/flash_blob.c b/source/family/wiznet/w7500/flash_blob.c index baf43f85e9..69c0e385e0 100644 --- a/source/family/wiznet/w7500/flash_blob.c +++ b/source/family/wiznet/w7500/flash_blob.c @@ -3,7 +3,7 @@ * @brief Flash algorithm for the W7500 * * DAPLink Interface Firmware - * Copyright (c) 2009-2016, ARM Limited, All Rights Reserved + * Copyright (c) 2009-2019, ARM Limited, All Rights Reserved * SPDX-License-Identifier: Apache-2.0 * * Licensed under the Apache License, Version 2.0 (the "License"); you may @@ -30,6 +30,17 @@ static const uint32_t w7500_flash_prog_blob[] = { 0xe000ed00, 0xe000e180, 0xe000e000, 0x1fff1001, 0x00000000, }; +/** +* List of start and size for each size of flash sector +* The size will apply to all sectors between the listed address and the next address +* in the list. +* The last pair in the list will have sectors starting at that address and ending +* at address start + size. +*/ +static const sector_info_t sectors_info[] = { + {0, 256}, +}; + static const program_target_t flash = { 0x20000041, // Init 0x20000045, // UnInit diff --git a/source/family/wiznet/w7500/target.c b/source/family/wiznet/w7500/target.c index c51eb566c1..ba8a39b26b 100644 --- a/source/family/wiznet/w7500/target.c +++ b/source/family/wiznet/w7500/target.c @@ -3,7 +3,7 @@ * @brief Target information for the W7500 * * DAPLink Interface Firmware - * Copyright (c) 2009-2016, ARM Limited, All Rights Reserved + * Copyright (c) 2009-2019, ARM Limited, All Rights Reserved * SPDX-License-Identifier: Apache-2.0 * * Licensed under the Apache License, Version 2.0 (the "License"); you may @@ -26,11 +26,12 @@ // target information target_cfg_t target_device = { - .sector_size = 256, - .sector_cnt = 512, - .flash_start = 0x00000000, - .flash_end = 0x00000000 + KB(128), - .ram_start = 0x20000000, - .ram_end = 0x20004000, - .flash_algo = (program_target_t *) &flash, + .sectors_info = sectors_info, + .sector_info_length = (sizeof(sectors_info))/(sizeof(sector_info_t)), + .flash_regions[0].start = 0x00000000, + .flash_regions[0].end = 0x00000000 + KB(128), + .flash_regions[0].flags = kRegionIsDefault, + .flash_regions[0].flash_algo = (program_target_t *) &flash, + .ram_regions[0].start = 0x20000000, + .ram_regions[0].end = 0x20004000, }; diff --git a/source/hic_hal/atmel/sam3u2c/flash_hal_SAM3U.c b/source/hic_hal/atmel/sam3u2c/flash_hal_SAM3U.c index 6ed521a643..e247d08b89 100644 --- a/source/hic_hal/atmel/sam3u2c/flash_hal_SAM3U.c +++ b/source/hic_hal/atmel/sam3u2c/flash_hal_SAM3U.c @@ -3,7 +3,7 @@ * @brief * * DAPLink Interface Firmware - * Copyright (c) 2009-2016, ARM Limited, All Rights Reserved + * Copyright (c) 2009-2019, ARM Limited, All Rights Reserved * SPDX-License-Identifier: Apache-2.0 * * Licensed under the Apache License, Version 2.0 (the "License"); you may @@ -147,15 +147,13 @@ uint32_t EraseChip(void) // Return value 0 == O.K. // Return value 1 == Error // Erase complete chip by erasing sector-by-sector - //Addr = target_device.flash_start; - Addr = g_board_info.target_cfg->flash_start; + Addr = g_board_info.target_cfg->flash_regions[0].start; //bootloader, interface flashing only concerns 1 flash region cortex_int_state_t state = cortex_int_get_and_disable(); do { _WritePage(Addr, (volatile uint32_t *)0, 1); Addr += (1 << 8); - //} while (Addr < target_device.flash_end); - } while (Addr < g_board_info.target_cfg->flash_end); + } while (Addr < g_board_info.target_cfg->flash_regions[0].end); cortex_int_restore(state); return (0); // O.K. diff --git a/source/hic_hal/stm32/stm32f103xb/flash.c b/source/hic_hal/stm32/stm32f103xb/flash.c index 79291ee77f..2d36acc2de 100644 --- a/source/hic_hal/stm32/stm32f103xb/flash.c +++ b/source/hic_hal/stm32/stm32f103xb/flash.c @@ -62,13 +62,13 @@ uint32_t EraseChip(void) uint32_t ret = 0; // O.K. if (g_board_info.target_cfg) { HAL_FLASH_Unlock(); - - util_assert((g_board_info.target_cfg->flash_end - g_board_info.target_cfg->flash_start) % + //bootloader, interface flashing only concerns 1 flash region + util_assert((g_board_info.target_cfg->flash_regions[0].end - g_board_info.target_cfg->flash_regions[0].start) % FLASH_PAGE_SIZE == 0); memset(&erase_init, 0, sizeof(erase_init)); erase_init.TypeErase = FLASH_TYPEERASE_PAGES; - erase_init.PageAddress =g_board_info.target_cfg->flash_start; - erase_init.NbPages = (g_board_info.target_cfg->flash_end - g_board_info.target_cfg->flash_start) % FLASH_PAGE_SIZE; + erase_init.PageAddress = g_board_info.target_cfg->flash_regions[0].start; + erase_init.NbPages = (g_board_info.target_cfg->flash_regions[0].end - g_board_info.target_cfg->flash_regions[0].start) % FLASH_PAGE_SIZE; if (HAL_FLASHEx_Erase(&erase_init, &error) != HAL_OK) { ret = 1; } diff --git a/source/hic_hal/target_config.h b/source/target/target_config.h similarity index 59% rename from source/hic_hal/target_config.h rename to source/target/target_config.h index 972ff9afa7..c441b3b524 100644 --- a/source/hic_hal/target_config.h +++ b/source/target/target_config.h @@ -41,37 +41,34 @@ extern "C" { #define TARGET_AUTO_INCREMENT_PAGE_SIZE (1024) //Additional flash and ram regions -#define MAX_EXTRA_FLASH_REGION 3 -#define MAX_EXTRA_RAM_REGION 3 +#define MAX_EXTRA_FLASH_REGION 10 +#define MAX_EXTRA_RAM_REGION 10 + +enum _region_flags { + kRegionIsDefault = (1 << 0), //out of bounds regions will use the same flash algo if this is set + kRegionIsSecure = (1 << 1) +}; -typedef struct flash_region_info { - uint32_t start; - uint32_t end; - program_target_t *flash_algo; -} flash_region_info_t; -typedef struct ram_region_info { +typedef struct region_info { uint32_t start; uint32_t end; -} ram_region_info_t; + uint32_t flags; + uint8_t alias_index; /*!