From afeb645a87a75ef02afef24a2ae5889f1aa99713 Mon Sep 17 00:00:00 2001 From: hathach Date: Tue, 12 May 2020 00:48:06 +0700 Subject: [PATCH] correct the DFU_BL_IMAGE_MAX_SIZE skip populate MBR_BOOTLOADER_ADDR/MBR_PARAM_PAGE_ADDR --- lib/sdk11/components/libraries/bootloader_dfu/dfu_types.h | 2 +- src/main.c | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/sdk11/components/libraries/bootloader_dfu/dfu_types.h b/lib/sdk11/components/libraries/bootloader_dfu/dfu_types.h index 9492b0e..ecb8f98 100644 --- a/lib/sdk11/components/libraries/bootloader_dfu/dfu_types.h +++ b/lib/sdk11/components/libraries/bootloader_dfu/dfu_types.h @@ -74,7 +74,7 @@ static inline bool is_sd_existed(void) #define DFU_IMAGE_MAX_SIZE_BANKED (((DFU_IMAGE_MAX_SIZE_FULL) - \ (DFU_IMAGE_MAX_SIZE_FULL % (2 * CODE_PAGE_SIZE)))/2) /**< Maximum size of an application, excluding save data from the application. */ -#define DFU_BL_IMAGE_MAX_SIZE (BOOTLOADER_SETTINGS_ADDRESS - BOOTLOADER_REGION_START) /**< Maximum size of a bootloader, excluding save data from the current bootloader. */ +#define DFU_BL_IMAGE_MAX_SIZE (BOOTLOADER_MBR_PARAMS_PAGE_ADDRESS - BOOTLOADER_REGION_START) /**< Maximum size of a bootloader, excluding save data from the current bootloader. */ #define DFU_BANK_0_REGION_START CODE_REGION_1_START /**< Bank 0 region start. */ #define DFU_BANK_1_REGION_START (DFU_BANK_0_REGION_START + DFU_IMAGE_MAX_SIZE_BANKED) /**< Bank 1 region start. */ diff --git a/src/main.c b/src/main.c index 3e1c04d..bf415e5 100644 --- a/src/main.c +++ b/src/main.c @@ -155,8 +155,8 @@ int main(void) { // Populate Boot Address and MBR Param into MBR if not already // MBR_BOOTLOADER_ADDR/MBR_PARAM_PAGE_ADDR are used if available, else UICR registers are used - // Note: skip it for now since this will prevent us to change the size of bootloader - bootloader_mbr_addrs_populate(); + // Note: skip it for now since this will prevent us to change the size of bootloader in the future + // bootloader_mbr_addrs_populate(); // SD is already Initialized in case of BOOTLOADER_DFU_OTA_MAGIC bool sd_inited = (NRF_POWER->GPREGRET == DFU_MAGIC_OTA_APPJUM);