From b6857b85f05d56017a111191b9447fd682208802 Mon Sep 17 00:00:00 2001 From: fanoush Date: Sat, 18 Jan 2020 13:21:27 +0000 Subject: [PATCH] Shrink the bootloader size for nrf52832 nrf52832 is short of flash and we can shave a little size of the bootloader... let's do that. From https://github.com/fanoush/ds-d6/blob/c4579ff25166722566c1b9251a20f99027972588/micropython/Adafruit_nRF52_Bootloader-dsd6.diff [daniel@redfelineninja.org.uk: Seperated out of the main DS-D6 patch] --- lib/sdk11/components/libraries/bootloader_dfu/dfu_types.h | 2 +- src/linker/nrf52_s132_v6.ld | 2 +- src/main.c | 2 +- 3 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 2ed7ba4..6f5aa0b 100644 --- a/lib/sdk11/components/libraries/bootloader_dfu/dfu_types.h +++ b/lib/sdk11/components/libraries/bootloader_dfu/dfu_types.h @@ -39,7 +39,7 @@ // Flash = 512 KB #if defined(NRF52832_XXAA) || defined(NRF52833_XXAA) -#define BOOTLOADER_REGION_START 0x00074000 /**< 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 0x00078000 /**< 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_SETTINGS_ADDRESS 0x0007F000 /**< The field specifies the page location of the bootloader settings address. */ #define BOOTLOADER_MBR_PARAMS_PAGE_ADDRESS 0x0007E000 /**< The field specifies the page location of the mbr params page address. */ diff --git a/src/linker/nrf52_s132_v6.ld b/src/linker/nrf52_s132_v6.ld index db8d06b..6c63b1a 100644 --- a/src/linker/nrf52_s132_v6.ld +++ b/src/linker/nrf52_s132_v6.ld @@ -11,7 +11,7 @@ MEMORY * those values do not match. The check is performed in main.c, see * APP_ERROR_CHECK_BOOL(*((uint32_t *)NRF_UICR_BOOT_START_ADDRESS) == BOOTLOADER_REGION_START); */ - FLASH (rx) : ORIGIN = 0x74000, LENGTH = 0x7E000-0x74000 /* 40 KB */ + FLASH (rx) : ORIGIN = 0x78000, LENGTH = 0x7E000-0x78000 /* 40 KB */ /** Location of mbr params page in flash. */ MBR_PARAMS_PAGE (rw) : ORIGIN = 0x7E000, LENGTH = 0x1000 diff --git a/src/main.c b/src/main.c index 811b1ad..57c4396 100644 --- a/src/main.c +++ b/src/main.c @@ -125,7 +125,7 @@ enum { BLE_CONN_CFG_HIGH_BANDWIDTH = 1 }; #else // Flash 512 KB - STATIC_ASSERT( APPDATA_ADDR_START == 0x6D000); + STATIC_ASSERT( APPDATA_ADDR_START == 0x71000); #endif