Skip to content

Commit 95d1f05

Browse files
authored
Merge pull request #762 from oltaco/new-ldscript-for-extrafs
New linker scripts for NRF52 companion envs
2 parents ce39df5 + f92bd0d commit 95d1f05

File tree

17 files changed

+148
-4
lines changed

17 files changed

+148
-4
lines changed

boards/nrf52840_s140_v6_extrafs.ld

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
/* Linker script to configure memory regions. */
2+
3+
SEARCH_DIR(.)
4+
GROUP(-lgcc -lc -lnosys)
5+
6+
MEMORY
7+
{
8+
FLASH (rx) : ORIGIN = 0x26000, LENGTH = 0xD4000 - 0x26000
9+
10+
/* SRAM required by Softdevice depend on
11+
* - Attribute Table Size (Number of Services and Characteristics)
12+
* - Vendor UUID count
13+
* - Max ATT MTU
14+
* - Concurrent connection peripheral + central + secure links
15+
* - Event Len, HVN queue, Write CMD queue
16+
*/
17+
RAM (rwx) : ORIGIN = 0x20006000, LENGTH = 0x20040000 - 0x20006000
18+
}
19+
20+
SECTIONS
21+
{
22+
. = ALIGN(4);
23+
.svc_data :
24+
{
25+
PROVIDE(__start_svc_data = .);
26+
KEEP(*(.svc_data))
27+
PROVIDE(__stop_svc_data = .);
28+
} > RAM
29+
30+
.fs_data :
31+
{
32+
PROVIDE(__start_fs_data = .);
33+
KEEP(*(.fs_data))
34+
PROVIDE(__stop_fs_data = .);
35+
} > RAM
36+
} INSERT AFTER .data;
37+
38+
INCLUDE "nrf52_common.ld"

boards/nrf52840_s140_v7_extrafs.ld

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
/* Linker script to configure memory regions. */
2+
3+
SEARCH_DIR(.)
4+
GROUP(-lgcc -lc -lnosys)
5+
6+
MEMORY
7+
{
8+
FLASH (rx) : ORIGIN = 0x27000, LENGTH = 0xD4000 - 0x27000
9+
10+
/* SRAM required by Softdevice depend on
11+
* - Attribute Table Size (Number of Services and Characteristics)
12+
* - Vendor UUID count
13+
* - Max ATT MTU
14+
* - Concurrent connection peripheral + central + secure links
15+
* - Event Len, HVN queue, Write CMD queue
16+
*/
17+
RAM (rwx) : ORIGIN = 0x20006000, LENGTH = 0x20040000 - 0x20006000
18+
}
19+
20+
SECTIONS
21+
{
22+
. = ALIGN(4);
23+
.svc_data :
24+
{
25+
PROVIDE(__start_svc_data = .);
26+
KEEP(*(.svc_data))
27+
PROVIDE(__stop_svc_data = .);
28+
} > RAM
29+
30+
.fs_data :
31+
{
32+
PROVIDE(__start_fs_data = .);
33+
KEEP(*(.fs_data))
34+
PROVIDE(__stop_fs_data = .);
35+
} > RAM
36+
} INSERT AFTER .data;
37+
38+
INCLUDE "nrf52_common.ld"

variants/heltec_mesh_solar/platformio.ini

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,8 @@ build_flags =
5757

5858
[env:Heltec_mesh_solar_companion_radio_ble]
5959
extends = Heltec_mesh_solar
60+
board_build.ldscript = boards/nrf52840_s140_v6_extrafs.ld
61+
board_upload.maximum_size = 712704
6062
build_flags =
6163
${Heltec_mesh_solar.build_flags}
6264
-D MAX_CONTACTS=350
@@ -75,6 +77,8 @@ lib_deps =
7577

7678
[env:Heltec_mesh_solar_companion_radio_usb]
7779
extends = Heltec_mesh_solar
80+
board_build.ldscript = boards/nrf52840_s140_v6_extrafs.ld
81+
board_upload.maximum_size = 712704
7882
build_flags =
7983
${Heltec_mesh_solar.build_flags}
8084
-D MAX_CONTACTS=350

