Skip to content

Commit 16e7af4

Browse files
committed
fix linker for 833
compile and able to flash but 52833 is not compatible with S140 v6, need to upgrade it to S140 v7
1 parent 1597434 commit 16e7af4

File tree

4 files changed

+116
-20
lines changed

4 files changed

+116
-20
lines changed

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ SD_FILENAME = $(SD_NAME)_nrf52_$(SD_VERSION)
2121
SD_API_PATH = $(SD_PATH)/$(SD_FILENAME)_API
2222
SD_HEX = $(SD_PATH)/$(SD_FILENAME)_softdevice.hex
2323

24-
LD_FILE = $(SRC_PATH)/linker/$(SD_NAME)_v$(word 1, $(subst ., ,$(SD_VERSION))).ld
24+
LD_FILE = $(SRC_PATH)/linker/$(MCU_SUB_VARIANT)_$(SD_NAME)_v$(word 1, $(subst ., ,$(SD_VERSION))).ld
2525

2626
MERGED_FNAME = $(OUTPUT_FILENAME)_$(SD_NAME)_$(SD_VERSION)
2727

src/linker/nrf52833_s140_v6.ld

Lines changed: 91 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,91 @@
1+
/* Linker script to configure memory regions. */
2+
3+
SEARCH_DIR(.)
4+
GROUP(-lgcc -lc -lnosys)
5+
6+
MEMORY
7+
{
8+
/** Flash start address for the bootloader. This setting will also be stored in UICR to allow the
9+
* MBR to init the bootloader when starting the system. This value must correspond to
10+
* BOOTLOADER_REGION_START found in dfu_types.h. The system is prevented from starting up if
11+
* those values do not match. The check is performed in main.c, see
12+
* APP_ERROR_CHECK_BOOL(*((uint32_t *)NRF_UICR_BOOT_START_ADDRESS) == BOOTLOADER_REGION_START);
13+
*/
14+
FLASH (rx) : ORIGIN = 0x74000, LENGTH = 0x7E000-0x74000 /* 40 KB */
15+
16+
/** Location of mbr params page in flash. */
17+
MBR_PARAMS_PAGE (rw) : ORIGIN = 0x0007E000, LENGTH = 0x1000
18+
19+
/** Location of bootloader setting in flash. */
20+
BOOTLOADER_SETTINGS (rw) : ORIGIN = 0x0007F000, LENGTH = 0x1000
21+
22+
23+
24+
/** RAM Region for bootloader. */
25+
/* Avoid conflict with NOINIT for OTA bond sharing */
26+
RAM (rwx) : ORIGIN = 0x20008000, LENGTH = 0x20020000-0x20008000
27+
28+
/* Location for double reset detection, no init */
29+
DBL_RESET (rwx) : ORIGIN = 0x20007F7C, LENGTH = 0x04
30+
31+
/** Location of non initialized RAM. Non initialized RAM is used for exchanging bond information
32+
* from application to bootloader when using buttonluss DFU OTA. */
33+
NOINIT (rwx) : ORIGIN = 0x20007F80, LENGTH = 0x80
34+
35+
36+
37+
/** Location in UICR where bootloader start address is stored. */
38+
UICR_BOOTLOADER (r) : ORIGIN = 0x10001014, LENGTH = 0x04
39+
40+
/** Location in UICR where mbr params page address is stored. */
41+
UICR_MBR_PARAM_PAGE(r) : ORIGIN = 0x10001018, LENGTH = 0x04
42+
}
43+
44+
SECTIONS
45+
{
46+
.fs_data_out ALIGN(4):
47+
{
48+
PROVIDE( __start_fs_data = .);
49+
KEEP(*(fs_data))
50+
PROVIDE( __stop_fs_data = .);
51+
} = 0
52+
53+
/* Place the bootloader settings page in flash. */
54+
.bootloaderSettings(NOLOAD) :
55+
{
56+
57+
} > BOOTLOADER_SETTINGS
58+
59+
/* Write the bootloader address in UICR. */
60+
.uicrBootStartAddress :
61+
{
62+
KEEP(*(.uicrBootStartAddress))
63+
} > UICR_BOOTLOADER
64+
65+
/* Place the mbr params page in flash. */
66+
.mbrParamsPage(NOLOAD) :
67+
{
68+
69+
} > MBR_PARAMS_PAGE
70+
71+
/* Write the bootloader address in UICR. */
72+
.uicrMbrParamsPageAddress :
73+
{
74+
KEEP(*(.uicrMbrParamsPageAddress))
75+
} > UICR_MBR_PARAM_PAGE
76+
77+
.dbl_reset(NOLOAD) :
78+
{
79+
80+
} > DBL_RESET
81+
82+
/* No init RAM section in bootloader. Used for bond information exchange. */
83+
.noinit(NOLOAD) :
84+
{
85+
86+
} > NOINIT
87+
88+
/* other placements follow here... */
89+
}
90+
91+
INCLUDE "nrf_common.ld"

