Skip to content

Commit 2ce3dd0

Browse files
committed
Make space reserved for bootloader smaller, add better comments about what needs changing
1 parent e7bf7b9 commit 2ce3dd0

File tree

6 files changed

+973
-1134
lines changed

6 files changed

+973
-1134
lines changed

Makefile

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1347,11 +1347,12 @@ ifeq ($(FAMILY), NRF52)
13471347

13481348
ifdef USE_BOOTLOADER
13491349
NRF_BOOTLOADER = $(ROOT)/targetlibs/nrf5x/nrf5_singlebank_bl_hex/nrf52_s132_singlebank_bl.hex
1350-
NFR_BL_START_ADDR = 0x78000 # see dfu_gcc_nrf52.ld
1350+
NFR_BL_START_ADDR = 0x7A000 # see Makefile, dfu_gcc_nrf52.ld, linker_nrf52_ble_espruino_bootloader.ld and dfu_types.h
13511351
NRF_BOOTLOADER_SETTINGS = $(ROOT)/targetlibs/nrf5x/nrf5_singlebank_bl_hex/bootloader_settings_nrf52.hex # Writes address 0x7F000 with 0x01.
13521352
ifdef BOOTLOADER
13531353
# we're trying to compile the bootloader itself
13541354
LINKER_FILE = $(NRF5X_SDK_PATH)/../nrf5x_linkers/dfu_gcc_nrf52.ld
1355+
OPTIMIZEFLAGS=-Os # try to reduce bootloader size
13551356
else
13561357
LINKER_FILE = $(NRF5X_SDK_PATH)/../nrf5x_linkers/linker_nrf52_ble_espruino_bootloader.ld
13571358
endif

targetlibs/nrf5x/nrf5_sdk/components/libraries/bootloader_dfu/dfu_types.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,8 +57,8 @@
5757

5858

5959
#elif NRF52
60-
61-
#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. */
60+
// see Makefile, dfu_gcc_nrf52.ld, linker_nrf52_ble_espruino_bootloader.ld and dfu_types.h
61+
#define BOOTLOADER_REGION_START 0x0007A000 /**< 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. */
6262
#define BOOTLOADER_SETTINGS_ADDRESS 0x0007F000 /**< The field specifies the page location of the bootloader settings address. */
6363
#define BOOTLOADER_MBR_PARAMS_PAGE_ADDRESS 0x0007E000 /**< The field specifies the page location of the mbr params page address. */
6464

0 commit comments

Comments
 (0)