Skip to content

Commit

Permalink
nrf52840: Minor fixes and macro name changes
Browse files Browse the repository at this point in the history
  • Loading branch information
mbrossard committed Aug 17, 2023
1 parent 6b526ca commit dd894f4
Show file tree
Hide file tree
Showing 5 changed files with 28 additions and 23 deletions.
2 changes: 1 addition & 1 deletion records/board/nrf52840_dongle.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
common:
macros:
- NRF52840DONGLE
- NRF_OPEN_BOOTLOADER
2 changes: 1 addition & 1 deletion records/board/thingy91.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
common:
macros:
- THINGY91
- NRF_SECURE_BOOTLOADER
sources:
board:
- source/board/thingy91.c
2 changes: 1 addition & 1 deletion source/daplink/daplink.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
43 changes: 24 additions & 19 deletions source/hic_hal/nordic/nrf52840/daplink_addr.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand All @@ -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

Expand Down
2 changes: 1 addition & 1 deletion test/info.py
Original file line number Diff line number Diff line change
Expand Up @@ -250,7 +250,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 ),
Expand Down

0 comments on commit dd894f4

Please sign in to comment.