diff --git a/records/board/nrf52840_dongle.yaml b/records/board/nrf52840_dongle.yaml index d805776d7..f97f78e9a 100644 --- a/records/board/nrf52840_dongle.yaml +++ b/records/board/nrf52840_dongle.yaml @@ -1,3 +1,3 @@ common: macros: - - NRF52840DONGLE + - NRF_OPEN_BOOTLOADER diff --git a/records/board/thingy91.yaml b/records/board/thingy91.yaml index 019682c03..0a7d2c847 100644 --- a/records/board/thingy91.yaml +++ b/records/board/thingy91.yaml @@ -1,6 +1,6 @@ common: macros: - - THINGY91 + - NRF_SECURE_BOOTLOADER sources: board: - source/board/thingy91.c diff --git a/source/daplink/daplink.h b/source/daplink/daplink.h index 732180af7..39ee307d4 100644 --- a/source/daplink/daplink.h +++ b/source/daplink/daplink.h @@ -38,7 +38,7 @@ extern "C" { // ROM check COMPILER_ASSERT(DAPLINK_ROM_BL_START == DAPLINK_ROM_START); -#if !defined(THINGY91) +#if !defined(NON_CONTIGUOUS_USER_CONFIG) COMPILER_ASSERT(DAPLINK_ROM_IF_START + DAPLINK_ROM_IF_SIZE == DAPLINK_ROM_CONFIG_USER_START); COMPILER_ASSERT(DAPLINK_ROM_CONFIG_USER_START + DAPLINK_ROM_CONFIG_USER_SIZE == DAPLINK_ROM_START + DAPLINK_ROM_SIZE); #endif diff --git a/source/hic_hal/nordic/nrf52840/daplink_addr.h b/source/hic_hal/nordic/nrf52840/daplink_addr.h index bf2638ed3..d1a00ef18 100644 --- a/source/hic_hal/nordic/nrf52840/daplink_addr.h +++ b/source/hic_hal/nordic/nrf52840/daplink_addr.h @@ -30,41 +30,38 @@ /* ROM sizes */ -#if defined(THINGY91) -#define DAPLINK_ROM_BL_START 0x00000000 -#define DAPLINK_ROM_BL_SIZE 0x00013000 - -#define DAPLINK_ROM_IF_START 0x00013000 -#define DAPLINK_ROM_IF_SIZE 0x0002D000 - -#define DAPLINK_ROM_CONFIG_USER_START 0x000FE000 -#define DAPLINK_ROM_CONFIG_USER_SIZE 0x00002000 - -#elif defined(NRF52840DONGLE) #define DAPLINK_ROM_BL_START 0x00000000 -#define DAPLINK_ROM_BL_SIZE 0x00001000 +#if !defined(NRF_SECURE_BOOTLOADER) + +#if !defined(NRF_OPEN_BOOTLOADER) +#define DAPLINK_ROM_BL_SIZE 0x00010000 // 64 KiB DAPLink bootloader +#define DAPLINK_ROM_IF_START 0x00010000 +#define DAPLINK_ROM_IF_SIZE 0x0002F000 +#else // NRF_OPEN_BOOTLOADER +#define DAPLINK_ROM_BL_SIZE 0x00001000 // 4 KiB MBR #define DAPLINK_ROM_IF_START 0x00001000 #define DAPLINK_ROM_IF_SIZE 0x0003E000 +#endif #define DAPLINK_ROM_CONFIG_USER_START 0x0003F000 #define DAPLINK_ROM_CONFIG_USER_SIZE 0x00001000 -#else +#else // NRF_SECURE_BOOTLOADER -#define DAPLINK_ROM_BL_START 0x00000000 -#define DAPLINK_ROM_BL_SIZE 0x00010000 // 64 KiB bootloader - -#define DAPLINK_ROM_IF_START 0x00010000 -#define DAPLINK_ROM_IF_SIZE 0x0002F000 +#define DAPLINK_ROM_BL_SIZE 0x00013000 // 76 KiB MCUBOOT +#define DAPLINK_ROM_IF_START 0x00013000 +#define DAPLINK_ROM_IF_SIZE 0x0002C000 -#define DAPLINK_ROM_CONFIG_USER_START 0x0003F000 +#define NON_CONTIGUOUS_USER_CONFIG +#define DAPLINK_ROM_CONFIG_USER_START 0x000F7000 #define DAPLINK_ROM_CONFIG_USER_SIZE 0x00001000 #endif + /* RAM sizes */ #define DAPLINK_RAM_APP_START 0x20000000 @@ -82,6 +79,10 @@ #if defined(DAPLINK_BL) +#if defined(NRF_SECURE_BOOTLOADER) || defined(NRF_OPEN_BOOTLOADER) +#error "" +#endif + #define DAPLINK_ROM_APP_START DAPLINK_ROM_BL_START #define DAPLINK_ROM_APP_SIZE DAPLINK_ROM_BL_SIZE #define DAPLINK_ROM_UPDATE_START DAPLINK_ROM_IF_START @@ -92,7 +93,11 @@ #define DAPLINK_ROM_APP_START DAPLINK_ROM_IF_START #define DAPLINK_ROM_APP_SIZE DAPLINK_ROM_IF_SIZE #define DAPLINK_ROM_UPDATE_START DAPLINK_ROM_BL_START +#if !defined(NRF_SECURE_BOOTLOADER) && !defined(NRF_OPEN_BOOTLOADER) #define DAPLINK_ROM_UPDATE_SIZE DAPLINK_ROM_BL_SIZE +#else +#define DAPLINK_ROM_UPDATE_SIZE 0 // Disable update +#endif #else diff --git a/test/info.py b/test/info.py index 1c9edb266..d6b093214 100644 --- a/test/info.py +++ b/test/info.py @@ -248,7 +248,7 @@ def VENDOR_TO_FAMILY(x, y) : return (VENDOR_ID[x] <<8) | y ( 0x0000, VENDOR_TO_FAMILY('Stub', 1), 'max32625_if', None, None ), ( 0x0000, VENDOR_TO_FAMILY('Stub', 1), 'nrf52820_if', None, None ), ( 0x0000, VENDOR_TO_FAMILY('Stub', 1), 'nrf52840_if', None, None ), - ( 0x0000, VENDOR_TO_FAMILY('Stub', 1), 'nrf52840dongle_if', None, None ), + ( 0x0000, VENDOR_TO_FAMILY('Stub', 1), 'nrf52840_dongle_if', None, None ), ( 0x0000, VENDOR_TO_FAMILY('Nordic', 4), 'nrf52840_thingy91_if', None, None ), ( 0x0000, VENDOR_TO_FAMILY('Stub', 1), 'sam3u2c_if', None, None ), ( 0x0000, VENDOR_TO_FAMILY('Stub', 1), 'stm32f103xb_if', None, None ),