1.1.1.3 BLE Memory Usage
Data Memory Usage
Static data memory
The size of BLE static memroy is 3KB. This is alaways occupied if BLE is enabled.
Dynamic data memory
The size of BLE dynamic memory is defined in the project, named EXT_COMMON_MEMORY_SIZE. User is able to change this size accordingly if necessary.
- Peripheral role only application:
The basic data memory requirement is 14KB as below consideration
- Use legacy Advertising
- Queued Tx buffer number is 4 for
application payload
- The max application data size of each Tx packet is 247 byte
- One BLE connection only
- L2CAP CoC is not enable
- Central role only application:
The basic data memory requirement is 14KB as below consideration
- Use legacy Scan and Initiator
- Queued Tx buffer number is 4 for
application payload
- The max application data size of each Tx packet is 247 byte
- One BLE connection only
- L2CAP CoC is not enable
- Both Peripheral and Central roles
application:
The basic data memory requirement is 16KB
as below consideration
- Use legacy Advertising, Scan and Initiator
- Queued Tx buffer number is 4 for
application payload
- The max application data size of each Tx packet is 247 byte
- One BLE connections only
- L2CAP CoC is not enable
- Additional data memory requirement are
counted for below consideration
- Extended Advertising enable
Table 1-1. Additional memory requirement for one Ext Advertising handle based on Ext Advertising data length Ext Adv Data Length (byte) Additional data memory requirement(byte) 1~23 2K 24~151 2K+128 152~243 2K+256 244~285 2K+384 286~412 2K+512 413~487 2K+640 488~547 2K+768 578~731 3K - Extended Scan enable
Table 1-2. Additional memory requirement for one Ext Scan handle based on received Ext Advertising data length Received Ext Adv Data Length (byte) Additional data memory requirement (byte) 1~244 2K 245~320 2K+256 321~572 2K+768 573~732 3K 733~976 3K+512 - L2CAP CoC enable: 0.8K Bytes
- Need more queued Tx buffers for
higher throughput consideration
- Add one more Tx buffer needs 264 byte. Max queued Tx buffer number is 12. Max additional data memory requirement for highest throughput is 264 * (12-4) = 2104 byte
- Multi-link consideration
- Need 1120 byte for one more BLE connection. In order to support max to 6 BLE connections, additional 1120* (6-1) = 5600 byte data memory are needed
- Periodic Advertising
Table 1-3. Additional memory requirement for one Periodic Advertising handle based on Periodic Advertising data length Periodic Adv Data Length (byte) Additional data memory requirement (byte) 1~200 2K 201~269 2K+256 270~397 2K+512 398~499 2K+768 00~592 3K - Periodic Sync
Table 1-4. Additional memory requirement for one Periodic Sync handle based on received Ext Periodic Advertising data length Received Periodic Adv Data Length (byte) Additional data memory requirement (byte) ~488 1K 489~876 1K+256 877~1066 1K+768 1067~1256 2K
- Extended Advertising enable
Program Memory Usage
The size of BLE program memory is calculated by enabled features. User can chooses which features are required of the BLE function. Here's basic configuration of the BLE function:
- Peripheral role only application:
The program memory is 122KB as below consideration
- Use legacy Advertising.
- No additional feature is enabled.
- Central role only application:
The program memory is 123.5KB as below consideration
- Use legacy Scan and Initiator.
- No additional feature is enabled.
- Both Peripheral and Central roles
application:
The program memory is 141.5KB
as below consideration
- Use legacy Advertising, Scan and Initiator.
- No additional feature is enabled.
- Additional program memory usage are
counted for below consideration
- Extended Advertising enable: 16 KB (Legacy Adv. is required)
- Extended Scan enable: 8 KB (Legacy Scan is required)
- Periodic Advertising enable: 21 KB (Legacy Adv. and Extended Adv. are required)
- Sync Enable: 17 KB (Legacy Scan and Extended Scan are required)
- Extended Central enable: 11KB (Legacy Scan, Extended Scan and Legacy Central are required)
- GATT Client enable: 5.5 KB
- L2CAP CoC enable: 4.5 KB
- Controller only (HCI mode)
application:
The program memory is 189KB
as below consideration
- Full supported BLE Controller features can be controlled by HCI interface.
- No BLE host stack.