| nRF5 SDK v12.0.0 |

Choose documentation: | nRF5 SDK | S130 SoftDevice API | S132 SoftDevice API | S212 SoftDevice API | S332 SoftDevice API

All Data Structures Functions Variables Typedefs Enumerations Enumerator Groups Pages
Memory pool library
This information applies to the following SoftDevices: S130, S132, S332

Memory pool implementation, based on circular buffer data structure, which supports asynchronous processing of RX data. The current default implementation supports 1 TX buffer and 4 RX buffers. The memory managed by the pool is allocated from static storage instead of heap. The internal design of the circular buffer implementing the RX memory layout is illustrated in the picture below.

Circular buffer design

The expected call order for the RX APIs is as follows:

- hci_mem_pool_rx_produce
- hci_mem_pool_rx_data_size_set
- hci_mem_pool_rx_extract
- hci_mem_pool_rx_consume

Warning
  If the above mentioned expected call order is violated the end result can be undefined.

Component specific configuration options

The following compile time configuration options are available to suit various implementations:

- TX_BUF_SIZE TX buffer size in bytes.
- RX_BUF_SIZE RX buffer size in bytes.
- RX_BUF_QUEUE_SIZE RX buffer element size.