Skip to content

Commit ae58278

Browse files
committed
nrf52840: Minor fixes and macro name changes
1 parent 2bf71b8 commit ae58278

File tree

5 files changed

+28
-23
lines changed

5 files changed

+28
-23
lines changed

records/board/nrf52840_dongle.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
common:
22
macros:
3-
- NRF52840DONGLE
3+
- NRF_OPEN_BOOTLOADER

records/board/thingy91.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
common:
22
macros:
3-
- THINGY91
3+
- NRF_SECURE_BOOTLOADER
44
sources:
55
board:
66
- source/board/thingy91.c

source/daplink/daplink.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ extern "C" {
3838
// ROM check
3939
COMPILER_ASSERT(DAPLINK_ROM_BL_START == DAPLINK_ROM_START);
4040

41-
#if !defined(THINGY91)
41+
#if !defined(NON_CONTIGUOUS_USER_CONFIG)
4242
COMPILER_ASSERT(DAPLINK_ROM_IF_START + DAPLINK_ROM_IF_SIZE == DAPLINK_ROM_CONFIG_USER_START);
4343
COMPILER_ASSERT(DAPLINK_ROM_CONFIG_USER_START + DAPLINK_ROM_CONFIG_USER_SIZE == DAPLINK_ROM_START + DAPLINK_ROM_SIZE);
4444
#endif

source/hic_hal/nordic/nrf52840/daplink_addr.h

Lines changed: 24 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -30,41 +30,38 @@
3030

3131
/* ROM sizes */
3232

33-
#if defined(THINGY91)
3433

35-
#define DAPLINK_ROM_BL_START 0x00000000
36-
#define DAPLINK_ROM_BL_SIZE 0x00013000
37-
38-
#define DAPLINK_ROM_IF_START 0x00013000
39-
#define DAPLINK_ROM_IF_SIZE 0x0002D000
40-
41-
#define DAPLINK_ROM_CONFIG_USER_START 0x000FE000
42-
#define DAPLINK_ROM_CONFIG_USER_SIZE 0x00002000
43-
44-
#elif defined(NRF52840DONGLE)
4534

4635
#define DAPLINK_ROM_BL_START 0x00000000
47-
#define DAPLINK_ROM_BL_SIZE 0x00001000
4836

37+
#if !defined(NRF_SECURE_BOOTLOADER)
38+
39+
#if !defined(NRF_OPEN_BOOTLOADER)
40+
#define DAPLINK_ROM_BL_SIZE 0x00010000 // 64 KiB DAPLink bootloader
41+
#define DAPLINK_ROM_IF_START 0x00010000
42+
#define DAPLINK_ROM_IF_SIZE 0x0002F000
43+
#else // NRF_OPEN_BOOTLOADER
44+
#define DAPLINK_ROM_BL_SIZE 0x00001000 // 4 KiB MBR
4945
#define DAPLINK_ROM_IF_START 0x00001000
5046
#define DAPLINK_ROM_IF_SIZE 0x0003E000
47+
#endif
5148

5249
#define DAPLINK_ROM_CONFIG_USER_START 0x0003F000
5350
#define DAPLINK_ROM_CONFIG_USER_SIZE 0x00001000
5451

55-
#else
52+
#else // NRF_SECURE_BOOTLOADER
5653

57-
#define DAPLINK_ROM_BL_START 0x00000000
58-
#define DAPLINK_ROM_BL_SIZE 0x00010000 // 64 KiB bootloader
59-
60-
#define DAPLINK_ROM_IF_START 0x00010000
61-
#define DAPLINK_ROM_IF_SIZE 0x0002F000
54+
#define DAPLINK_ROM_BL_SIZE 0x00013000 // 76 KiB MCUBOOT
55+
#define DAPLINK_ROM_IF_START 0x00013000
56+
#define DAPLINK_ROM_IF_SIZE 0x0002C000
6257

63-
#define DAPLINK_ROM_CONFIG_USER_START 0x0003F000
58+
#define NON_CONTIGUOUS_USER_CONFIG
59+
#define DAPLINK_ROM_CONFIG_USER_START 0x000F7000
6460
#define DAPLINK_ROM_CONFIG_USER_SIZE 0x00001000
6561

6662
#endif
6763

64+
6865
/* RAM sizes */
6966

7067
#define DAPLINK_RAM_APP_START 0x20000000
@@ -82,6 +79,10 @@
8279

8380
#if defined(DAPLINK_BL)
8481

82+
#if defined(NRF_SECURE_BOOTLOADER) || defined(NRF_OPEN_BOOTLOADER)
83+
#error ""
84+
#endif
85+
8586
#define DAPLINK_ROM_APP_START DAPLINK_ROM_BL_START
8687
#define DAPLINK_ROM_APP_SIZE DAPLINK_ROM_BL_SIZE
8788
#define DAPLINK_ROM_UPDATE_START DAPLINK_ROM_IF_START
@@ -92,7 +93,11 @@
9293
#define DAPLINK_ROM_APP_START DAPLINK_ROM_IF_START
9394
#define DAPLINK_ROM_APP_SIZE DAPLINK_ROM_IF_SIZE
9495
#define DAPLINK_ROM_UPDATE_START DAPLINK_ROM_BL_START
96+
#if !defined(NRF_SECURE_BOOTLOADER) && !defined(NRF_OPEN_BOOTLOADER)
9597
#define DAPLINK_ROM_UPDATE_SIZE DAPLINK_ROM_BL_SIZE
98+
#else
99+
#define DAPLINK_ROM_UPDATE_SIZE 0 // Disable update
100+
#endif
96101

97102
#else
98103

test/info.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -259,7 +259,7 @@ def VENDOR_TO_FAMILY(x, y) : return (VENDOR_ID[x] <<8) | y
259259
( 0x0000, VENDOR_TO_FAMILY('Stub', 1), 'max32625_if', None, None ),
260260
( 0x0000, VENDOR_TO_FAMILY('Stub', 1), 'nrf52820_if', None, None ),
261261
( 0x0000, VENDOR_TO_FAMILY('Stub', 1), 'nrf52840_if', None, None ),
262-
( 0x0000, VENDOR_TO_FAMILY('Stub', 1), 'nrf52840dongle_if', None, None ),
262+
( 0x0000, VENDOR_TO_FAMILY('Stub', 1), 'nrf52840_dongle_if', None, None ),
263263
( 0x0000, VENDOR_TO_FAMILY('Nordic', 4), 'nrf52840_thingy91_if', None, None ),
264264
( 0x0000, VENDOR_TO_FAMILY('Stub', 1), 'sam3u2c_if', None, None ),
265265
( 0x0000, VENDOR_TO_FAMILY('Stub', 1), 'stm32f103xb_if', None, None ),

0 commit comments

Comments
 (0)