adjust bootloader debug size

This commit is contained in:
hathach 2018-04-19 19:15:19 +07:00
parent 512f7a5fce
commit 0a1aa554bc
4 changed files with 11 additions and 10 deletions

View File

@ -66,11 +66,16 @@
#elif defined(NRF52840_XXAA) #elif defined(NRF52840_XXAA)
// Increase bootloader size to application data region for easy debugging
#ifdef DEBUG_SIZE_EXPAND #ifdef DEBUG_SIZE_EXPAND
// Increase bootloader size for easy debugging
#define BOOTLOADER_REGION_START 0x000E4000 #define BOOTLOADER_REGION_START (0x000F4000 - CODE_PAGE_SIZE*7)
#define DFU_APP_DATA_RESERVED 0
#else #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. */ #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 #endif
#define BOOTLOADER_SETTINGS_ADDRESS 0x000FF000 /**< The field specifies the page location of the bootloader settings address. */ #define BOOTLOADER_SETTINGS_ADDRESS 0x000FF000 /**< The field specifies the page location of the bootloader settings address. */
@ -87,7 +92,7 @@
#define DFU_REGION_TOTAL_SIZE (BOOTLOADER_REGION_START - CODE_REGION_1_START) /**< Total size of the region between SD and Bootloader. */ #define DFU_REGION_TOTAL_SIZE (BOOTLOADER_REGION_START - CODE_REGION_1_START) /**< Total size of the region between SD and Bootloader. */
#ifndef DFU_APP_DATA_RESERVED #ifndef DFU_APP_DATA_RESERVED
#define DFU_APP_DATA_RESERVED CODE_PAGE_SIZE * 7 /**< Size of Application Data that must be preserved between application updates. This value must be a multiple of page size. Page size is 0x400 (1024d) bytes, thus this value must be 0x0000, 0x0400, 0x0800, 0x0C00, 0x1000, etc. */ #define DFU_APP_DATA_RESERVED CODE_PAGE_SIZE*7 /**< Size of Application Data that must be preserved between application updates. This value must be a multiple of page size. Page size is 0x400 (1024d) bytes, thus this value must be 0x0000, 0x0400, 0x0800, 0x0C00, 0x1000, etc. */
#endif #endif
#define DFU_IMAGE_MAX_SIZE_FULL (DFU_REGION_TOTAL_SIZE - DFU_APP_DATA_RESERVED) /**< Maximum size of an application, excluding save data from the application. */ #define DFU_IMAGE_MAX_SIZE_FULL (DFU_REGION_TOTAL_SIZE - DFU_APP_DATA_RESERVED) /**< Maximum size of an application, excluding save data from the application. */

View File

@ -101,12 +101,8 @@ enum { BLE_CONN_CFG_HIGH_BANDWIDTH = 1 };
// Adafruit for factory reset // Adafruit for factory reset
#define APPDATA_ADDR_START (BOOTLOADER_REGION_START-DFU_APP_DATA_RESERVED) #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); STATIC_ASSERT( APPDATA_ADDR_START == 0xED000);
#endif
void adafruit_factory_reset(void); void adafruit_factory_reset(void);
volatile bool _freset_erased_complete = false; volatile bool _freset_erased_complete = false;

View File

@ -1,7 +1,7 @@
<!DOCTYPE Board_Memory_Definition_File> <!DOCTYPE Board_Memory_Definition_File>
<root name="nRF52840_xxAA"> <root name="nRF52840_xxAA">
<MemorySegment name="FLASH" start="0x000F4000" size="0xA000" access="ReadOnly" /> <MemorySegment name="FLASH" start="0x000F4000" size="0xA000" access="ReadOnly" />
<!-- MemorySegment name="FLASH" start="0x000E4000" size="0x1A000" access="ReadOnly" /--> <!--MemorySegment name="FLASH" start="0x000ED000" size="0x11000" access="ReadOnly" /-->
<MemorySegment name="BOOTLOADER_SETTINGS" start="0x000FF000" size="0x1000" access="ReadOnly" /> <MemorySegment name="BOOTLOADER_SETTINGS" start="0x000FF000" size="0x1000" access="ReadOnly" />
<MemorySegment name="MBR_PARAMS_PAGE" start="0x000FE000" size="0x1000" access="ReadOnly" /> <MemorySegment name="MBR_PARAMS_PAGE" start="0x000FE000" size="0x1000" access="ReadOnly" />
<MemorySegment name="UICR_BOOTLOADER" start="0x10001014" size="0x04" access="ReadOnly" /> <MemorySegment name="UICR_BOOTLOADER" start="0x10001014" size="0x04" access="ReadOnly" />

View File