src/linker/s140_v6.ld renamed to src/linker/nrf52840_s140_v6.ld

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,15 @@ MEMORY
1111
* those values do not match. The check is performed in main.c, see
1212
* APP_ERROR_CHECK_BOOL(*((uint32_t *)NRF_UICR_BOOT_START_ADDRESS) == BOOTLOADER_REGION_START);
1313
*/
14-
FLASH (rx) : ORIGIN = 0xF4000, LENGTH = 0xA000 /* 40 KB */
14+
FLASH (rx) : ORIGIN = 0xF4000, LENGTH = 0xFE000-0xF4000 /* 40 KB */
15+
16+
/** Location of mbr params page in flash. */
17+
MBR_PARAMS_PAGE (rw) : ORIGIN = 0xFE000, LENGTH = 0x1000
18+
19+
/** Location of bootloader setting in flash. */
20+
BOOTLOADER_SETTINGS (rw) : ORIGIN = 0xFF000, LENGTH = 0x1000
21+
22+
1523

1624
/** RAM Region for bootloader. */
1725
/* Avoid conflict with NOINIT for OTA bond sharing */
@@ -21,20 +29,14 @@ MEMORY
2129
DBL_RESET (rwx) : ORIGIN = 0x20007F7C, LENGTH = 0x04
2230

2331
/** Location of non initialized RAM. Non initialized RAM is used for exchanging bond information
24-
* from application to bootloader when using buttonluss DFU OTA.
25-
*/
32+
* from application to bootloader when using buttonluss DFU OTA. */
2633
NOINIT (rwx) : ORIGIN = 0x20007F80, LENGTH = 0x80
2734

28-
29-
/** Location of bootloader setting in flash. */
30-
BOOTLOADER_SETTINGS (rw) : ORIGIN = 0x000FF000, LENGTH = 0x1000
31-
35+
36+
3237
/** Location in UICR where bootloader start address is stored. */
3338
UICR_BOOTLOADER (r) : ORIGIN = 0x10001014, LENGTH = 0x04
3439

35-
/** Location of mbr params page in flash. */
36-
MBR_PARAMS_PAGE (rw) : ORIGIN = 0x000FE000, LENGTH = 0x1000
37-
3840
/** Location in UICR where mbr params page address is stored. */
3941
UICR_MBR_PARAM_PAGE(r) : ORIGIN = 0x10001018, LENGTH = 0x04
4042
}

src/linker/s132_v6.ld renamed to src/linker/nrf52_s132_v6.ld

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -11,28 +11,31 @@ MEMORY
1111
* those values do not match. The check is performed in main.c, see
1212
* APP_ERROR_CHECK_BOOL(*((uint32_t *)NRF_UICR_BOOT_START_ADDRESS) == BOOTLOADER_REGION_START);
1313
*/
14-
FLASH (rx) : ORIGIN = 0x74000, LENGTH = 0xA000 /* 40 KB */
14+
FLASH (rx) : ORIGIN = 0x74000, LENGTH = 0x7E000-0x74000 /* 40 KB */
15+
16+
/** Location of mbr params page in flash. */
17+
MBR_PARAMS_PAGE (rw) : ORIGIN = 0x7E000, LENGTH = 0x1000
18+
19+
/** Location of bootloader setting in flash. */
20+
BOOTLOADER_SETTINGS (rw) : ORIGIN = 0x7F000, LENGTH = 0x1000
21+
22+
1523

1624
/** RAM Region for bootloader. */
17-
RAM (rwx) : ORIGIN = 0x20003000, LENGTH = 0x20007F7C-0x20003000
25+
RAM (rwx) : ORIGIN = 0x20008000, LENGTH = 0x20010000-0x20008000
1826

1927
/* Location for double reset detection, no init */
2028
DBL_RESET (rwx) : ORIGIN = 0x20007F7C, LENGTH = 0x04
2129

2230
/** Location of non initialized RAM. Non initialized RAM is used for exchanging bond information
23-
* from application to bootloader when using buttonluss DFU OTA.
24-
*/
31+
* from application to bootloader when using buttonluss DFU OTA. */
2532
NOINIT (rwx) : ORIGIN = 0x20007F80, LENGTH = 0x80
2633

27-
/** Location of bootloader setting in flash. */
28-
BOOTLOADER_SETTINGS (rw) : ORIGIN = 0x0007F000, LENGTH = 0x1000
2934

35+
3036
/** Location in UICR where bootloader start address is stored. */
3137
UICR_BOOTLOADER (r) : ORIGIN = 0x10001014, LENGTH = 0x04
3238

33-
/** Location of mbr params page in flash. */
34-
MBR_PARAMS_PAGE (rw) : ORIGIN = 0x0007E000, LENGTH = 0x1000
35-
3639
/** Location in UICR where mbr params page address is stored. */
3740
UICR_MBR_PARAM_PAGE(r) : ORIGIN = 0x10001018, LENGTH = 0x04
3841
}

0 commit comments

Comments
 (0)