![]() |
nRF5 SDK for Thread and Zigbee v1.0.0
|
Choose documentation: | nRF5 SDK | S112 SoftDevice API | S132 SoftDevice API | S140 SoftDevice API | S212 SoftDevice API |
Design of configurable ZBOSS internal memory provides an ability to configure some storage parameters at application link time without recompiling ZBOSS libraries. If application does not configure storage parameters, default values will be used.
ZBOSS uses static memory allocation technic.
Initially (before introducing configurable memory) ZBOSS uses static arrays inside data structures and defines for arraps syzes. Defines are fixed at ZBOSS compile time.
To be able to configure memory at compile time, ZBOSS changes static buffers to pointers (
This header file defines variables for buffers and variables for buffer sizes. That file can be included strictly once from the kernel (zb_init.c) or from the user's application (indirectly, from file zb_mem_config_xxx.h). When included form the kernel, ZB_CONFIG_DEFAULT_KERNEL_DEFINITION is defined, so all symbols are defined as weak. As a result, if application does not included any memory configuration includes, default buffers and its sizes (weak) are used. If application includes one of zb_mem_config_xxx.h, it owerwrites weak symbols for buffers and its sizes.
Pointers assignment (like zb_buf_pool_t.pool) and arrays syzes initialization are done at ZBOSS start time from zb_init_configurable_mem().
Default storage settings are defined in zb_vendor.h file. Note again that changing of zb_vendor.h is meaningful only if you re-compile ZBOSS library. Do not change it when you compile the application.
See also Configurable_mem.