@ -18,7 +18,7 @@
arm_target_debug_interface_type="ADIv5" arm_target_debug_interface_type="ADIv5"
arm_target_device_name="nRF52840_xxAA" arm_target_device_name="nRF52840_xxAA"
arm_target_interface_type="SWD" arm_target_interface_type="SWD"
c_preprocessor_definitions="NRF52840_XXAA;__nRF_FAMILY;ARM_MATH_CM4;FLASH_PLACEMENT=1;NO_VTOR_CONFIG;BOARD_FEATHER52840;BOOTLOADER_VERSION=0x06000001;S140;CONFIG_GPIO_AS_PINRESET;BLE_STACK_SUPPORT_REQD;SWI_DISABLE0;SOFTDEVICE_PRESENT;FLOAT_ABI_HARD;DFU_APP_DATA_RESERVED=7*4096" c_preprocessor_definitions="NRF52840_XXAA;__nRF_FAMILY;ARM_MATH_CM4;FLASH_PLACEMENT=1;NO_VTOR_CONFIG;BOARD_FEATHER52840;BOOTLOADER_VERSION=0x06000001;S140;CONFIG_GPIO_AS_PINRESET;BLE_STACK_SUPPORT_REQD;SWI_DISABLE0;SOFTDEVICE_PRESENT;FLOAT_ABI_HARD"
c_user_include_directories="../;$(TusbDir);$(SdDir)/s140/headers;$(SdDir)/s140/headers/nrf52;$(Sdk11Dir)/drivers_nrf/pstorage;$(Sdk11Dir)/ble/common/;$(Sdk11Dir)/ble/ble_services/ble_dfu;$(Sdk11Dir)/ble/ble_services/ble_dis;$(Sdk11Dir)/libraries/bootloader_dfu;$(Sdk11Dir)/libraries/bootloader_dfu/hci_transport;$(Sdk11Dir)/libraries/util;$(SdkDir)/toolchain/cmsis/include;$(SdkDir)/device;$(SdkDir)/toolchain;$(SdkDir)/drivers_nrf/hal;$(SdkDir)/drivers_nrf/systick;$(SdkDir)/drivers_nrf/uart;$(SdkDir)/drivers_nrf/usbd;$(SdkDir)/drivers_nrf/common;$(SdkDir)/drivers_nrf/delay;$(SdkDir)/drivers_nrf/power;$(SdkDir)/drivers_nrf/clock;$(SdkDir)/libraries/util;$(SdkDir)/libraries/timer;$(SdkDir)/libraries/scheduler;$(SdkDir)/libraries/crc16;$(SdkDir)/libraries/util;$(SdkDir)/libraries/hci/config;$(SdkDir)/libraries/uart;$(SdkDir)/libraries/hci;$(SdkDir)/external/fprintf;$(SdkDir)/libraries/strerror;$(SdkDir)/libraries/atomic;$(SdkDir)/libraries/balloc;$(SdkDir)/libraries/experimental_log/src;$(SdkDir)/libraries/experimental_log;$(SdkDir)/libraries/experimental_section_vars;$(SdkDir)/libraries/experimental_memobj" c_user_include_directories="../;$(TusbDir);$(SdDir)/s140/headers;$(SdDir)/s140/headers/nrf52;$(Sdk11Dir)/drivers_nrf/pstorage;$(Sdk11Dir)/ble/common/;$(Sdk11Dir)/ble/ble_services/ble_dfu;$(Sdk11Dir)/ble/ble_services/ble_dis;$(Sdk11Dir)/libraries/bootloader_dfu;$(Sdk11Dir)/libraries/bootloader_dfu/hci_transport;$(Sdk11Dir)/libraries/util;$(SdkDir)/toolchain/cmsis/include;$(SdkDir)/device;$(SdkDir)/toolchain;$(SdkDir)/drivers_nrf/hal;$(SdkDir)/drivers_nrf/systick;$(SdkDir)/drivers_nrf/uart;$(SdkDir)/drivers_nrf/usbd;$(SdkDir)/drivers_nrf/common;$(SdkDir)/drivers_nrf/delay;$(SdkDir)/drivers_nrf/power;$(SdkDir)/drivers_nrf/clock;$(SdkDir)/libraries/util;$(SdkDir)/libraries/timer;$(SdkDir)/libraries/scheduler;$(SdkDir)/libraries/crc16;$(SdkDir)/libraries/util;$(SdkDir)/libraries/hci/config;$(SdkDir)/libraries/uart;$(SdkDir)/libraries/hci;$(SdkDir)/external/fprintf;$(SdkDir)/libraries/strerror;$(SdkDir)/libraries/atomic;$(SdkDir)/libraries/balloc;$(SdkDir)/libraries/experimental_log/src;$(SdkDir)/libraries/experimental_log;$(SdkDir)/libraries/experimental_section_vars;$(SdkDir)/libraries/experimental_memobj"
debug_register_definition_file="$(ProjectDir)/nrf52840_Registers.xml" debug_register_definition_file="$(ProjectDir)/nrf52840_Registers.xml"
debug_target_connection="J-Link" debug_target_connection="J-Link"