variants/heltec_t114/platformio.ini

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,8 @@ build_flags =
7070

7171
[env:Heltec_t114_without_display_companion_radio_ble]
7272
extends = Heltec_t114
73+
board_build.ldscript = boards/nrf52840_s140_v6_extrafs.ld
74+
board_upload.maximum_size = 712704
7375
build_flags =
7476
${Heltec_t114.build_flags}
7577
-I examples/companion_radio/ui-new
@@ -90,6 +92,8 @@ lib_deps =
9092

9193
[env:Heltec_t114_without_display_companion_radio_usb]
9294
extends = Heltec_t114
95+
board_build.ldscript = boards/nrf52840_s140_v6_extrafs.ld
96+
board_upload.maximum_size = 712704
9397
build_flags =
9498
${Heltec_t114.build_flags}
9599
-I examples/companion_radio/ui-new
@@ -158,6 +162,8 @@ build_flags =
158162

159163
[env:Heltec_t114_companion_radio_ble]
160164
extends = Heltec_t114_with_display
165+
board_build.ldscript = boards/nrf52840_s140_v6_extrafs.ld
166+
board_upload.maximum_size = 712704
161167
build_flags =
162168
${Heltec_t114_with_display.build_flags}
163169
-I examples/companion_radio/ui-new
@@ -178,6 +184,8 @@ lib_deps =
178184

179185
[env:Heltec_t114_companion_radio_usb]
180186
extends = Heltec_t114_with_display
187+
board_build.ldscript = boards/nrf52840_s140_v6_extrafs.ld
188+
board_upload.maximum_size = 712704
181189
build_flags =
182190
${Heltec_t114_with_display.build_flags}
183191
-I examples/companion_radio/ui-new

variants/ikoka_stick_nrf/platformio.ini

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,8 @@ build_src_filter = ${nrf52840_xiao.build_src_filter}
101101

102102
[ikoka_stick_nrf_companion_radio_ble]
103103
extends = ikoka_stick_nrf_baseboard
104+
board_build.ldscript = boards/nrf52840_s140_v7_extrafs.ld
105+
board_upload.maximum_size = 708608
104106
build_flags =
105107
${ikoka_stick_nrf_baseboard.build_flags}
106108
-D MAX_CONTACTS=350
@@ -121,6 +123,8 @@ lib_deps =
121123

122124
[ikoka_stick_nrf_companion_radio_usb]
123125
extends = ikoka_stick_nrf_baseboard
126+
board_build.ldscript = boards/nrf52840_s140_v7_extrafs.ld
127+
board_upload.maximum_size = 708608
124128
build_flags =
125129
${ikoka_stick_nrf_baseboard.build_flags}
126130
-D MAX_CONTACTS=350

variants/lilygo_techo/platformio.ini

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,8 @@ build_flags =
7878

7979
[env:LilyGo_T-Echo_companion_radio_ble]
8080
extends = LilyGo_T-Echo
81+
board_build.ldscript = boards/nrf52840_s140_v6_extrafs.ld
82+
board_upload.maximum_size = 712704
8183
build_flags =
8284
${LilyGo_T-Echo.build_flags}
8385
-I src/helpers/ui
@@ -103,6 +105,8 @@ lib_deps =
103105

