Skip to content

Commit 583ad02

Browse files
committed
increase sd attribute table size from 0x800 to 0xC00, increase linker memory for SD 840 from 3400 to 6000
1 parent 9860a6e commit 583ad02

File tree

4 files changed

+11
-9
lines changed

4 files changed

+11
-9
lines changed

boards.txt

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ feather52840.upload.protocol=nrfutil
8181
feather52840.upload.use_1200bps_touch=true
8282
feather52840.upload.wait_for_upload_port=true
8383
feather52840.upload.maximum_size=815104
84-
feather52840.upload.maximum_data_size=248832
84+
feather52840.upload.maximum_data_size=237568
8585

8686
# Build
8787
feather52840.build.mcu=cortex-m4
@@ -135,7 +135,7 @@ itsybitsy52840.upload.protocol=nrfutil
135135
itsybitsy52840.upload.use_1200bps_touch=true
136136
itsybitsy52840.upload.wait_for_upload_port=true
137137
itsybitsy52840.upload.maximum_size=815104
138-
itsybitsy52840.upload.maximum_data_size=248832
138+
itsybitsy52840.upload.maximum_data_size=237568
139139

140140
# Build
141141
itsybitsy52840.build.mcu=cortex-m4
@@ -188,7 +188,7 @@ cplaynrf52840.upload.protocol=nrfutil
188188
cplaynrf52840.upload.use_1200bps_touch=true
189189
cplaynrf52840.upload.wait_for_upload_port=true
190190
cplaynrf52840.upload.maximum_size=815104
191-
cplaynrf52840.upload.maximum_data_size=248832
191+
cplaynrf52840.upload.maximum_data_size=237568
192192

193193
# Build
194194
cplaynrf52840.build.mcu=cortex-m4
@@ -241,7 +241,7 @@ metro52840.upload.protocol=nrfutil
241241
metro52840.upload.use_1200bps_touch=true
242242
metro52840.upload.wait_for_upload_port=true
243243
metro52840.upload.maximum_size=815104
244-
metro52840.upload.maximum_data_size=248832
244+
metro52840.upload.maximum_data_size=237568
245245

246246
# Build
247247
metro52840.build.mcu=cortex-m4
@@ -284,7 +284,7 @@ pca10056.upload.protocol=nrfutil
284284
pca10056.upload.use_1200bps_touch=true
285285
pca10056.upload.wait_for_upload_port=true
286286
pca10056.upload.maximum_size=815104
287-
pca10056.upload.maximum_data_size=248832
287+
pca10056.upload.maximum_data_size=237568
288288

289289
# Build
290290
pca10056.build.mcu=cortex-m4

cores/nRF5/linker/nrf52840_s140_v6.ld

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,13 @@ MEMORY
88
FLASH (rx) : ORIGIN = 0x26000, LENGTH = 0xED000 - 0x26000
99

1010
/* SRAM required by S132 depend on
11-
* - Attribute Table Size
11+
* - Attribute Table Size (Number of Services and Characteristics)
1212
* - Vendor UUID count
1313
* - Max ATT MTU
1414
* - Concurrent connection peripheral + central + secure links
1515
* - Event Len, HVN queue, Write CMD queue
1616
*/
17-
RAM (rwx) : ORIGIN = 0x20003400, LENGTH = 0x20040000 - 0x20003400
17+
RAM (rwx) : ORIGIN = 0x20006000, LENGTH = 0x20040000 - 0x20006000
1818
}
1919

2020
SECTIONS

libraries/Bluefruit52Lib/src/bluefruit.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,7 @@ AdafruitBluefruit::AdafruitBluefruit(void)
144144
/*------------------------------------------------------------------*/
145145
varclr(&_sd_cfg);
146146

147-
_sd_cfg.attr_table_size = 0x800;
147+
_sd_cfg.attr_table_size = CFG_SD_ATTR_TABLE_SIZE;
148148
_sd_cfg.uuid128_max = BLE_UUID_VS_COUNT_DEFAULT;
149149
_sd_cfg.service_changed = 1;
150150

@@ -329,7 +329,7 @@ bool AdafruitBluefruit::begin(uint8_t prph_count, uint8_t central_count)
329329
* prph and central connections for optimal SRAM usage.
330330
*
331331
* - If Peripheral mode is enabled
332-
* - ATTR Table Size = 0x800.
332+
* - ATTR Table Size = CFG_SD_ATTR_TABLE_SIZE.
333333
* - HVN TX Queue Size = 3
334334
*
335335
* - If Central mode is enabled

libraries/Bluefruit52Lib/src/bluefruit.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,8 @@
3636
#define BLE_GATT_ATT_MTU_MAX 247
3737
#define BLE_MAX_CONNECTION 20 // SD support up to 20 connections
3838

39+
#define CFG_SD_ATTR_TABLE_SIZE 0xC00
40+
3941
#include "BLEUuid.h"
4042
#include "BLEAdvertising.h"
4143
#include "BLECharacteristic.h"

0 commit comments

Comments
 (0)