Skip to content

Commit fbc489e

Browse files
authored
Merge pull request #10733 from pan-/fix-nrf52-memory-pools
Fix nrf52 memory pools
2 parents 04d0b0d + 618e1e6 commit fbc489e

File tree

5 files changed

+19
-19
lines changed

5 files changed

+19
-19
lines changed

features/FEATURE_BLE/targets/TARGET_CORDIO/mbed_lib.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,12 +24,12 @@
2424
},
2525
"max-l2cap-channels": {
2626
"help": "Maximum number of connection oriented channels",
27-
"value": 8,
27+
"value": 1,
2828
"macro_name": "L2C_COC_CHAN_MAX"
2929
},
3030
"max-l2cap-clients": {
3131
"help": "Maximum number of connection oriented channel registered clients",
32-
"value": 4,
32+
"value": 1,
3333
"macro_name": "L2C_COC_REG_MAX"
3434
},
3535
"max-att-writes": {
@@ -53,7 +53,7 @@
5353
},
5454
"rx-acl-buffer-size": {
5555
"help": "Size of the buffer holding the reassembled complete ACL packet. This will limit the effective ATT_MTU (to its value minus 4 bytes for the header). The size of the buffer must be small enough to be allocated from the existing cordio pool. If this value is increased you may need to adjust the memory pool.",
56-
"value": 100
56+
"value": 70
5757
},
5858
"max-prepared-writes": {
5959
"help": "Number of queued prepare writes supported by server.",

features/FEATURE_BLE/targets/TARGET_CORDIO_LL/mbed_lib.json

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,11 @@
33
"config": {
44
"max-advertising-sets": {
55
"help": "Maximum number of advertising sets.",
6-
"value": 4
6+
"value": 3
77
},
88
"max-advertising-reports": {
99
"help": "Maximum number of pending legacy or extended advertising reports.",
10-
"value": 8
10+
"value": 4
1111
},
1212
"default-extended-advertising-fragmentation-size": {
1313
"help": "Default extended advertising data fragmentation size.",
@@ -23,23 +23,23 @@
2323
},
2424
"rx-buffers": {
2525
"help": "Default number of receive buffers.",
26-
"value": 8
26+
"value": 4
2727
},
2828
"phy-coded-support": {
2929
"help": "Coded PHY supported.",
3030
"value": 0
3131
},
3232
"extended-advertising-size": {
33-
"help": "Maximum extended advertising data (and scan data response) size",
34-
"value": 128
33+
"help": "Maximum extended advertising data (and scan data response) size, Minimum value is 251",
34+
"value": 251
3535
},
3636
"max-acl-size": {
3737
"help": "Maximum ACL buffer size",
3838
"value": 256
3939
},
4040
"tx-buffers": {
4141
"help": "Default number of send buffers",
42-
"value": 8
42+
"value": 4
4343
},
4444
"handle-vendor-specific-hci-commands": {
4545
"help": "Handle VS HCI commands. Valid values are 0 (ignore) and 1 (handle).",

features/FEATURE_BLE/targets/TARGET_NORDIC/TARGET_NORDIC_CORDIO/TARGET_MCU_NRF52840/mbed_lib.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,15 +7,15 @@
77
},
88
"extended-advertising-size": {
99
"help": "Maximum extended advertising data (and scan data response) size",
10-
"value": 1650
10+
"value": 512
1111
},
1212
"max-acl-size": {
1313
"help": "Maximum ACL buffer size",
14-
"value": 512
14+
"value": 256
1515
},
1616
"tx-buffers": {
1717
"help": "Default number of send buffers",
18-
"value": 16
18+
"value": 4
1919
},
2020
"cryptocell310-acceleration": {
2121
"help": "Should the link layer use the Crypto Cell 310 to offload encryption.",

features/FEATURE_BLE/targets/TARGET_NORDIC/TARGET_NORDIC_CORDIO/TARGET_NRF5x/NRFCordioHCIDriver.cpp

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -67,11 +67,11 @@ using namespace ble::vendor::cordio;
6767
#define MBED_CONF_CORDIO_LL_TX_BUFFERS MBED_CONF_CORDIO_LL_NRF52840_TX_BUFFERS
6868
#define MBED_CONF_CORDIO_LL_PHY_CODED_SUPPORT MBED_CONF_CORDIO_LL_NRF52840_PHY_CODED_SUPPORT
6969

70-
#define CORDIO_LL_MEMORY_FOOTPRINT 41906UL
70+
#define CORDIO_LL_MEMORY_FOOTPRINT 15400UL
7171

7272
#else
7373

74-
#define CORDIO_LL_MEMORY_FOOTPRINT 12768UL
74+
#define CORDIO_LL_MEMORY_FOOTPRINT 12500UL
7575

7676
#endif
7777

@@ -235,9 +235,9 @@ ble::vendor::cordio::buf_pool_desc_t NRFCordioHCIDriver::get_buffer_pool_descrip
235235
{
236236
static union {
237237
#if defined(NRF52840_XXAA)
238-
uint8_t buffer[ 17304 ];
238+
uint8_t buffer[ 4900 ];
239239
#else
240-
uint8_t buffer[ 8920 ];
240+
uint8_t buffer[ 4900 ];
241241
#endif
242242
uint64_t align;
243243
};
@@ -246,8 +246,7 @@ ble::vendor::cordio::buf_pool_desc_t NRFCordioHCIDriver::get_buffer_pool_descrip
246246
{ 32, 16 + 4 },
247247
{ 64, 8 },
248248
{ 128, 4 + MBED_CONF_CORDIO_LL_MAX_ADVERTISING_REPORTS },
249-
{ aclBufSize, MBED_CONF_CORDIO_LL_TX_BUFFERS + MBED_CONF_CORDIO_LL_RX_BUFFERS },
250-
{ 272, 1 }
249+
{ aclBufSize, MBED_CONF_CORDIO_LL_TX_BUFFERS + MBED_CONF_CORDIO_LL_RX_BUFFERS }
251250
};
252251

253252
return buf_pool_desc_t(buffer, pool_desc);

features/FEATURE_BLE/targets/TARGET_NORDIC/TARGET_NORDIC_CORDIO/TARGET_NRF5x/mbed_lib.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
"INIT_PERIPHERAL",
1515
"INIT_ENCRYPTED",
1616
"LHCI_ENABLE_VS=0",
17-
"BB_CLK_RATE_HZ=1000000"
17+
"BB_CLK_RATE_HZ=1000000",
18+
"LL_MAX_PER_SCAN=3"
1819
]
1920
}

0 commit comments

Comments
 (0)