From 6127ca3b6dae2c26f25e5f456a22f8fb9856d286 Mon Sep 17 00:00:00 2001 From: hathach Date: Tue, 17 Apr 2018 22:12:31 +0700 Subject: [PATCH] add Debug Size++ ses config for easy debugging --- lib/sdk11/components/libraries/bootloader_dfu/dfu_types.h | 6 ++++++ src/main.c | 5 +++++ src/segger/nRF52840_xxAA_MemoryMap.xml | 3 ++- src/segger/nrf52840_bootloader.emProject | 7 +++++++ 4 files changed, 20 insertions(+), 1 deletion(-) diff --git a/lib/sdk11/components/libraries/bootloader_dfu/dfu_types.h b/lib/sdk11/components/libraries/bootloader_dfu/dfu_types.h index bddc9fb..51bc7e8 100644 --- a/lib/sdk11/components/libraries/bootloader_dfu/dfu_types.h +++ b/lib/sdk11/components/libraries/bootloader_dfu/dfu_types.h @@ -66,7 +66,13 @@ #elif defined(NRF52840_XXAA) +#ifdef DEBUG_SIZE_EXPAND +// Increase bootloader size for easy debugging +#define BOOTLOADER_REGION_START 0x000E4000 +#else #define BOOTLOADER_REGION_START 0x000F4000 /**< This field should correspond to start address of the bootloader, found in UICR.RESERVED, 0x10001014, register. This value is used for sanity check, so the bootloader will fail immediately if this value differs from runtime value. The value is used to determine max application size for updating. */ +#endif + #define BOOTLOADER_SETTINGS_ADDRESS 0x000FF000 /**< The field specifies the page location of the bootloader settings address. */ #define BOOTLOADER_MBR_PARAMS_PAGE_ADDRESS 0x000FE000 /**< The field specifies the page location of the mbr params page address. */ diff --git a/src/main.c b/src/main.c index 1996894..15c42cf 100644 --- a/src/main.c +++ b/src/main.c @@ -101,7 +101,12 @@ enum { BLE_CONN_CFG_HIGH_BANDWIDTH = 1 }; // Adafruit for factory reset #define APPDATA_ADDR_START (BOOTLOADER_REGION_START-DFU_APP_DATA_RESERVED) + +#ifdef DEBUG_SIZE_EXPAND +STATIC_ASSERT( APPDATA_ADDR_START == 0xDD000); +#else STATIC_ASSERT( APPDATA_ADDR_START == 0xED000); +#endif void adafruit_factory_reset(void); volatile bool _freset_erased_complete = false; diff --git a/src/segger/nRF52840_xxAA_MemoryMap.xml b/src/segger/nRF52840_xxAA_MemoryMap.xml index 28ef30e..f10c922 100644 --- a/src/segger/nRF52840_xxAA_MemoryMap.xml +++ b/src/segger/nRF52840_xxAA_MemoryMap.xml @@ -1,6 +1,7 @@ - + + diff --git a/src/segger/nrf52840_bootloader.emProject b/src/segger/nrf52840_bootloader.emProject index 9de10d3..a27b516 100644 --- a/src/segger/nrf52840_bootloader.emProject +++ b/src/segger/nrf52840_bootloader.emProject @@ -127,6 +127,9 @@ + @@ -249,6 +252,9 @@ + +