Memory requirements

This page provides information about the amount of flash memory and RAM that is required by the Samples, as well as stack memory requirements for main and zboss threads. Use it to check if your application has enough space for a given configuration. Values are provided for ZBOSS libraries.

Samples were built using the available ZBOSS Zigbee stack. Unless stated otherwise, the default prj.conf was used.

Memory layout in DTS

The Samples define flash partitions in Devicetree (DTS). The Zigbee R23 add-on ships ready-made partition files under dts/ in the Zigbee R23 add-on repository. Use them as-is, or copy and adjust them for your board.

Each layout starts with a base .dtsi file for your SoC. To use MCUboot, FOTA, or Matter together, include a matching .dtsi file after the base file. Some .dtsi files apply to any board with a given SoC. Others apply only to a specific development kit (DK).

Every base layout reserves the end of internal flash for:

  • storage_partition - Zephyr settings storage

  • zboss_nvram - ZBOSS non-volatile data

  • zboss-product-config - ZBOSS product configuration

The following table lists the available files, which targets they cover, and when to use each variant:

DTS partition layout variants

Variant

Path

Targets

When to use

Base

dts/<soc>_partitions.dtsi

nRF52833 (SoC)
nRF52840 (SoC)
nRF52840 Dongle (DK only)
nRF5340 application and network cores (SoC)
nRF54L05 (SoC)
nRF54L10 (SoC)
nRF54L15 (SoC)
nRF54LM20 (SoC)

Required starting point for any Zigbee application.

MCUboot (USB transport)

dts/mcuboot_usb_transport/<soc>_partitions.dtsi

nRF52833 (SoC)
nRF52840 (SoC)
nRF5340 application core (SoC)
nRF54LM20 (SoC)

Adds boot_partition (MCUboot) and resizes slot0_partition to fit. Use with sysbuild when the bootloader is updated over USB.

Matter and Zigbee

dts/matter/<board>_partitions.dtsi

nRF54LM20 DK (DK only)

Adds boot_partition, slot1_partition, and factory_data_partition, and resizes slot0_partition. Use when Matter and Zigbee share the same device.

External flash (FOTA)

dts/ext_flash/<board>_partitions.dtsi

nRF52833 DK (DK only)
nRF52840 DK (DK only)
nRF5340 DK (DK only)
nRF54L10 DK (DK only)
nRF54L15 DK (DK only)
nRF54LM20 DK (DK only)

Keeps the primary image on internal flash and places the secondary upgrade slot (slot1_partition) on external flash. Adds boot_partition (MCUboot) and resizes slot0_partition to fit. On the nRF5340 DK, external flash can also hold image-3. Reference layout for Zigbee FOTA over external flash.

To add an overlay file to your application, add an #include line to app.overlay or to a board overlay in boards/. Always include the base .dtsi first, then any optional overlay.

See an example for the nRF54LM20 DK with external-flash FOTA in the boards/nrf54lm20dk_nrf54lm20a_cpuapp.overlay file:

#include <nrf54lm20_cpuapp_partitions.dtsi>
#include <ext_flash/nrf54lm20dk_cpuapp_partitions.dtsi>

RAM and flash memory requirements

RAM and flash memory requirement values differ depending on the programmed sample.

The following tables list memory requirement values for Zigbee samples.

Values are provided in kilobytes (KB). n/a indicates that the sample with the given variant is not supported on the DK.

The following table lists memory requirements for samples running on the nRF52833 DK (nrf52833dk).

Sample

ROM, ZBOSS stack + App

ROM, MCUboot bootloader

ROM, ZBOSS non-volatile memory

ROM, ZBOSS product config

Total ROM

RAM, ZBOSS stack + App

Total RAM

Network coordinator

n/a

n/a

n/a

n/a

n/a

n/a

n/a

Light bulb

n/a

n/a

n/a

n/a

n/a

n/a

n/a

Light switch

n/a

n/a

n/a

n/a

n/a

n/a

n/a

Light switch with Zigbee FOTA

n/a

n/a

n/a

n/a

n/a

n/a

n/a

Light switch with Multiprotocol Bluetooth LE extension

n/a

n/a

n/a

n/a

n/a

n/a

n/a

Light switch with Multiprotocol Bluetooth LE extension and Zigbee FOTA

n/a

n/a

n/a

n/a

n/a

n/a

n/a

NCP

392

0

16

4

412

86

86

NCP with USB transport

409

64

16

4

493

95

95

Zigbee application template

n/a

n/a

n/a

n/a

n/a

n/a

n/a

Zigbee shell

n/a

n/a

n/a

n/a

n/a

n/a

n/a

Zigbee shell over USB

n/a

n/a

n/a

n/a

n/a

n/a

n/a

Stack memory requirements

The following table lists stack memory requirement values for main and zboss threads. These measurements were carried out with Zephyr’s Thread analyzer, using the following Kconfig options for configuration:

  • For the stack memory size of the main thread - CONFIG_MAIN_STACK_SIZE

  • For the stack memory size of the zboss thread - CONFIG_ZBOSS_DEFAULT_THREAD_STACK_SIZE

Values are provided in bytes (B).

The following table lists memory requirements for the nRF52840 device.

Sample

main thread stack usage

main thread stack size

zboss thread stack usage

zboss thread stack size

Network coordinator

656

2048

3032

5120

Light bulb

664

2048

3036

5120

Light switch

728

2048

3008

5120