104106
[env:LilyGo_T-Echo_companion_radio_usb]
105107
extends = LilyGo_T-Echo
108+
board_build.ldscript = boards/nrf52840_s140_v6_extrafs.ld
109+
board_upload.maximum_size = 712704
106110
build_flags =
107111
${LilyGo_T-Echo.build_flags}
108112
-I src/helpers/ui
@@ -113,6 +117,7 @@ build_flags =
113117
-D UI_RECENT_LIST_SIZE=9
114118
-D UI_SENSORS_PAGE=1
115119
-D AUTO_SHUTDOWN_MILLIVOLTS=3300
120+
-D QSPIFLASH=1
116121
build_src_filter = ${LilyGo_T-Echo.build_src_filter}
117122
+<../examples/companion_radio/*.cpp>
118123
+<../examples/companion_radio/ui-new/*.cpp>

variants/mesh_pocket/platformio.ini

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,8 @@ build_flags =
6767

6868
[env:Mesh_pocket_companion_radio_ble]
6969
extends = Mesh_pocket
70+
board_build.ldscript = boards/nrf52840_s140_v6_extrafs.ld
71+
board_upload.maximum_size = 712704
7072
build_flags =
7173
${Mesh_pocket.build_flags}
7274
-I examples/companion_radio/ui-new
@@ -89,6 +91,8 @@ lib_deps =
8991

9092
[env:Mesh_pocket_companion_radio_usb]
9193
extends = Mesh_pocket
94+
board_build.ldscript = boards/nrf52840_s140_v6_extrafs.ld
95+
board_upload.maximum_size = 712704
9296
build_flags =
9397
${Mesh_pocket.build_flags}
9498
-I examples/companion_radio/ui-new

variants/minewsemi_me25ls01/platformio.ini

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,8 @@ lib_deps = ${nrf52840_me25ls01.lib_deps}
5050

5151
[env:Minewsemi_me25ls01_companion_radio_ble]
5252
extends = me25ls01
53+
board_build.ldscript = boards/nrf52840_s140_v7_extrafs.ld
54+
board_upload.maximum_size = 708608
5355
build_flags = ${me25ls01.build_flags}
5456
-I examples/companion_radio/ui-orig
5557
-D MAX_CONTACTS=350
@@ -147,6 +149,8 @@ lib_deps = ${me25ls01.lib_deps}
147149

148150
[env:Minewsemi_me25ls01_companion_radio_usb]
149151
extends = me25ls01
152+
board_build.ldscript = boards/nrf52840_s140_v7_extrafs.ld
153+
board_upload.maximum_size = 708608
150154
build_flags = ${me25ls01.build_flags}
151155
-I examples/companion_radio/ui-orig
152156
-D MAX_CONTACTS=350

variants/nano_g2_ultra/platformio.ini

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,8 @@ upload_protocol = nrfutil
3131

3232
[env:Nano_G2_Ultra_companion_radio_ble]
3333
extends = Nano_G2_Ultra
34+
board_build.ldscript = boards/nrf52840_s140_v6_extrafs.ld
35+
board_upload.maximum_size = 712704
3436
build_flags =
3537
${Nano_G2_Ultra.build_flags}
3638
-I src/helpers/ui
@@ -62,12 +64,15 @@ lib_deps =
6264

6365
[env:Nano_G2_Ultra_companion_radio_usb]
6466
extends = Nano_G2_Ultra
67+
board_build.ldscript = boards/nrf52840_s140_v6_extrafs.ld
68+
board_upload.maximum_size = 712704
6569
build_flags =
6670
${Nano_G2_Ultra.build_flags}
6771
-I src/helpers/ui
6872
-I examples/companion_radio/ui-new
6973
-D MAX_CONTACTS=350
7074
-D MAX_GROUP_CHANNELS=40
75+
-D QSPIFLASH=1
7176
-D OFFLINE_QUEUE_SIZE=256
7277
-D DISPLAY_CLASS=SH1106Display
7378
-D PIN_BUZZER=4

variants/promicro/platformio.ini

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,8 @@ lib_deps = ${Faketec.lib_deps}
8686

8787
[env:Faketec_companion_radio_usb]
8888
extends = Faketec
89+
board_build.ldscript = boards/nrf52840_s140_v6_extrafs.ld
90+
board_upload.maximum_size = 712704
8991
build_flags = ${Faketec.build_flags}
9092
-I examples/companion_radio/ui-new
9193
-D MAX_CONTACTS=350
@@ -104,6 +106,8 @@ lib_deps = ${Faketec.lib_deps}
104106

105107
[env:Faketec_companion_radio_ble]
106108
extends = Faketec
109+
board_build.ldscript = boards/nrf52840_s140_v6_extrafs.ld
110+
board_upload.maximum_size = 712704
107111
build_flags = ${Faketec.build_flags}
108112
-I examples/companion_radio/ui-new
109113
-D MAX_CONTACTS=350

0 commit comments

Comments
 (0)