diff --git a/docs/_extensions/memory_data.py b/docs/_extensions/memory_data.py new file mode 100644 index 00000000..8e7ae555 --- /dev/null +++ b/docs/_extensions/memory_data.py @@ -0,0 +1,625 @@ +""" +Copyright (c) 2026 Nordic Semiconductor ASA + +SPDX-License-Identifier: LicenseRef-Nordic-5-Clause + +Shared memory requirement data for Zigbee documentation tables and charts. + +Board data lives in docs/data/memory/.yaml. +""" + +from __future__ import annotations + +from pathlib import Path +from typing import Any + +import yaml +from docutils import nodes +from docutils.parsers.rst import directives +from docutils.statemachine import StringList +from sphinx.application import Sphinx +from sphinx.util.docutils import SphinxDirective + +__version__ = "0.1.0" + +RESOURCES_DIR = Path(__file__).parent / "static" +DATA_DIR = Path(__file__).parents[1] / "data" / "memory" + +INTERNAL_NVM_COLUMNS = ( + ("boot", "MCUboot (used / free)"), + ("slot0", "Application (used / free)"), + ("slot1", "Upgrade slot (used / free)"), + ("factory_data", "Factory data"), + ("storage", "Storage"), + ("zboss_nvram", "ZBOSS NVRAM"), + ("zboss_product_config", "ZBOSS product config"), +) + +EXTERNAL_NVM_COLUMN_ORDER = ("slot1_ext", "slot3_ext") + +RAM_SUBHEAD = "used / free" +EMPTY_CELL = "--" + +STACK_MAIN_SUBHEADS = ("stack usage", "stack size") +STACK_ZBOSS_SUBHEADS = ("stack usage", "stack size") + +PADDING_LABEL = "Unused" + + +def applicable_samples(data: dict[str, Any]) -> list[dict[str, Any]]: + return [sample for sample in data["samples"] if not sample.get("not_applicable")] + + +def stack_samples(data: dict[str, Any]) -> list[dict[str, Any]]: + return [sample for sample in data.get("samples", []) if sample.get("stack")] + + +def stack_thread_sizes(samples: list[dict[str, Any]]) -> tuple[int, int]: + main_sizes = [int(sample["stack"]["main"]["size_b"]) for sample in samples] + zboss_sizes = [int(sample["stack"]["zboss"]["size_b"]) for sample in samples] + return max(main_sizes), max(zboss_sizes) + + +def sample_stack_table_cells(sample: dict[str, Any]) -> list[str]: + stack = sample["stack"] + return [ + str(int(stack["main"]["used_b"])), + str(int(stack["main"]["size_b"])), + str(int(stack["zboss"]["used_b"])), + str(int(stack["zboss"]["size_b"])), + ] + + +def load_board_data(board: str) -> dict[str, Any]: + path = DATA_DIR / f"{board}.yaml" + if not path.is_file(): + raise FileNotFoundError(f"Memory data file not found: {path}") + with path.open(encoding="utf-8") as handle: + return yaml.safe_load(handle) + + +def _part_size_bytes(part: dict[str, Any]) -> int: + size_kb = float(part["size_kb"]) + return round(size_kb * 1024) + + +def _padding_part(offset: int, size_bytes: int) -> dict[str, Any]: + return { + "id": "padding", + "label": PADDING_LABEL, + "size_kb": round(size_bytes / 1024), + "offset": offset, + } + + +def _sort_partitions(partitions: list[dict[str, Any]]) -> list[dict[str, Any]]: + real = [part for part in partitions if part.get("id") != "padding"] + if real and all("offset" in part for part in real): + return sorted(partitions, key=lambda part: (part.get("offset", 0), part["order"])) + return sorted(partitions, key=lambda part: part["order"]) + + +def expand_partition_gaps( + partitions: list[dict[str, Any]], + flash_total_kb: float | None, +) -> list[dict[str, Any]]: + real = [ + part + for part in partitions + if part.get("id") != "padding" and part.get("memory") != "ram" + ] + if not real: + return [] + + if all("offset" in part for part in real): + ordered = sorted(real, key=lambda part: part["offset"]) + expanded: list[dict[str, Any]] = [] + cursor = 0 + flash_end = round(float(flash_total_kb) * 1024) if flash_total_kb is not None else None + + for part in ordered: + offset = int(part["offset"]) + if offset > cursor: + gap_bytes = offset - cursor + if gap_bytes > 0: + expanded.append(_padding_part(cursor, gap_bytes)) + expanded.append(dict(part)) + cursor = max(cursor, offset + _part_size_bytes(part)) + + if flash_end is not None and cursor < flash_end: + gap_bytes = flash_end - cursor + if gap_bytes > 0: + expanded.append(_padding_part(cursor, gap_bytes)) + + for order, part in enumerate(expanded): + part["order"] = order + return expanded + + ordered = sorted(real, key=lambda part: part["order"]) + if flash_total_kb is None: + return ordered + + used_kb = sum(float(part["size_kb"]) for part in ordered) + if flash_total_kb <= used_kb: + return ordered + + padding_kb = flash_total_kb - used_kb + expanded = list(ordered) + expanded.append( + { + "id": "padding", + "label": PADDING_LABEL, + "size_kb": padding_kb, + "order": len(expanded), + } + ) + return expanded + + +def resolve_layout_raw(data: dict[str, Any], layout_name: str) -> dict[str, Any]: + layouts = data["layouts"] + layout = layouts[layout_name] + if "extends" in layout: + base = resolve_layout_raw(data, layout["extends"]) + own = layout.get("partitions", []) + own_ids = {part["id"] for part in own} + + merged: dict[str, dict[str, Any]] = { + part["id"]: dict(part) for part in own + } + for part in base["partitions"]: + if part["id"] not in own_ids and part["id"] != "padding": + merged[part["id"]] = dict(part) + + partitions = _sort_partitions(list(merged.values())) + external = layout.get("external", base.get("external")) + return {"partitions": partitions, "external": external} + return { + "partitions": _sort_partitions(list(layout["partitions"])), + "external": layout.get("external"), + } + + +def _apply_layout_gaps(data: dict[str, Any], layout: dict[str, Any]) -> dict[str, Any]: + partitions = expand_partition_gaps( + layout["partitions"], + board_nvm_total_kb(data), + ) + external = layout.get("external") + if external is not None: + external = { + **external, + "partitions": expand_partition_gaps( + external["partitions"], + float(external["nvm_total_kb"]), + ), + } + return {"partitions": partitions, "external": external} + + +def resolve_layout(data: dict[str, Any], layout_name: str) -> dict[str, Any]: + return _apply_layout_gaps(data, resolve_layout_raw(data, layout_name)) + + +def layout_nvm_total_kb(layout: dict[str, Any]) -> float: + real = [ + part + for part in layout["partitions"] + if part.get("memory") != "ram" and part.get("id") != "padding" + ] + if real and all("offset" in part for part in real): + end = max(int(part["offset"]) + _part_size_bytes(part) for part in real) + return end / 1024 + return float(sum(part["size_kb"] for part in real)) + + +def board_nvm_total_kb(data: dict[str, Any]) -> float: + board_total = data.get("board", {}).get("nvm_total_kb") + if board_total is not None: + return float(board_total) + return layout_nvm_total_kb(resolve_layout_raw(data, "base")) + + +def sample_layout(data: dict[str, Any], sample: dict[str, Any]) -> dict[str, Any] | None: + layout_name = sample.get("layout") + if layout_name is None: + return None + return resolve_layout(data, layout_name) + + +def table_constants(data: dict[str, Any]) -> dict[str, int]: + board_table = data.get("board", {}).get("table") + if board_table: + constants = { + "zboss_nvram_kb": int(board_table["zboss_nvram_kb"]), + "zboss_product_config_kb": int(board_table["zboss_product_config_kb"]), + } + if "storage_kb" in board_table: + constants["storage_kb"] = int(board_table["storage_kb"]) + return constants + + if "layouts" not in data: + raise KeyError( + f"Board data must define board.table or layouts for table generation: {data.get('board')}" + ) + + layout = resolve_layout(data, "base") + by_id = {part["id"]: part for part in layout["partitions"]} + return { + "zboss_nvram_kb": int(by_id["zboss_nvram"]["size_kb"]), + "zboss_product_config_kb": int(by_id["zboss_product_config"]["size_kb"]), + "storage_kb": int(by_id["storage"]["size_kb"]), + } + + +def board_external_nvm_columns(data: dict[str, Any]) -> list[tuple[str, str]]: + """External NVM table columns when any layout defines external upgrade slots.""" + labels: dict[str, str] = {} + order: dict[str, int] = {} + for layout in data.get("layouts", {}).values(): + external = layout.get("external") + if not external: + continue + for part in external["partitions"]: + if part["id"] == "padding": + continue + labels.setdefault(part["id"], part["label"]) + order.setdefault(part["id"], int(part["order"])) + + if not labels: + return [] + + column_order = { + part_id: index for index, part_id in enumerate(EXTERNAL_NVM_COLUMN_ORDER) + } + return sorted( + labels.items(), + key=lambda item: (column_order.get(item[0], len(EXTERNAL_NVM_COLUMN_ORDER)), order[item[0]]), + ) + + +def board_has_external_nvm(data: dict[str, Any]) -> bool: + return bool(board_external_nvm_columns(data)) + + +def _partition_map(layout: dict[str, Any] | None) -> dict[str, dict[str, Any]]: + if layout is None: + return {} + parts = { + part["id"]: part + for part in layout["partitions"] + if part.get("id") != "padding" + } + external = layout.get("external") + if external: + for part in external["partitions"]: + if part.get("id") != "padding": + parts[part["id"]] = part + return parts + + +def _fmt_kb(value: int | float) -> str: + if value == int(value): + return str(int(value)) + return f"{value:.1f}" + + +def _used_free(used: int, total: int | None) -> str: + if total is None: + return _fmt_kb(used) + free = max(int(total) - used, 0) + return f"{_fmt_kb(used)} / {_fmt_kb(free)}" + + +def _partition_size( + parts: dict[str, dict[str, Any]], + part_id: str, + constants: dict[str, int], +) -> int | None: + if part_id in parts: + return int(parts[part_id]["size_kb"]) + if part_id == "storage": + return constants.get("storage_kb") + if part_id == "zboss_nvram": + return constants["zboss_nvram_kb"] + if part_id == "zboss_product_config": + return constants["zboss_product_config_kb"] + return None + + +def sample_table_cells( + data: dict[str, Any], + sample: dict[str, Any], + *, + include_external: bool, +) -> list[str]: + constants = table_constants(data) + usage = sample.get("usage", {}) + nvm = usage.get("nvm", {}) + layout = sample_layout(data, sample) + parts = _partition_map(layout) + ram_total = data.get("board", {}).get("ram_total_kb") + + cells: list[str] = [] + + # MCUboot — used / free within boot partition when present. + if "boot" in parts or nvm.get("boot"): + boot_used = int(nvm.get("boot", 0)) + boot_total = _partition_size(parts, "boot", constants) + cells.append(_used_free(boot_used, boot_total)) + else: + cells.append("0") + + # Application — used / free within slot0. + app_used = int(nvm.get("slot0", 0)) + app_total = _partition_size(parts, "slot0", constants) + cells.append(_used_free(app_used, app_total)) + + external_usage = usage.get("external", {}) + + # Reserved internal NVM partitions — used/free when measured, else size or --. + for part_id, _ in INTERNAL_NVM_COLUMNS[2:]: + size = _partition_size(parts, part_id, constants) + used = nvm.get(part_id) + if used is not None and size is not None: + cells.append(_used_free(int(used), size)) + elif size is not None: + cells.append(_fmt_kb(size)) + else: + cells.append(EMPTY_CELL) + + if include_external: + for part_id, _ in board_external_nvm_columns(data): + ext_size = _partition_size(parts, part_id, constants) + ext_used = external_usage.get(part_id) + if ext_used is not None and ext_size is not None: + cells.append(_used_free(int(ext_used), ext_size)) + elif ext_size is not None: + cells.append(_fmt_kb(ext_size)) + else: + cells.append(EMPTY_CELL) + + ram_used = int(usage.get("ram_used_kb", 0)) + cells.append(_used_free(ram_used, int(ram_total) if ram_total is not None else None)) + + return cells + + +def _header_label(data: dict[str, Any], kind: str) -> str: + board = data.get("board", {}) + if kind == "nvm": + total = board_nvm_total_kb(data) + return f"Internal NVM ({_fmt_kb(total)} kB)" + if kind == "external": + for sample in applicable_samples(data): + if "layout" not in sample: + continue + external = resolve_layout(data, sample["layout"]).get("external") + if external: + total = external["nvm_total_kb"] + return f"External NVM ({_fmt_kb(total)} kB)" + return "External NVM" + total = board.get("ram_total_kb") + return f"RAM ({_fmt_kb(total)} kB)" if total is not None else "RAM" + + +def _append_rst_cell(state, entry: nodes.entry, rst_text: str) -> None: + paragraph = nodes.paragraph() + content = StringList([rst_text], "") + state.nested_parse(content, 0, paragraph) + if len(paragraph) == 1 and isinstance(paragraph[0], nodes.paragraph): + inner = paragraph[0] + paragraph.remove(inner) + paragraph.extend(inner.children) + entry += paragraph + + +def _append_text_cell(row: nodes.row, text: str, *, css_class: str = "memory-req-value") -> None: + entry = nodes.entry() + entry["classes"] = [css_class] + entry += nodes.Text(text) + row += entry + + +def build_memory_table_nodes(directive: SphinxDirective, data: dict[str, Any]) -> nodes.table: + external_columns = board_external_nvm_columns(data) + include_external = bool(external_columns) + internal_count = len(INTERNAL_NVM_COLUMNS) + external_count = len(external_columns) + total_cols = 1 + internal_count + external_count + 1 + + table = nodes.table() + table["classes"] = ["memory-req-table"] + + tgroup = nodes.tgroup(cols=total_cols) + table += tgroup + + colspecs = [nodes.colspec(colwidth=28)] + [nodes.colspec(colwidth=10)] * (total_cols - 1) + tgroup.extend(colspecs) + + thead = nodes.thead() + tgroup += thead + + group_row = nodes.row() + thead += group_row + + sample_group = nodes.entry() + sample_group["morerows"] = 1 + sample_group += nodes.Text("Sample") + group_row += sample_group + + nvm_group = nodes.entry() + nvm_group["morecols"] = internal_count - 1 + nvm_group["classes"] = ["memory-req-group-nvm"] + nvm_group += nodes.Text(_header_label(data, "nvm")) + group_row += nvm_group + + if include_external: + external_group = nodes.entry() + if external_count > 1: + external_group["morecols"] = external_count - 1 + else: + external_group["morerows"] = 1 + external_group["classes"] = ["memory-req-group-external"] + external_group += nodes.Text(_header_label(data, "external")) + group_row += external_group + + ram_group = nodes.entry() + ram_group["classes"] = ["memory-req-group-ram"] + ram_group += nodes.Text(_header_label(data, "ram")) + group_row += ram_group + + sub_row = nodes.row() + thead += sub_row + + for _, label in INTERNAL_NVM_COLUMNS: + entry = nodes.entry() + entry["classes"] = ["memory-req-subhead"] + entry += nodes.Text(label) + sub_row += entry + + for part_id, label in external_columns: + entry = nodes.entry() + entry["classes"] = ["memory-req-subhead"] + if part_id in ("slot1_ext", "slot3_ext"): + label = f"{label} (used / free)" + entry += nodes.Text(label) + sub_row += entry + + ram_sub = nodes.entry() + ram_sub["classes"] = ["memory-req-subhead"] + ram_sub += nodes.Text(RAM_SUBHEAD) + sub_row += ram_sub + + tbody = nodes.tbody() + tgroup += tbody + + for sample in applicable_samples(data): + row = nodes.row() + tbody += row + + sample_entry = nodes.entry() + sample_entry["classes"] = ["memory-req-sample"] + _append_rst_cell(directive.state, sample_entry, sample["label"]) + row += sample_entry + + cells = sample_table_cells(data, sample, include_external=include_external) + for value in cells: + css = "memory-req-empty" if value == EMPTY_CELL else "memory-req-value" + _append_text_cell(row, value, css_class=css) + + return table + + +def build_stack_table_nodes(directive: SphinxDirective, data: dict[str, Any]) -> nodes.table: + samples = stack_samples(data) + if not samples: + raise ValueError( + f"No stack measurements in docs/data/memory for board {data.get('board', {}).get('name')}" + ) + + table = nodes.table() + table["classes"] = ["memory-req-table", "stack-req-table"] + + tgroup = nodes.tgroup(cols=5) + table += tgroup + tgroup.extend([nodes.colspec(colwidth=28)] + [nodes.colspec(colwidth=10)] * 4) + + thead = nodes.thead() + tgroup += thead + + group_row = nodes.row() + thead += group_row + + sample_group = nodes.entry() + sample_group["morerows"] = 1 + sample_group += nodes.Text("Sample") + group_row += sample_group + + main_group = nodes.entry() + main_group["morecols"] = 1 + main_group["classes"] = ["memory-req-group-main"] + main_group += nodes.Text("main thread") + group_row += main_group + + zboss_group = nodes.entry() + zboss_group["morecols"] = 1 + zboss_group["classes"] = ["memory-req-group-zboss"] + zboss_group += nodes.Text("zboss thread") + group_row += zboss_group + + sub_row = nodes.row() + thead += sub_row + + for label in STACK_MAIN_SUBHEADS + STACK_ZBOSS_SUBHEADS: + entry = nodes.entry() + entry["classes"] = ["memory-req-subhead"] + entry += nodes.Text(label) + sub_row += entry + + tbody = nodes.tbody() + tgroup += tbody + + for sample in samples: + row = nodes.row() + tbody += row + + sample_entry = nodes.entry() + sample_entry["classes"] = ["memory-req-sample"] + _append_rst_cell(directive.state, sample_entry, sample["label"]) + row += sample_entry + + for value in sample_stack_table_cells(sample): + _append_text_cell(row, value) + + return table + + +class StackTable(SphinxDirective): + """Render stack usage table from docs/data/memory/.""" + + required_arguments = 0 + optional_arguments = 0 + final_argument_whitespace = True + has_content = False + option_spec = { + "board": directives.unchanged_required, + } + + def run(self) -> list[nodes.Node]: + data = load_board_data(self.options["board"]) + return [build_stack_table_nodes(self, data)] + + +class MemoryTable(SphinxDirective): + """Render memory requirements table from docs/data/memory/.""" + + required_arguments = 0 + optional_arguments = 0 + final_argument_whitespace = True + has_content = False + option_spec = { + "board": directives.unchanged_required, + } + + def run(self) -> list[nodes.Node]: + data = load_board_data(self.options["board"]) + return [build_memory_table_nodes(self, data)] + + +def add_memory_table_resources(app: Sphinx) -> None: + static_path = RESOURCES_DIR.as_posix() + if static_path not in app.config.html_static_path: + app.config.html_static_path.append(static_path) + app.add_css_file("memory_table.css") + + +def setup(app: Sphinx) -> dict[str, Any]: + app.add_directive("memory-table", MemoryTable) + app.add_directive("stack-table", StackTable) + app.connect("builder-inited", add_memory_table_resources) + return { + "version": __version__, + "parallel_read_safe": True, + "parallel_write_safe": True, + } diff --git a/docs/_extensions/memory_viz.py b/docs/_extensions/memory_viz.py new file mode 100644 index 00000000..19497a4a --- /dev/null +++ b/docs/_extensions/memory_viz.py @@ -0,0 +1,483 @@ +""" +Copyright (c) 2026 Nordic Semiconductor ASA + +SPDX-License-Identifier: LicenseRef-Nordic-5-Clause + +Sphinx extension for memory layout bar charts in Zigbee documentation. + +Renders side-by-side NVM and RAM proportional bar graphs per sample variant. +Partition sizes come from YAML data (sourced from DTS); usage values are +placeholders until Twister output is wired in. +""" + +from __future__ import annotations + +import html +from pathlib import Path +from typing import Any + +from docutils import nodes +from docutils.parsers.rst import directives +from docutils.statemachine import StringList +from memory_data import applicable_samples, board_nvm_total_kb, load_board_data, resolve_layout +from sphinx.application import Sphinx +from sphinx.util.docutils import SphinxDirective + +__version__ = "0.1.0" + +RESOURCES_DIR = Path(__file__).parent / "static" + +# Distinct colors per partition type; free/used share the same hue. +PARTITION_COLORS = { + "boot": ("#2563eb", "#93c5fd"), + "slot0": ("#16a34a", "#bbf7d0"), + "slot1": ("#a78bfa", "#ddd6fe"), + "slot1_ext": ("#8b5cf6", "#ddd6fe"), + "slot3_ext": ("#0d9488", "#99f6e4"), + "factory_data": ("#ea580c", "#fed7aa"), + "storage": ("#ca8a04", "#fde68a"), + "zboss_nvram": ("#fca5a5", "#fee2e2"), + "zboss_product_config": ("#64748b", "#cbd5e1"), + "mbr": ("#475569", "#cbd5e1"), + "padding": ("#e2e8f0", "#f8fafc"), + "ram": ("#0891b2", "#a5f3fc"), + "unused": ("#e2e8f0", "#f8fafc"), +} + +# Partitions that may show used/free shading inside the segment. +SPLIT_USAGE_IDS = frozenset( + {"boot", "slot0", "slot1", "slot1_ext", "slot3_ext", "ram"} +) + +# Drawn in the bar even when marked legend_only in YAML (reserved tail partitions, MCUboot). +ALWAYS_VISIBLE_BAR_IDS = frozenset( + { + "boot", + "mbr", + "slot1", + "slot1_ext", + "slot3_ext", + "zboss_nvram", + "zboss_product_config", + "factory_data", + "storage", + "padding", + } +) + +# NVM legend order follows partition layout in memory (low to high address). +NVM_LEGEND_ORDER = ( + "boot", + "mbr", + "slot0", + "slot1", + "slot1_ext", + "slot3_ext", + "factory_data", + "padding", + "storage", + "zboss_nvram", + "zboss_product_config", +) + +def _kb_label(kb: float) -> str: + if kb == int(kb): + return f"{int(kb)} kB" + return f"{kb:.1f} kB" + +def _legend_threshold(data: dict[str, Any]) -> float: + return float(data.get("legend_threshold_kb", 8)) + + +def _partition_colors(part_id: str) -> tuple[str, str]: + used, free = PARTITION_COLORS.get(part_id, PARTITION_COLORS["unused"]) + return used, free + + +def _usage_title(part: dict[str, Any], used_kb: float) -> str: + free_kb = max(part["size_kb"] - used_kb, 0) + if part["id"] == "mbr": + return f'{part["label"]}: {_kb_label(part["size_kb"])} ({_kb_label(used_kb)} used)' + if free_kb <= 0: + return f'{part["label"]}: {_kb_label(part["size_kb"])} ({_kb_label(used_kb)} used)' + return ( + f'{part["label"]}: {_kb_label(part["size_kb"])} ' + f"({_kb_label(used_kb)} used, {_kb_label(free_kb)} free)" + ) + + +def _render_segment( + part: dict[str, Any], + total_kb: float, + used_kb: float | None, + legend_only: bool, + threshold_kb: float, +) -> str: + """Return HTML for one bar segment.""" + if legend_only: + return "" + + used_color, free_color = _partition_colors(part["id"]) + width_pct = 100.0 * part["size_kb"] / total_kb + min_width_pct = 100.0 * threshold_kb / total_kb if total_kb else 0.0 + if part["id"] not in ALWAYS_VISIBLE_BAR_IDS and width_pct < min_width_pct: + return "" + + title = f'{part["label"]}: {_kb_label(part["size_kb"])}' + inner = ( + f'' + ) + + if used_kb is not None and part["id"] in SPLIT_USAGE_IDS: + title = _usage_title(part, used_kb) + used_pct = min(100.0, 100.0 * used_kb / part["size_kb"]) if part["size_kb"] else 0 + free_pct = 100.0 - used_pct + inner = ( + f'' + f'' + ) + elif used_kb is not None and part["id"] == "mbr": + title = _usage_title(part, used_kb) + inner = ( + f'' + ) + + return ( + f'
' + f"{inner}
" + ) + + +def _render_bar( + partitions: list[dict[str, Any]], + total_kb: float, + usage: dict[str, float], + threshold_kb: float, + aria_label: str, +) -> str: + segments: list[str] = [] + for part in partitions: + legend_only = part.get("legend_only", False) + if part["id"] in ALWAYS_VISIBLE_BAR_IDS: + legend_only = False + segment = _render_segment( + part, total_kb, usage.get(part["id"]), legend_only, threshold_kb + ) + if segment: + segments.append(segment) + + return ( + f'' + ) + + +def _legend_swatch(color: str) -> str: + return ( + f'' + ) + + +def _legend_item(part_id: str, label: str) -> str: + return ( + f'' + f"{_legend_swatch(_partition_colors(part_id)[0])}" + f"{label}" + f"" + ) + + +def _legend_items_used_free(part_id: str, label_base: str) -> list[str]: + used_color, free_color = _partition_colors(part_id) + items: list[str] = [] + for suffix, color in (("used", used_color), ("free", free_color)): + items.append( + f'' + f"{_legend_swatch(color)}" + f"{label_base} ({suffix})" + f"" + ) + return items + + +def _collect_nvm_legend_items( + data: dict[str, Any], + layout_names: set[str], +) -> list[str]: + parts: dict[str, dict[str, Any]] = {} + + for layout_name in layout_names: + layout = resolve_layout(data, layout_name) + for part in layout["partitions"]: + if part["id"] != "ram" and part.get("memory") != "ram": + parts.setdefault(part["id"], part) + external = layout.get("external") + if external: + for part in external["partitions"]: + parts.setdefault(part["id"], part) + + order_index = {part_id: index for index, part_id in enumerate(NVM_LEGEND_ORDER)} + sorted_ids = sorted( + parts, + key=lambda part_id: (order_index.get(part_id, len(NVM_LEGEND_ORDER)), part_id), + ) + + items: list[str] = [] + for part_id in sorted_ids: + part = parts[part_id] + label = part["label"] + if part_id in SPLIT_USAGE_IDS: + items.extend(_legend_items_used_free(part_id, label)) + else: + items.append(_legend_item(part_id, label)) + return items + + +def _render_ram_legend_items() -> list[str]: + return _legend_items_used_free("ram", "RAM") + + +def _grid_style(nvm_total_kb: float, ram_total_kb: float) -> str: + return ( + f"--memory-viz-nvm-fr:{int(nvm_total_kb)}fr;" + f"--memory-viz-ram-fr:{int(ram_total_kb)}fr" + ) + + +def _parse_rst_label(directive: SphinxDirective, text: str) -> nodes.Element: + label = nodes.paragraph() + label["classes"] = ["memory-viz-sample-label"] + content = StringList([text], "") + directive.state.nested_parse(content, 0, label) + if len(label) == 1 and isinstance(label[0], nodes.paragraph): + inner = label[0] + label.remove(inner) + label.extend(inner.children) + return label + + +def _nvm_width_pct(part_kb: float, reference_kb: float) -> float: + if reference_kb <= 0: + return 100.0 + return min(100.0, 100.0 * part_kb / reference_kb) + + +def _render_board_header( + nvm_total_kb: float, + ram_total_kb: float, + external_total_kb: float | None, + nvm_legend_items: list[str], + ram_legend_items: list[str], +) -> str: + external_title = "" + if external_total_kb is not None: + ext_width = _nvm_width_pct(external_total_kb, nvm_total_kb) + external_title = ( + f'
' + f"External NVM ({_kb_label(external_total_kb)})
" + ) + + nvm_legend = ( + f'
' + f'{"".join(nvm_legend_items)}
' + ) + ram_legend = ( + f'
' + f'{"".join(ram_legend_items)}
' + ) + + return ( + f'
' + f'
Sample
' + f'
' + f'
Internal NVM ({_kb_label(nvm_total_kb)})
' + f"{external_title}" + f"{nvm_legend}" + f"
" + f'
' + f'
RAM ({_kb_label(ram_total_kb)})
' + f"{ram_legend}" + f"
" + f"
" + ) + + +def _render_sample_nvm_html( + sample: dict[str, Any], + data: dict[str, Any], + nvm_total_kb: float, + threshold_kb: float, +) -> str: + layout = resolve_layout(data, sample["layout"]) + partitions = layout["partitions"] + layout_total_kb = board_nvm_total_kb(data) + usage = sample.get("usage", {}) + nvm_partitions = [p for p in partitions if p.get("memory") != "ram"] + aria = sample.get("label", "sample") + + internal_bar = _render_bar( + nvm_partitions, + layout_total_kb, + usage.get("nvm", {}), + threshold_kb, + f"{aria} internal NVM", + ) + + external = layout.get("external") + external_bar = "" + external_wrap = "" + if external: + ext_total_kb = float(external["nvm_total_kb"]) + ext_width = _nvm_width_pct(ext_total_kb, layout_total_kb) + external_bar = _render_bar( + external["partitions"], + ext_total_kb, + usage.get("external", {}), + threshold_kb, + f"{aria} external NVM", + ) + external_wrap = ( + f'
' + f"{external_bar}
" + ) + + return ( + f'
' + f'
{internal_bar}
' + f"{external_wrap}
" + ) + + +def _render_sample_ram_html( + sample: dict[str, Any], + ram_total_kb: float, + threshold_kb: float, +) -> str: + usage = sample.get("usage", {}) + ram_partitions = [ + { + "id": "ram", + "label": "RAM", + "size_kb": ram_total_kb, + "order": 0, + } + ] + aria = sample.get("label", "sample") + ram_bar = _render_bar( + ram_partitions, + ram_total_kb, + {"ram": usage.get("ram_used_kb")}, + threshold_kb, + f"{aria} RAM", + ) + return f'
{ram_bar}
' + + +def _build_board_nodes(directive: SphinxDirective, board: str) -> nodes.Element: + data = load_board_data(board) + nvm_total_kb = board_nvm_total_kb(data) + ram_total_kb = float(data["board"]["ram_total_kb"]) + threshold_kb = _legend_threshold(data) + + samples = applicable_samples(data) + layout_names = {sample["layout"] for sample in samples if "layout" in sample} + external_total_kb = None + for sample in samples: + if "layout" not in sample: + continue + layout = resolve_layout(data, sample["layout"]) + if layout.get("external"): + external_total_kb = float(layout["external"]["nvm_total_kb"]) + break + + style = _grid_style(nvm_total_kb, ram_total_kb) + + wrapper = nodes.container() + wrapper += nodes.raw( + "", + f'
', + format="html", + ) + + board_node = nodes.container() + board_node["classes"] = ["memory-viz-board-inner"] + + nvm_legend_items = _collect_nvm_legend_items(data, layout_names) + ram_legend_items = _render_ram_legend_items() + + board_node += nodes.raw( + "", + _render_board_header( + nvm_total_kb, + ram_total_kb, + external_total_kb, + nvm_legend_items, + ram_legend_items, + ), + format="html", + ) + + samples_node = nodes.container() + samples_node["classes"] = ["memory-viz-samples"] + + for sample in samples: + row = nodes.container() + row["classes"] = ["memory-viz-sample-row"] + row += _parse_rst_label(directive, sample["label"]) + row += nodes.raw( + "", + _render_sample_nvm_html(sample, data, nvm_total_kb, threshold_kb), + format="html", + ) + row += nodes.raw( + "", + _render_sample_ram_html(sample, ram_total_kb, threshold_kb), + format="html", + ) + + samples_node += row + + board_node += samples_node + wrapper += board_node + wrapper += nodes.raw("", "
", format="html") + return wrapper + + +class MemoryBoard(SphinxDirective): + """Render memory layout charts for a board defined in docs/data/memory/.""" + + required_arguments = 0 + optional_arguments = 0 + final_argument_whitespace = True + has_content = False + option_spec = { + "board": directives.unchanged_required, + } + + def run(self) -> list[nodes.Node]: + return [_build_board_nodes(self, self.options["board"])] + + +def add_memory_viz_resources(app: Sphinx) -> None: + static_path = RESOURCES_DIR.as_posix() + if static_path not in app.config.html_static_path: + app.config.html_static_path.append(static_path) + app.add_css_file("memory_viz.css") + + +def setup(app: Sphinx) -> dict[str, Any]: + app.add_directive("memory-board", MemoryBoard) + app.connect("builder-inited", add_memory_viz_resources) + return { + "version": __version__, + "parallel_read_safe": True, + "parallel_write_safe": True, + } diff --git a/docs/_extensions/stack_viz.py b/docs/_extensions/stack_viz.py new file mode 100644 index 00000000..eaf1ede2 --- /dev/null +++ b/docs/_extensions/stack_viz.py @@ -0,0 +1,208 @@ +""" +Copyright (c) 2026 Nordic Semiconductor ASA + +SPDX-License-Identifier: LicenseRef-Nordic-5-Clause + +Sphinx extension for stack usage bar charts in Zigbee documentation. +""" + +from __future__ import annotations + +import html +from typing import Any + +from docutils import nodes +from docutils.parsers.rst import directives +from docutils.statemachine import StringList +from memory_data import stack_samples, stack_thread_sizes, load_board_data +from sphinx.application import Sphinx +from sphinx.util.docutils import SphinxDirective + +__version__ = "0.1.0" + +RESOURCES_DIR = __import__("pathlib").Path(__file__).parent / "static" + +THREAD_COLORS = { + "main": ("#2563eb", "#93c5fd"), + "zboss": ("#0891b2", "#a5f3fc"), +} + + +def _b_label(value_b: int) -> str: + return f"{value_b} B" + + +def _render_thread_bar(thread_id: str, label: str, used_b: int, size_b: int) -> str: + used_color, free_color = THREAD_COLORS[thread_id] + used_pct = min(100.0, 100.0 * used_b / size_b) if size_b else 0 + free_pct = 100.0 - used_pct + free_b = max(size_b - used_b, 0) + title = ( + f"{label}: {_b_label(size_b)} " + f"({_b_label(used_b)} used, {_b_label(free_b)} free)" + ) + inner = ( + f'' + f'' + ) + return ( + f'" + ) + + +def _parse_rst_label(directive: SphinxDirective, text: str) -> nodes.Element: + label = nodes.paragraph() + label["classes"] = ["memory-viz-sample-label"] + content = StringList([text], "") + directive.state.nested_parse(content, 0, label) + if len(label) == 1 and isinstance(label[0], nodes.paragraph): + inner = label[0] + label.remove(inner) + label.extend(inner.children) + return label + + +def _legend_swatch(color: str) -> str: + return f'' + + +def _legend_items_used_free(thread_id: str, label_base: str) -> str: + used_color, free_color = THREAD_COLORS[thread_id] + items: list[str] = [] + for suffix, color in (("used", used_color), ("free", free_color)): + items.append( + f'' + f"{_legend_swatch(color)}" + f"{label_base} ({suffix})" + f"" + ) + return "".join(items) + + +def _render_board_header(main_size_b: int, zboss_size_b: int) -> str: + return ( + f'
' + f'
Sample
' + f'
' + f'
' + f'main thread ({_b_label(main_size_b)})
' + f'
{_legend_items_used_free("main", "main")}
' + f"
" + f'
' + f'
' + f'zboss thread ({_b_label(zboss_size_b)})
' + f'
{_legend_items_used_free("zboss", "zboss")}
' + f"
" + f"
" + ) + + +def _grid_style(main_size_b: int, zboss_size_b: int) -> str: + return ( + f"--stack-viz-main-fr:{main_size_b}fr;" + f"--stack-viz-zboss-fr:{zboss_size_b}fr" + ) + + +def _build_board_nodes(directive: SphinxDirective, board: str) -> nodes.Element: + data = load_board_data(board) + samples = stack_samples(data) + if not samples: + paragraph = nodes.paragraph() + paragraph += nodes.Text(f"No stack measurements for board {board}.") + return paragraph + + main_size_b, zboss_size_b = stack_thread_sizes(samples) + style = _grid_style(main_size_b, zboss_size_b) + + wrapper = nodes.container() + wrapper += nodes.raw( + "", + f'
', + format="html", + ) + + board_node = nodes.container() + board_node["classes"] = ["stack-viz-board-inner"] + board_node += nodes.raw( + "", + _render_board_header(main_size_b, zboss_size_b), + format="html", + ) + + samples_node = nodes.container() + samples_node["classes"] = ["stack-viz-samples"] + + for sample in samples: + stack = sample["stack"] + row = nodes.container() + row["classes"] = ["stack-viz-sample-row"] + row += _parse_rst_label(directive, sample["label"]) + row += nodes.raw( + "", + '
' + + _render_thread_bar( + "main", + "main thread", + int(stack["main"]["used_b"]), + int(stack["main"]["size_b"]), + ) + + "
", + format="html", + ) + row += nodes.raw( + "", + '
' + + _render_thread_bar( + "zboss", + "zboss thread", + int(stack["zboss"]["used_b"]), + int(stack["zboss"]["size_b"]), + ) + + "
", + format="html", + ) + samples_node += row + + board_node += samples_node + wrapper += board_node + wrapper += nodes.raw("", "
", format="html") + return wrapper + + +class StackBoard(SphinxDirective): + """Render stack usage charts for a board defined in docs/data/memory/.""" + + required_arguments = 0 + optional_arguments = 0 + final_argument_whitespace = True + has_content = False + option_spec = { + "board": directives.unchanged_required, + } + + def run(self) -> list[nodes.Node]: + return [_build_board_nodes(self, self.options["board"])] + + +def add_stack_viz_resources(app: Sphinx) -> None: + static_path = RESOURCES_DIR.as_posix() + if static_path not in app.config.html_static_path: + app.config.html_static_path.append(static_path) + app.add_css_file("stack_viz.css") + + +def setup(app: Sphinx) -> dict[str, Any]: + app.add_directive("stack-board", StackBoard) + app.connect("builder-inited", add_stack_viz_resources) + return { + "version": __version__, + "parallel_read_safe": True, + "parallel_write_safe": True, + } diff --git a/docs/_extensions/static/memory_table.css b/docs/_extensions/static/memory_table.css new file mode 100644 index 00000000..55d5eb7b --- /dev/null +++ b/docs/_extensions/static/memory_table.css @@ -0,0 +1,69 @@ +.memory-req-table { + width: 100%; + margin: 1rem 0; + font-size: 0.875rem; +} + +.memory-req-table th, +.memory-req-table td { + border: 1px solid var(--bs-border-color, #dee2e6); + padding: 0.4rem 0.55rem; + vertical-align: middle; +} + +.memory-req-table thead th { + font-size: 0.75rem; + font-weight: 600; + text-transform: uppercase; + letter-spacing: 0.03em; + color: var(--bs-secondary-color, #6c757d); + background: var(--bs-tertiary-bg, #f8f9fa); +} + +.memory-req-table .memory-req-group-nvm { + text-align: center; +} + +.memory-req-table .memory-req-group-external { + text-align: center; +} + +.memory-req-table .memory-req-group-ram { + text-align: center; +} + +.memory-req-table .memory-req-subhead { + text-transform: none; + letter-spacing: normal; + font-weight: 500; +} + +.memory-req-table .memory-req-group-main, +.memory-req-table .memory-req-group-zboss { + text-align: center; +} + +.memory-req-table td.memory-req-sample { + min-width: 14rem; +} + +.memory-req-table td.memory-req-value { + text-align: right; + white-space: nowrap; +} + +.memory-req-table td.memory-req-empty { + color: var(--bs-secondary-color, #6c757d); + text-align: center; +} + +.memory-req-table p { + margin: 0; +} + +@media (max-width: 900px) { + .memory-req-table { + display: block; + overflow-x: auto; + } +} diff --git a/docs/_extensions/static/memory_viz.css b/docs/_extensions/static/memory_viz.css new file mode 100644 index 00000000..c9c8572f --- /dev/null +++ b/docs/_extensions/static/memory_viz.css @@ -0,0 +1,217 @@ +.memory-viz-board { + margin: 1.5rem 0 2.5rem; +} + +.memory-viz-chart-header, +.memory-viz-sample-row { + display: grid; + grid-template-columns: + minmax(14rem, 26rem) + minmax(0, var(--memory-viz-nvm-fr, 4fr)) + minmax(0, var(--memory-viz-ram-fr, 1fr)); + gap: 1rem; + align-items: center; +} + +.memory-viz-chart-header { + align-items: start; + margin-bottom: 0.75rem; + padding-bottom: 0.75rem; + border-bottom: 1px solid var(--bs-border-color, #dee2e6); +} + +.memory-viz-header-nvm, +.memory-viz-header-ram { + display: flex; + flex-direction: column; + gap: 0.35rem; + min-width: 0; +} + +.memory-viz-legend { + display: flex; + flex-wrap: wrap; + gap: 0.35rem 0.75rem; +} + +.memory-viz-legend-nvm, +.memory-viz-legend-ram { + margin-top: 0.15rem; +} + +.memory-viz-samples { + display: flex; + flex-direction: column; +} + +.memory-viz-sample-row { + padding: 0.65rem 0; + border-bottom: 1px solid var(--bs-border-color, #dee2e6); + overflow: visible; +} + +.memory-viz-sample-row:last-child { + border-bottom: none; +} + +.memory-viz-sample-label { + min-width: 0; + font-size: 0.875rem; +} + +.memory-viz-sample-label p { + margin: 0; +} + +.memory-viz-nvm-column { + display: flex; + flex-direction: column; + gap: 0.5rem; + min-width: 0; + overflow: visible; +} + +.memory-viz-na { + grid-column: 2 / 4; + color: var(--bs-secondary-color, #6c757d); + font-size: 0.875rem; +} + +@media (max-width: 900px) { + .memory-viz-chart-header, + .memory-viz-sample-row { + grid-template-columns: 1fr; + } + + .memory-viz-na { + grid-column: auto; + } +} + +.memory-viz-panel-title { + font-size: 0.8rem; + font-weight: 600; + text-transform: uppercase; + letter-spacing: 0.03em; + color: var(--bs-secondary-color, #6c757d); +} + +.memory-viz-panel-title-sample { + text-transform: none; + letter-spacing: normal; +} + +.memory-viz-panel-title-secondary { + font-size: 0.72rem; + font-weight: 500; + text-transform: none; + letter-spacing: normal; +} + +.memory-viz-bar-wrap { + min-width: 0; + overflow: visible; +} + +.memory-viz-bar-wrap-external { + max-width: 100%; +} + +.memory-viz-bar { + display: flex; + width: 100%; + height: 1.75rem; + border: 1px solid var(--bs-border-color, #ced4da); + border-radius: 0.25rem; + overflow: visible; + background: var(--bs-body-bg, #fff); +} + +.memory-viz-segment { + display: flex; + min-width: 0; + height: 100%; + border-right: 1px solid rgba(255, 255, 255, 0.35); + position: relative; + cursor: default; +} + +.memory-viz-segment::after { + content: attr(data-tooltip); + position: absolute; + left: 50%; + bottom: calc(100% + 0.35rem); + transform: translateX(-50%); + padding: 0.3rem 0.55rem; + border-radius: 0.2rem; + background: var(--bs-emphasis-color, #212529); + color: var(--bs-body-bg, #fff); + font-size: 0.875rem; + line-height: 1.3; + white-space: nowrap; + pointer-events: none; + opacity: 0; + visibility: hidden; + z-index: 20; +} + +.memory-viz-segment:hover::after, +.memory-viz-segment:focus-visible::after { + opacity: 1; + visibility: visible; +} + +.memory-viz-segment-zboss_nvram, +.memory-viz-segment-zboss_product_config, +.memory-viz-segment-storage, +.memory-viz-segment-boot, +.memory-viz-segment-mbr, +.memory-viz-segment-factory_data { + min-width: 3px; +} + +.memory-viz-segment:last-child { + border-right: none; +} + +.memory-viz-fill { + display: block; + height: 100%; + border-radius: inherit; +} + +.memory-viz-segment:first-child .memory-viz-fill:first-child { + border-top-left-radius: 0.2rem; + border-bottom-left-radius: 0.2rem; +} + +.memory-viz-segment:last-child .memory-viz-fill:last-child { + border-top-right-radius: 0.2rem; + border-bottom-right-radius: 0.2rem; +} + +.memory-viz-legend-item { + display: inline-flex; + align-items: center; + gap: 0.35rem; + font-size: 0.75rem; + color: var(--bs-body-color, #212529); +} + +.memory-viz-swatch { + width: 0.75rem; + height: 0.75rem; + border-radius: 0.125rem; + border: 1px solid rgba(0, 0, 0, 0.08); + flex-shrink: 0; +} + +.memory-viz-segment-slot1_ext { + background-image: repeating-linear-gradient( + -45deg, + transparent, + transparent 4px, + rgba(255, 255, 255, 0.25) 4px, + rgba(255, 255, 255, 0.25) 8px + ); +} diff --git a/docs/_extensions/static/stack_viz.css b/docs/_extensions/static/stack_viz.css new file mode 100644 index 00000000..e2f231b2 --- /dev/null +++ b/docs/_extensions/static/stack_viz.css @@ -0,0 +1,50 @@ +.stack-viz-board { + margin: 1.5rem 0 2.5rem; +} + +.stack-viz-chart-header, +.stack-viz-sample-row { + display: grid; + grid-template-columns: + minmax(14rem, 26rem) + minmax(0, var(--stack-viz-main-fr, 2048fr)) + minmax(0, var(--stack-viz-zboss-fr, 5120fr)); + gap: 1rem; + align-items: center; +} + +.stack-viz-chart-header { + align-items: start; + margin-bottom: 0.75rem; + padding-bottom: 0.75rem; + border-bottom: 1px solid var(--bs-border-color, #dee2e6); +} + +.stack-viz-header-thread { + display: flex; + flex-direction: column; + gap: 0.35rem; + min-width: 0; +} + +.stack-viz-samples { + display: flex; + flex-direction: column; +} + +.stack-viz-sample-row { + padding: 0.65rem 0; + border-bottom: 1px solid var(--bs-border-color, #dee2e6); + overflow: visible; +} + +.stack-viz-sample-row:last-child { + border-bottom: none; +} + +@media (max-width: 900px) { + .stack-viz-chart-header, + .stack-viz-sample-row { + grid-template-columns: 1fr; + } +} diff --git a/docs/conf.py b/docs/conf.py index 55c9d127..b61f2deb 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -30,6 +30,9 @@ 'sphinx_togglebutton', 'sphinx_copybutton', 'page_filter', + 'memory_data', + 'memory_viz', + 'stack_viz', ] # The root document. diff --git a/docs/data/memory/nrf52833.yaml b/docs/data/memory/nrf52833.yaml new file mode 100644 index 00000000..079a0c2e --- /dev/null +++ b/docs/data/memory/nrf52833.yaml @@ -0,0 +1,88 @@ +# Memory requirement data for nRF52833 DK. +# Partition sizes are derived from dts/*.dtsi. +# Sample usage is generated from Twister build logs. + +board: + name: nRF52833 DK + nvm_total_kb: 512 + ram_total_kb: 128 +legend_threshold_kb: 4 +layouts: + base: + source: dts/nrf52833_partitions.dtsi + partitions: + - id: slot0 + label: Application + size_kb: 484 + order: 0 + offset: 0 + - id: storage + label: Storage + size_kb: 8 + order: 1 + offset: 495616 + - id: zboss_nvram + label: ZBOSS NVRAM + size_kb: 16 + order: 2 + offset: 503808 + - id: zboss_product_config + label: ZBOSS product config + size_kb: 4 + order: 3 + offset: 520192 + legend_only: true + mcuboot_usb: + source: dts/mcuboot_usb_transport/nrf52833_partitions.dtsi + extends: base + partitions: + - id: boot + label: MCUboot + size_kb: 64 + order: 0 + offset: 0 + - id: slot0 + label: Application + size_kb: 420 + order: 1 + offset: 65536 +samples: + - label: ':ref:`Network coordinator `' + not_applicable: true + - label: ':ref:`Light bulb `' + not_applicable: true + - label: ':ref:`Light bulb ` with :ref:`zigbee_light_bulb_sample_matter` (debug)' + not_applicable: true + - label: ':ref:`Light bulb ` with :ref:`zigbee_light_bulb_sample_matter` (release)' + not_applicable: true + - label: ':ref:`Light switch `' + not_applicable: true + - label: ':ref:`Light switch ` with :ref:`lib_zigbee_fota`' + not_applicable: true + - label: ':ref:`Light switch ` with :ref:`zigbee_light_switch_sample_nus`' + not_applicable: true + - label: ':ref:`Light switch ` with :ref:`zigbee_light_switch_sample_nus` and :ref:`lib_zigbee_fota`' + not_applicable: true + - label: ':ref:`Light switch ` with :ref:`zigbee_light_switch_sample_matter` (debug)' + not_applicable: true + - label: ':ref:`Light switch ` with :ref:`zigbee_light_switch_sample_matter` (release)' + not_applicable: true + - label: ':ref:`NCP `' + layout: base + usage: + nvm: + slot0: 383 + ram_used_kb: 75 + - label: ':ref:`NCP with USB transport `' + layout: mcuboot_usb + usage: + nvm: + boot: 51 + slot0: 411 + ram_used_kb: 83 + - label: ':ref:`Zigbee application template `' + not_applicable: true + - label: ':ref:`Zigbee shell `' + not_applicable: true + - label: ':ref:`Zigbee shell over USB `' + not_applicable: true diff --git a/docs/data/memory/nrf52840.yaml b/docs/data/memory/nrf52840.yaml new file mode 100644 index 00000000..8d0ca3be --- /dev/null +++ b/docs/data/memory/nrf52840.yaml @@ -0,0 +1,166 @@ +# Memory requirement data for nRF52840 DK. +# Partition sizes are derived from dts/*.dtsi. +# Sample usage is generated from Twister build logs. + +board: + name: nRF52840 DK + nvm_total_kb: 1024 + ram_total_kb: 256 +legend_threshold_kb: 4 +layouts: + base: + source: dts/nrf52840_partitions.dtsi + partitions: + - id: slot0 + label: Application + size_kb: 980 + order: 0 + offset: 0 + - id: storage + label: Storage + size_kb: 8 + order: 1 + offset: 1003520 + - id: zboss_nvram + label: ZBOSS NVRAM + size_kb: 32 + order: 2 + offset: 1011712 + - id: zboss_product_config + label: ZBOSS product config + size_kb: 4 + order: 3 + offset: 1044480 + legend_only: true + ext_flash: + source: dts/ext_flash/nrf52840dk_partitions.dtsi + extends: base + partitions: + - id: boot + label: MCUboot + size_kb: 48 + order: 0 + offset: 0 + - id: slot0 + label: Application + size_kb: 932 + order: 1 + offset: 49152 + external: + nvm_total_kb: 932 + partitions: + - id: slot1_ext + label: Upgrade slot (external) + size_kb: 932 + order: 0 + offset: 0 + mcuboot_usb: + source: dts/mcuboot_usb_transport/nrf52840_partitions.dtsi + extends: base + partitions: + - id: boot + label: MCUboot + size_kb: 64 + order: 0 + offset: 0 + - id: slot0 + label: Application + size_kb: 916 + order: 1 + offset: 65536 +samples: + - label: ':ref:`Network coordinator `' + layout: base + usage: + nvm: + slot0: 382 + ram_used_kb: 72 + stack: + main: + used_b: 656 + size_b: 2048 + zboss: + used_b: 3032 + size_b: 5120 + - label: ':ref:`Light bulb `' + layout: base + usage: + nvm: + slot0: 406 + ram_used_kb: 62 + stack: + main: + used_b: 664 + size_b: 2048 + zboss: + used_b: 3036 + size_b: 5120 + - label: ':ref:`Light bulb ` with :ref:`zigbee_light_bulb_sample_matter` (debug)' + not_applicable: true + - label: ':ref:`Light bulb ` with :ref:`zigbee_light_bulb_sample_matter` (release)' + not_applicable: true + - label: ':ref:`Light switch `' + layout: base + usage: + nvm: + slot0: 312 + ram_used_kb: 42 + stack: + main: + used_b: 728 + size_b: 2048 + zboss: + used_b: 3008 + size_b: 5120 + - label: ':ref:`Light switch ` with :ref:`lib_zigbee_fota`' + layout: ext_flash + usage: + nvm: + boot: 33 + slot0: 337 + ram_used_kb: 45 + external: + slot1_ext: 196 + - label: ':ref:`Light switch ` with :ref:`zigbee_light_switch_sample_nus`' + layout: base + usage: + nvm: + slot0: 440 + ram_used_kb: 59 + - label: ':ref:`Light switch ` with :ref:`zigbee_light_switch_sample_nus` and :ref:`lib_zigbee_fota`' + not_applicable: true + - label: ':ref:`Light switch ` with :ref:`zigbee_light_switch_sample_matter` (debug)' + not_applicable: true + - label: ':ref:`Light switch ` with :ref:`zigbee_light_switch_sample_matter` (release)' + not_applicable: true + - label: ':ref:`NCP `' + layout: base + usage: + nvm: + slot0: 405 + ram_used_kb: 79 + - label: ':ref:`NCP with USB transport `' + layout: mcuboot_usb + usage: + nvm: + boot: 58 + slot0: 433 + ram_used_kb: 87 + - label: ':ref:`Zigbee application template `' + layout: base + usage: + nvm: + slot0: 382 + ram_used_kb: 61 + - label: ':ref:`Zigbee shell `' + layout: base + usage: + nvm: + slot0: 468 + ram_used_kb: 78 + - label: ':ref:`Zigbee shell over USB `' + layout: base + usage: + nvm: + slot0: 492 + ram_used_kb: 86 diff --git a/docs/data/memory/nrf52840_dongle.yaml b/docs/data/memory/nrf52840_dongle.yaml new file mode 100644 index 00000000..09d12b10 --- /dev/null +++ b/docs/data/memory/nrf52840_dongle.yaml @@ -0,0 +1,78 @@ +# Memory requirement data for nRF52840 Dongle DK. +# Partition sizes are derived from dts/*.dtsi. +# Sample usage is generated from Twister build logs. + +board: + name: nRF52840 Dongle DK + nvm_total_kb: 1024 + ram_total_kb: 256 +legend_threshold_kb: 4 +layouts: + base: + source: dts/nrf52840dongle_partitions.dtsi + partitions: + - id: mbr + label: nRF5 MBR + size_kb: 4 + order: 0 + offset: 0 + - id: slot0 + label: Application + size_kb: 976 + order: 1 + offset: 4096 + - id: storage + label: Storage + size_kb: 8 + order: 2 + offset: 1003520 + - id: zboss_nvram + label: ZBOSS NVRAM + size_kb: 32 + order: 3 + offset: 1011712 + - id: zboss_product_config + label: ZBOSS product config + size_kb: 4 + order: 4 + offset: 1044480 + legend_only: true +samples: + - label: ':ref:`Network coordinator `' + not_applicable: true + - label: ':ref:`Light bulb `' + not_applicable: true + - label: ':ref:`Light bulb ` with :ref:`zigbee_light_bulb_sample_matter` (debug)' + not_applicable: true + - label: ':ref:`Light bulb ` with :ref:`zigbee_light_bulb_sample_matter` (release)' + not_applicable: true + - label: ':ref:`Light switch `' + not_applicable: true + - label: ':ref:`Light switch ` with :ref:`lib_zigbee_fota`' + not_applicable: true + - label: ':ref:`Light switch ` with :ref:`zigbee_light_switch_sample_nus`' + not_applicable: true + - label: ':ref:`Light switch ` with :ref:`zigbee_light_switch_sample_nus` and :ref:`lib_zigbee_fota`' + not_applicable: true + - label: ':ref:`Light switch ` with :ref:`zigbee_light_switch_sample_matter` (debug)' + not_applicable: true + - label: ':ref:`Light switch ` with :ref:`zigbee_light_switch_sample_matter` (release)' + not_applicable: true + - label: ':ref:`NCP `' + not_applicable: true + - label: ':ref:`NCP with USB transport `' + layout: base + usage: + nvm: + slot0: 428 + ram_used_kb: 87 + - label: ':ref:`Zigbee application template `' + not_applicable: true + - label: ':ref:`Zigbee shell `' + not_applicable: true + - label: ':ref:`Zigbee shell over USB `' + layout: base + usage: + nvm: + slot0: 490 + ram_used_kb: 86 diff --git a/docs/data/memory/nrf5340.yaml b/docs/data/memory/nrf5340.yaml new file mode 100644 index 00000000..12e8e6e8 --- /dev/null +++ b/docs/data/memory/nrf5340.yaml @@ -0,0 +1,180 @@ +# Memory requirement data for nRF5340 DK. +# Partition sizes are derived from dts/*.dtsi. +# Sample usage is generated from Twister build logs. + +board: + name: nRF5340 DK + nvm_total_kb: 1024 + ram_total_kb: 448 +legend_threshold_kb: 4 +layouts: + base: + source: dts/nrf5340_cpuapp_partitions.dtsi + partitions: + - id: slot0 + label: Application + size_kb: 980 + order: 0 + offset: 0 + - id: storage + label: Storage + size_kb: 8 + order: 1 + offset: 1003520 + - id: zboss_nvram + label: ZBOSS NVRAM + size_kb: 32 + order: 2 + offset: 1011712 + - id: zboss_product_config + label: ZBOSS product config + size_kb: 4 + order: 3 + offset: 1044480 + legend_only: true + ext_flash: + source: dts/ext_flash/nrf5340dk_cpuapp_partitions.dtsi + extends: base + partitions: + - id: boot + label: MCUboot + size_kb: 64 + order: 0 + offset: 0 + - id: slot0 + label: Application + size_kb: 916 + order: 1 + offset: 65536 + external: + nvm_total_kb: 1172 + partitions: + - id: slot1_ext + label: Upgrade slot (external) + size_kb: 916 + order: 0 + offset: 0 + - id: slot3_ext + label: Net core upgrade slot (external) + size_kb: 256 + order: 1 + offset: 937984 + mcuboot_usb: + source: dts/mcuboot_usb_transport/nrf5340_cpuapp_partitions.dtsi + extends: base + partitions: + - id: boot + label: MCUboot + size_kb: 64 + order: 0 + offset: 0 + - id: slot0 + label: Application + size_kb: 916 + order: 1 + offset: 65536 +samples: + - label: ':ref:`Network coordinator `' + layout: base + usage: + nvm: + slot0: 351 + ram_used_kb: 81 + stack: + main: + used_b: 756 + size_b: 2048 + zboss: + used_b: 1376 + size_b: 5120 + - label: ':ref:`Light bulb `' + layout: base + usage: + nvm: + slot0: 375 + ram_used_kb: 71 + stack: + main: + used_b: 756 + size_b: 2048 + zboss: + used_b: 1376 + size_b: 5120 + - label: ':ref:`Light bulb ` with :ref:`zigbee_light_bulb_sample_matter` (debug)' + not_applicable: true + - label: ':ref:`Light bulb ` with :ref:`zigbee_light_bulb_sample_matter` (release)' + not_applicable: true + - label: ':ref:`Light switch `' + layout: base + usage: + nvm: + slot0: 281 + ram_used_kb: 51 + stack: + main: + used_b: 760 + size_b: 2048 + zboss: + used_b: 1376 + size_b: 5120 + - label: ':ref:`Light switch ` with :ref:`lib_zigbee_fota`' + layout: ext_flash + usage: + nvm: + boot: 38 + slot0: 307 + ram_used_kb: 58 + external: + slot1_ext: 177 + slot3_ext: 159 + - label: ':ref:`Light switch ` with :ref:`zigbee_light_switch_sample_nus`' + layout: base + usage: + nvm: + slot0: 351 + ram_used_kb: 67 + - label: ':ref:`Light switch ` with :ref:`zigbee_light_switch_sample_nus` and :ref:`lib_zigbee_fota`' + layout: ext_flash + usage: + nvm: + boot: 38 + slot0: 376 + ram_used_kb: 80 + external: + slot1_ext: 213 + slot3_ext: 159 + - label: ':ref:`Light switch ` with :ref:`zigbee_light_switch_sample_matter` (debug)' + not_applicable: true + - label: ':ref:`Light switch ` with :ref:`zigbee_light_switch_sample_matter` (release)' + not_applicable: true + - label: ':ref:`NCP `' + layout: base + usage: + nvm: + slot0: 374 + ram_used_kb: 88 + - label: ':ref:`NCP with USB transport `' + layout: mcuboot_usb + usage: + nvm: + boot: 57 + slot0: 401 + ram_used_kb: 96 + - label: ':ref:`Zigbee application template `' + layout: base + usage: + nvm: + slot0: 350 + ram_used_kb: 70 + - label: ':ref:`Zigbee shell `' + layout: base + usage: + nvm: + slot0: 437 + ram_used_kb: 87 + - label: ':ref:`Zigbee shell over USB `' + layout: base + usage: + nvm: + slot0: 461 + ram_used_kb: 95 diff --git a/docs/data/memory/nrf54l05.yaml b/docs/data/memory/nrf54l05.yaml new file mode 100644 index 00000000..8965100d --- /dev/null +++ b/docs/data/memory/nrf54l05.yaml @@ -0,0 +1,41 @@ +# Memory requirement data for nRF54L05 (nRF54L15 DK emulation). +# Partition sizes are derived from dts/*.dtsi. +# Sample usage is generated from Twister build logs. + +board: + name: nRF54L05 (nRF54L15 DK emulation) + nvm_total_kb: 500 + ram_total_kb: 96 +legend_threshold_kb: 4 +layouts: + base: + source: dts/nrf54l05_cpuapp_partitions.dtsi + partitions: + - id: slot0 + label: Application + size_kb: 456 + order: 0 + offset: 0 + - id: storage + label: Storage + size_kb: 8 + order: 1 + offset: 466944 + - id: zboss_nvram + label: ZBOSS NVRAM + size_kb: 32 + order: 2 + offset: 475136 + - id: zboss_product_config + label: ZBOSS product config + size_kb: 4 + order: 3 + offset: 507904 + legend_only: true +samples: + - label: ':ref:`NCP `' + layout: base + usage: + nvm: + slot0: 404 + ram_used_kb: 80 diff --git a/docs/data/memory/nrf54l10.yaml b/docs/data/memory/nrf54l10.yaml new file mode 100644 index 00000000..10d5aee6 --- /dev/null +++ b/docs/data/memory/nrf54l10.yaml @@ -0,0 +1,108 @@ +# Memory requirement data for nRF54L10 (nRF54L15 DK emulation). +# Partition sizes are derived from dts/*.dtsi. +# Sample usage is generated from Twister build logs. + +board: + name: nRF54L10 (nRF54L15 DK emulation) + nvm_total_kb: 1012 + ram_total_kb: 192 +legend_threshold_kb: 4 +layouts: + base: + source: dts/nrf54l10_cpuapp_partitions.dtsi + partitions: + - id: slot0 + label: Application + size_kb: 968 + order: 0 + offset: 0 + - id: storage + label: Storage + size_kb: 8 + order: 1 + offset: 991232 + - id: zboss_nvram + label: ZBOSS NVRAM + size_kb: 32 + order: 2 + offset: 999424 + - id: zboss_product_config + label: ZBOSS product config + size_kb: 4 + order: 3 + offset: 1032192 + legend_only: true + ext_flash: + source: dts/ext_flash/nrf54l10dk_cpuapp_partitions.dtsi + extends: base + partitions: + - id: boot + label: MCUboot + size_kb: 80 + order: 0 + offset: 0 + - id: slot0 + label: Application + size_kb: 888 + order: 1 + offset: 81920 + external: + nvm_total_kb: 888 + partitions: + - id: slot1_ext + label: Upgrade slot (external) + size_kb: 888 + order: 0 + offset: 0 +samples: + - label: ':ref:`Network coordinator `' + layout: base + usage: + nvm: + slot0: 380 + ram_used_kb: 73 + - label: ':ref:`Light bulb `' + layout: base + usage: + nvm: + slot0: 407 + ram_used_kb: 63 + - label: ':ref:`Light switch `' + layout: base + usage: + nvm: + slot0: 309 + ram_used_kb: 43 + - label: ':ref:`Light switch ` with :ref:`lib_zigbee_fota`' + layout: ext_flash + usage: + nvm: + boot: 56 + slot0: 335 + ram_used_kb: 46 + external: + slot1_ext: 194 + - label: ':ref:`Light switch ` with :ref:`zigbee_light_switch_sample_nus`' + layout: base + usage: + nvm: + slot0: 419 + ram_used_kb: 59 + - label: ':ref:`NCP `' + layout: base + usage: + nvm: + slot0: 404 + ram_used_kb: 80 + - label: ':ref:`Zigbee application template `' + layout: base + usage: + nvm: + slot0: 376 + ram_used_kb: 62 + - label: ':ref:`Zigbee shell `' + layout: base + usage: + nvm: + slot0: 465 + ram_used_kb: 79 diff --git a/docs/data/memory/nrf54l15.yaml b/docs/data/memory/nrf54l15.yaml new file mode 100644 index 00000000..1a62b39b --- /dev/null +++ b/docs/data/memory/nrf54l15.yaml @@ -0,0 +1,221 @@ +# Memory requirement data for nRF54L15 DK. +# Partition sizes are derived from dts/*.dtsi. +# Sample usage is generated from Twister build logs. + +board: + name: nRF54L15 DK + nvm_total_kb: 1524 + ram_total_kb: 256 +legend_threshold_kb: 4 +layouts: + base: + source: dts/nrf54l15_cpuapp_partitions.dtsi + partitions: + - id: slot0 + label: Application + size_kb: 1480 + order: 0 + offset: 0 + - id: storage + label: Storage + size_kb: 8 + order: 1 + offset: 1515520 + - id: zboss_nvram + label: ZBOSS NVRAM + size_kb: 32 + order: 2 + offset: 1523712 + - id: zboss_product_config + label: ZBOSS product config + size_kb: 4 + order: 3 + offset: 1556480 + legend_only: true + ext_flash: + source: dts/ext_flash/nrf54l15dk_cpuapp_partitions.dtsi + extends: base + partitions: + - id: boot + label: MCUboot + size_kb: 80 + order: 0 + offset: 0 + - id: slot0 + label: Application + size_kb: 1400 + order: 1 + offset: 81920 + external: + nvm_total_kb: 1400 + partitions: + - id: slot1_ext + label: Upgrade slot (external) + size_kb: 1400 + order: 0 + offset: 0 + matter: + source: dts/matter/nrf54l15dk_cpuapp_partitions.dtsi + partitions: + - id: boot + label: MCUboot + size_kb: 80 + order: 0 + offset: 0 + - id: slot0 + label: Application + size_kb: 1364 + order: 1 + offset: 81920 + - id: factory_data + label: Factory data + size_kb: 4 + order: 2 + offset: 1478656 + legend_only: true + - id: storage + label: Storage + size_kb: 40 + order: 3 + offset: 1482752 + - id: zboss_nvram + label: ZBOSS NVRAM + size_kb: 32 + order: 4 + offset: 1523712 + - id: zboss_product_config + label: ZBOSS product config + size_kb: 4 + order: 5 + offset: 1556480 + legend_only: true + external: + nvm_total_kb: 1364 + partitions: + - id: slot1_ext + label: Upgrade slot (external) + size_kb: 1364 + order: 0 + offset: 0 +samples: + - label: ':ref:`Network coordinator `' + layout: base + usage: + nvm: + slot0: 381 + ram_used_kb: 73 + stack: + main: + used_b: 840 + size_b: 2048 + zboss: + used_b: 2312 + size_b: 5120 + - label: ':ref:`Light bulb `' + layout: base + usage: + nvm: + slot0: 407 + ram_used_kb: 63 + stack: + main: + used_b: 840 + size_b: 2048 + zboss: + used_b: 2112 + size_b: 5120 + - label: ':ref:`Light bulb ` with :ref:`zigbee_light_bulb_sample_matter` (debug)' + layout: matter + usage: + nvm: + boot: 56 + slot0: 1056 + ram_used_kb: 228 + external: + slot1_ext: 601 + - label: ':ref:`Light bulb ` with :ref:`zigbee_light_bulb_sample_matter` (release)' + layout: matter + usage: + nvm: + boot: 56 + slot0: 962 + ram_used_kb: 227 + external: + slot1_ext: 564 + - label: ':ref:`Light switch `' + layout: base + usage: + nvm: + slot0: 309 + ram_used_kb: 43 + stack: + main: + used_b: 912 + size_b: 2048 + zboss: + used_b: 2128 + size_b: 5120 + - label: ':ref:`Light switch ` with :ref:`lib_zigbee_fota`' + layout: ext_flash + usage: + nvm: + boot: 56 + slot0: 335 + ram_used_kb: 46 + external: + slot1_ext: 194 + - label: ':ref:`Light switch ` with :ref:`zigbee_light_switch_sample_nus`' + layout: base + usage: + nvm: + slot0: 419 + ram_used_kb: 59 + - label: ':ref:`Light switch ` with :ref:`zigbee_light_switch_sample_nus` and :ref:`lib_zigbee_fota`' + layout: ext_flash + usage: + nvm: + boot: 56 + slot0: 444 + ram_used_kb: 66 + external: + slot1_ext: 257 + - label: ':ref:`Light switch ` with :ref:`zigbee_light_switch_sample_matter` (debug)' + layout: matter + usage: + nvm: + boot: 56 + slot0: 928 + ram_used_kb: 200 + external: + slot1_ext: 525 + - label: ':ref:`Light switch ` with :ref:`zigbee_light_switch_sample_matter` (release)' + layout: matter + usage: + nvm: + boot: 56 + slot0: 835 + ram_used_kb: 200 + external: + slot1_ext: 488 + - label: ':ref:`NCP `' + layout: base + usage: + nvm: + slot0: 404 + ram_used_kb: 80 + - label: ':ref:`NCP with USB transport `' + not_applicable: true + - label: ':ref:`Zigbee application template `' + layout: base + usage: + nvm: + slot0: 376 + ram_used_kb: 62 + - label: ':ref:`Zigbee shell `' + layout: base + usage: + nvm: + slot0: 465 + ram_used_kb: 79 + - label: ':ref:`Zigbee shell over USB `' + not_applicable: true diff --git a/docs/data/memory/nrf54lm20.yaml b/docs/data/memory/nrf54lm20.yaml new file mode 100644 index 00000000..d680ea25 --- /dev/null +++ b/docs/data/memory/nrf54lm20.yaml @@ -0,0 +1,227 @@ +# Memory requirement data for nRF54LM20 DK. +# Partition sizes are derived from dts/*.dtsi. +# Sample usage is generated from Twister build logs. + +board: + name: nRF54LM20 DK + nvm_total_kb: 2036 + ram_total_kb: 511 +legend_threshold_kb: 4 +layouts: + base: + source: dts/nrf54lm20_cpuapp_partitions.dtsi + partitions: + - id: slot0 + label: Application + size_kb: 1992 + order: 0 + offset: 0 + - id: storage + label: Storage + size_kb: 8 + order: 1 + offset: 2039808 + - id: zboss_nvram + label: ZBOSS NVRAM + size_kb: 32 + order: 2 + offset: 2048000 + - id: zboss_product_config + label: ZBOSS product config + size_kb: 4 + order: 3 + offset: 2080768 + legend_only: true + matter: + source: dts/matter/nrf54lm20dk_cpuapp_partitions.dtsi + extends: base + partitions: + - id: boot + label: MCUboot + size_kb: 40 + order: 0 + offset: 0 + - id: slot0 + label: Application + size_kb: 1140 + order: 1 + offset: 40960 + - id: slot1 + label: Upgrade slot + size_kb: 768 + order: 2 + offset: 1208320 + - id: factory_data + label: Factory data + size_kb: 4 + order: 3 + offset: 1994752 + legend_only: true + - id: storage + label: Storage + size_kb: 48 + order: 4 + offset: 1998848 + ext_flash: + source: dts/ext_flash/nrf54lm20dk_cpuapp_partitions.dtsi + extends: base + partitions: + - id: boot + label: MCUboot + size_kb: 56 + order: 0 + offset: 0 + - id: slot0 + label: Application + size_kb: 1940 + order: 1 + offset: 57344 + external: + nvm_total_kb: 1940 + partitions: + - id: slot1_ext + label: Upgrade slot (external) + size_kb: 1940 + order: 0 + offset: 0 + mcuboot_usb: + source: dts/mcuboot_usb_transport/nrf54lm20_cpuapp_partitions.dtsi + extends: base + partitions: + - id: boot + label: MCUboot + size_kb: 64 + order: 0 + offset: 0 + - id: slot0 + label: Application + size_kb: 1928 + order: 1 + offset: 65536 +samples: + - label: ':ref:`Network coordinator `' + layout: base + usage: + nvm: + slot0: 369 + ram_used_kb: 73 + stack: + main: + used_b: 832 + size_b: 2048 + zboss: + used_b: 2288 + size_b: 5120 + - label: ':ref:`Light bulb `' + layout: base + usage: + nvm: + slot0: 395 + ram_used_kb: 63 + stack: + main: + used_b: 912 + size_b: 2048 + zboss: + used_b: 2104 + size_b: 5120 + - label: ':ref:`Light bulb ` with :ref:`zigbee_light_bulb_sample_matter` (debug)' + layout: matter + usage: + nvm: + boot: 38 + slot0: 1050 + slot1: 597 + ram_used_kb: 228 + - label: ':ref:`Light bulb ` with :ref:`zigbee_light_bulb_sample_matter` (release)' + layout: matter + usage: + nvm: + boot: 38 + slot0: 958 + slot1: 561 + ram_used_kb: 228 + - label: ':ref:`Light switch `' + layout: base + usage: + nvm: + slot0: 297 + ram_used_kb: 43 + stack: + main: + used_b: 984 + size_b: 2048 + zboss: + used_b: 2104 + size_b: 5120 + - label: ':ref:`Light switch ` with :ref:`lib_zigbee_fota`' + layout: ext_flash + usage: + nvm: + boot: 48 + slot0: 335 + ram_used_kb: 46 + external: + slot1_ext: 193 + - label: ':ref:`Light switch ` with :ref:`zigbee_light_switch_sample_nus`' + layout: base + usage: + nvm: + slot0: 406 + ram_used_kb: 59 + - label: ':ref:`Light switch ` with :ref:`zigbee_light_switch_sample_nus` and :ref:`lib_zigbee_fota`' + layout: ext_flash + usage: + nvm: + boot: 48 + slot0: 443 + ram_used_kb: 67 + external: + slot1_ext: 256 + - label: ':ref:`Light switch ` with :ref:`zigbee_light_switch_sample_matter` (debug)' + layout: matter + usage: + nvm: + boot: 38 + slot0: 921 + slot1: 521 + ram_used_kb: 200 + - label: ':ref:`Light switch ` with :ref:`zigbee_light_switch_sample_matter` (release)' + layout: matter + usage: + nvm: + boot: 38 + slot0: 829 + slot1: 484 + ram_used_kb: 200 + - label: ':ref:`NCP `' + layout: base + usage: + nvm: + slot0: 393 + ram_used_kb: 80 + - label: ':ref:`NCP with USB transport `' + layout: mcuboot_usb + usage: + nvm: + boot: 57 + slot0: 427 + ram_used_kb: 90 + - label: ':ref:`Zigbee application template `' + layout: base + usage: + nvm: + slot0: 368 + ram_used_kb: 62 + - label: ':ref:`Zigbee shell `' + layout: base + usage: + nvm: + slot0: 452 + ram_used_kb: 79 + - label: ':ref:`Zigbee shell over USB `' + layout: base + usage: + nvm: + slot0: 485 + ram_used_kb: 89 diff --git a/docs/memory.rst b/docs/memory.rst index afc4dd24..7e8ded30 100644 --- a/docs/memory.rst +++ b/docs/memory.rst @@ -86,7 +86,7 @@ The following table lists the available files, which targets they cover, and whe | 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``. + On the nRF5340 DK, external flash can also hold ``image-3`` (net core upgrade slot). Reference layout for :ref:`lib_zigbee_fota` over external flash. To add an overlay file to your application, add an ``#include`` line to :file:`app.overlay` or to a board overlay in :file:`boards/`. @@ -104,268 +104,145 @@ 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. +The following tables and bar charts list memory requirement values for Zigbee samples. + +Memory layout is taken from the DTS files used by each sample variant, while memory usage is taken from the build output. Values are provided in kilobytes (KB). -``n/a`` indicates that the sample with the given variant is not supported on the DK. +Unsupported sample variants are omitted from each board view. +``--`` indicates that a partition is not used by the sample configuration. + +Table columns are grouped by internal NVM, external NVM (when used), and RAM. +Application, MCUboot, upgrade slot, and RAM cells show used and free space separated by ``/``. +Other NVM columns list the reserved partition size for that region. .. tabs:: - .. group-tab:: nRF52833 - - 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 | - +========================================================================================================================+==========================+===========================+==================================+=============================+=============+==========================+=============+ - | :ref:`Network coordinator ` | n/a | n/a | n/a | n/a | n/a | n/a | n/a | - +------------------------------------------------------------------------------------------------------------------------+--------------------------+---------------------------+----------------------------------+-----------------------------+-------------+--------------------------+-------------+ - | :ref:`Light bulb ` | n/a | n/a | n/a | n/a | n/a | n/a | n/a | - +------------------------------------------------------------------------------------------------------------------------+--------------------------+---------------------------+----------------------------------+-----------------------------+-------------+--------------------------+-------------+ - | :ref:`Light switch ` | n/a | n/a | n/a | n/a | n/a | n/a | n/a | - +------------------------------------------------------------------------------------------------------------------------+--------------------------+---------------------------+----------------------------------+-----------------------------+-------------+--------------------------+-------------+ - | :ref:`Light switch ` with :ref:`lib_zigbee_fota` | n/a | n/a | n/a | n/a | n/a | n/a | n/a | - +------------------------------------------------------------------------------------------------------------------------+--------------------------+---------------------------+----------------------------------+-----------------------------+-------------+--------------------------+-------------+ - | :ref:`Light switch ` with :ref:`zigbee_light_switch_sample_nus` | n/a | n/a | n/a | n/a | n/a | n/a | n/a | - +------------------------------------------------------------------------------------------------------------------------+--------------------------+---------------------------+----------------------------------+-----------------------------+-------------+--------------------------+-------------+ - | :ref:`Light switch ` with :ref:`zigbee_light_switch_sample_nus` and :ref:`lib_zigbee_fota` | n/a | n/a | n/a | n/a | n/a | n/a | n/a | - +------------------------------------------------------------------------------------------------------------------------+--------------------------+---------------------------+----------------------------------+-----------------------------+-------------+--------------------------+-------------+ - | :ref:`NCP ` | 392 | 0 | 16 | 4 | 412 | 86 | 86 | - +------------------------------------------------------------------------------------------------------------------------+--------------------------+---------------------------+----------------------------------+-----------------------------+-------------+--------------------------+-------------+ - | :ref:`NCP with USB transport ` | 409 | 64 | 16 | 4 | 493 | 95 | 95 | - +------------------------------------------------------------------------------------------------------------------------+--------------------------+---------------------------+----------------------------------+-----------------------------+-------------+--------------------------+-------------+ - | :ref:`Zigbee application template ` | n/a | n/a | n/a | n/a | n/a | n/a | n/a | - +------------------------------------------------------------------------------------------------------------------------+--------------------------+---------------------------+----------------------------------+-----------------------------+-------------+--------------------------+-------------+ - | :ref:`Zigbee shell ` | n/a | n/a | n/a | n/a | n/a | n/a | n/a | - +------------------------------------------------------------------------------------------------------------------------+--------------------------+---------------------------+----------------------------------+-----------------------------+-------------+--------------------------+-------------+ - | :ref:`Zigbee shell over USB ` | n/a | n/a | n/a | n/a | n/a | n/a | n/a | - +------------------------------------------------------------------------------------------------------------------------+--------------------------+---------------------------+----------------------------------+-----------------------------+-------------+--------------------------+-------------+ - - .. group-tab:: nRF52840 - - The following table lists memory requirements for samples running on the `nRF52840 DK `_ (`nrf52840dk`_). - - +------------------------------------------------------------------------------------------------------------------------+--------------------------+---------------------------+----------------------------------+-----------------------------+-------------+--------------------------+-------------+ - | 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 | - +========================================================================================================================+==========================+===========================+==================================+=============================+=============+==========================+=============+ - | :ref:`Network coordinator ` | 409 | 0 | 32 | 4 | 445 | 84 | 84 | - +------------------------------------------------------------------------------------------------------------------------+--------------------------+---------------------------+----------------------------------+-----------------------------+-------------+--------------------------+-------------+ - | :ref:`Light bulb ` | 433 | 0 | 32 | 4 | 469 | 64 | 64 | - +------------------------------------------------------------------------------------------------------------------------+--------------------------+---------------------------+----------------------------------+-----------------------------+-------------+--------------------------+-------------+ - | :ref:`Light switch ` | 340 | 0 | 32 | 4 | 376 | 54 | 54 | - +------------------------------------------------------------------------------------------------------------------------+--------------------------+---------------------------+----------------------------------+-----------------------------+-------------+--------------------------+-------------+ - | :ref:`Light switch ` with :ref:`lib_zigbee_fota` | 355 | 48 | 32 | 4 | 439 | 62 | 62 | - +------------------------------------------------------------------------------------------------------------------------+--------------------------+---------------------------+----------------------------------+-----------------------------+-------------+--------------------------+-------------+ - | :ref:`Light switch ` with :ref:`zigbee_light_switch_sample_nus` | 453 | 0 | 32 | 4 | 489 | 70 | 70 | - +------------------------------------------------------------------------------------------------------------------------+--------------------------+---------------------------+----------------------------------+-----------------------------+-------------+--------------------------+-------------+ - | :ref:`Light switch ` with :ref:`zigbee_light_switch_sample_nus` and :ref:`lib_zigbee_fota` | n/a | n/a | n/a | n/a | n/a | n/a | n/a | - +------------------------------------------------------------------------------------------------------------------------+--------------------------+---------------------------+----------------------------------+-----------------------------+-------------+--------------------------+-------------+ - | :ref:`NCP ` | 433 | 0 | 32 | 4 | 469 | 91 | 91 | - +------------------------------------------------------------------------------------------------------------------------+--------------------------+---------------------------+----------------------------------+-----------------------------+-------------+--------------------------+-------------+ - | :ref:`NCP with USB transport ` | 450 | 64 | 32 | 4 | 550 | 100 | 100 | - +------------------------------------------------------------------------------------------------------------------------+--------------------------+---------------------------+----------------------------------+-----------------------------+-------------+--------------------------+-------------+ - | :ref:`Zigbee application template ` | 408 | 0 | 32 | 4 | 444 | 74 | 74 | - +------------------------------------------------------------------------------------------------------------------------+--------------------------+---------------------------+----------------------------------+-----------------------------+-------------+--------------------------+-------------+ - | :ref:`Zigbee shell ` | 488 | 0 | 32 | 4 | 524 | 91 | 91 | - +------------------------------------------------------------------------------------------------------------------------+--------------------------+---------------------------+----------------------------------+-----------------------------+-------------+--------------------------+-------------+ - | :ref:`Zigbee shell over USB ` | 506 | 0 | 32 | 4 | 542 | 100 | 100 | - +------------------------------------------------------------------------------------------------------------------------+--------------------------+---------------------------+----------------------------------+-----------------------------+-------------+--------------------------+-------------+ - - .. group-tab:: nRF52840 Dongle - - The following table lists memory requirements for samples running on the `nRF52840 Dongle DK `_ (`nrf52840dongle`_). - - +------------------------------------------------------------------------------------------------------------------------+--------------------------+---------------------------+----------------------------------+-----------------------------+-------------+--------------------------+-------------+ - | 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 | - +========================================================================================================================+==========================+===========================+==================================+=============================+=============+==========================+=============+ - | :ref:`Network coordinator ` | n/a | n/a | n/a | n/a | n/a | n/a | n/a | - +------------------------------------------------------------------------------------------------------------------------+--------------------------+---------------------------+----------------------------------+-----------------------------+-------------+--------------------------+-------------+ - | :ref:`Light bulb ` | n/a | n/a | n/a | n/a | n/a | n/a | n/a | - +------------------------------------------------------------------------------------------------------------------------+--------------------------+---------------------------+----------------------------------+-----------------------------+-------------+--------------------------+-------------+ - | :ref:`Light switch ` | n/a | n/a | n/a | n/a | n/a | n/a | n/a | - +------------------------------------------------------------------------------------------------------------------------+--------------------------+---------------------------+----------------------------------+-----------------------------+-------------+--------------------------+-------------+ - | :ref:`Light switch ` with :ref:`lib_zigbee_fota` | n/a | n/a | n/a | n/a | n/a | n/a | n/a | - +------------------------------------------------------------------------------------------------------------------------+--------------------------+---------------------------+----------------------------------+-----------------------------+-------------+--------------------------+-------------+ - | :ref:`Light switch ` with :ref:`zigbee_light_switch_sample_nus` | n/a | n/a | n/a | n/a | n/a | n/a | n/a | - +------------------------------------------------------------------------------------------------------------------------+--------------------------+---------------------------+----------------------------------+-----------------------------+-------------+--------------------------+-------------+ - | :ref:`Light switch ` with :ref:`zigbee_light_switch_sample_nus` and :ref:`lib_zigbee_fota` | n/a | n/a | n/a | n/a | n/a | n/a | n/a | - +------------------------------------------------------------------------------------------------------------------------+--------------------------+---------------------------+----------------------------------+-----------------------------+-------------+--------------------------+-------------+ - | :ref:`NCP ` | n/a | n/a | n/a | n/a | n/a | n/a | n/a | - +------------------------------------------------------------------------------------------------------------------------+--------------------------+---------------------------+----------------------------------+-----------------------------+-------------+--------------------------+-------------+ - | :ref:`NCP with USB transport ` | 445 | 4 | 32 | 4 | 485 | 99 | 99 | - +------------------------------------------------------------------------------------------------------------------------+--------------------------+---------------------------+----------------------------------+-----------------------------+-------------+--------------------------+-------------+ - | :ref:`Zigbee application template ` | n/a | n/a | n/a | n/a | n/a | n/a | n/a | - +------------------------------------------------------------------------------------------------------------------------+--------------------------+---------------------------+----------------------------------+-----------------------------+-------------+--------------------------+-------------+ - | :ref:`Zigbee shell ` | n/a | n/a | n/a | n/a | n/a | n/a | n/a | - +------------------------------------------------------------------------------------------------------------------------+--------------------------+---------------------------+----------------------------------+-----------------------------+-------------+--------------------------+-------------+ - | :ref:`Zigbee shell over USB ` | 500 | 4 | 32 | 4 | 540 | 98 | 98 | - +------------------------------------------------------------------------------------------------------------------------+--------------------------+---------------------------+----------------------------------+-----------------------------+-------------+--------------------------+-------------+ - - .. group-tab:: nRF5340 - - The following table lists memory requirements for samples running on the `nRF5340 DK `_ (`nrf5340dk`_). - - +------------------------------------------------------------------------------------------------------------------------+--------------------------+---------------------------+----------------------------------+-----------------------------+-------------+--------------------------+-------------+ - | 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 | - +========================================================================================================================+==========================+===========================+==================================+=============================+=============+==========================+=============+ - | :ref:`Network coordinator ` | 361 | 0 | 32 | 4 | 397 | 90 | 90 | - +------------------------------------------------------------------------------------------------------------------------+--------------------------+---------------------------+----------------------------------+-----------------------------+-------------+--------------------------+-------------+ - | :ref:`Light bulb ` | 384 | 0 | 32 | 4 | 420 | 70 | 70 | - +------------------------------------------------------------------------------------------------------------------------+--------------------------+---------------------------+----------------------------------+-----------------------------+-------------+--------------------------+-------------+ - | :ref:`Light switch ` | 291 | 0 | 32 | 4 | 327 | 60 | 60 | - +------------------------------------------------------------------------------------------------------------------------+--------------------------+---------------------------+----------------------------------+-----------------------------+-------------+--------------------------+-------------+ - | :ref:`Light switch ` with :ref:`lib_zigbee_fota` | 307 | 64 | 32 | 4 | 407 | 74 | 74 | - +------------------------------------------------------------------------------------------------------------------------+--------------------------+---------------------------+----------------------------------+-----------------------------+-------------+--------------------------+-------------+ - | :ref:`Light switch ` with :ref:`zigbee_light_switch_sample_nus` | 355 | 0 | 32 | 4 | 391 | 76 | 76 | - +------------------------------------------------------------------------------------------------------------------------+--------------------------+---------------------------+----------------------------------+-----------------------------+-------------+--------------------------+-------------+ - | :ref:`Light switch ` with :ref:`zigbee_light_switch_sample_nus` and :ref:`lib_zigbee_fota` | n/a | n/a | n/a | n/a | n/a | n/a | n/a | - +------------------------------------------------------------------------------------------------------------------------+--------------------------+---------------------------+----------------------------------+-----------------------------+-------------+--------------------------+-------------+ - | :ref:`NCP ` | 384 | 0 | 32 | 4 | 420 | 97 | 97 | - +------------------------------------------------------------------------------------------------------------------------+--------------------------+---------------------------+----------------------------------+-----------------------------+-------------+--------------------------+-------------+ - | :ref:`NCP with USB transport ` | 401 | 64 | 32 | 4 | 501 | 106 | 106 | - +------------------------------------------------------------------------------------------------------------------------+--------------------------+---------------------------+----------------------------------+-----------------------------+-------------+--------------------------+-------------+ - | :ref:`Zigbee application template ` | 359 | 0 | 32 | 4 | 395 | 79 | 79 | - +------------------------------------------------------------------------------------------------------------------------+--------------------------+---------------------------+----------------------------------+-----------------------------+-------------+--------------------------+-------------+ - | :ref:`Zigbee shell ` | 440 | 0 | 32 | 4 | 476 | 96 | 96 | - +------------------------------------------------------------------------------------------------------------------------+--------------------------+---------------------------+----------------------------------+-----------------------------+-------------+--------------------------+-------------+ - | :ref:`Zigbee shell over USB ` | 458 | 0 | 32 | 4 | 494 | 105 | 105 | - +------------------------------------------------------------------------------------------------------------------------+--------------------------+---------------------------+----------------------------------+-----------------------------+-------------+--------------------------+-------------+ - - .. group-tab:: nRF54L05 - - The following table lists memory requirements for samples running on the `nRF54L05 emulation on the nRF54L15 DK `_ (`nrf54l15dk`_). - - +------------------------------------------------------------------------------------------------------------------------+--------------------------+---------------------------+----------------------------------+-----------------------------+-------------+--------------------------+-------------+ - | 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 | - +========================================================================================================================+==========================+===========================+==================================+=============================+=============+==========================+=============+ - | :ref:`Network coordinator ` | n/a | n/a | n/a | n/a | n/a | n/a | n/a | - +------------------------------------------------------------------------------------------------------------------------+--------------------------+---------------------------+----------------------------------+-----------------------------+-------------+--------------------------+-------------+ - | :ref:`Light bulb ` | n/a | n/a | n/a | n/a | n/a | n/a | n/a | - +------------------------------------------------------------------------------------------------------------------------+--------------------------+---------------------------+----------------------------------+-----------------------------+-------------+--------------------------+-------------+ - | :ref:`Light switch ` | n/a | n/a | n/a | n/a | n/a | n/a | n/a | - +------------------------------------------------------------------------------------------------------------------------+--------------------------+---------------------------+----------------------------------+-----------------------------+-------------+--------------------------+-------------+ - | :ref:`Light switch ` with :ref:`lib_zigbee_fota` | n/a | n/a | n/a | n/a | n/a | n/a | n/a | - +------------------------------------------------------------------------------------------------------------------------+--------------------------+---------------------------+----------------------------------+-----------------------------+-------------+--------------------------+-------------+ - | :ref:`Light switch ` with :ref:`zigbee_light_switch_sample_nus` | n/a | n/a | n/a | n/a | n/a | n/a | n/a | - +------------------------------------------------------------------------------------------------------------------------+--------------------------+---------------------------+----------------------------------+-----------------------------+-------------+--------------------------+-------------+ - | :ref:`NCP ` | 410 | 0 | 32 | 4 | 446 | 87 | 87 | - +------------------------------------------------------------------------------------------------------------------------+--------------------------+---------------------------+----------------------------------+-----------------------------+-------------+--------------------------+-------------+ - | :ref:`NCP with USB transport ` | n/a | n/a | n/a | n/a | n/a | n/a | n/a | - +------------------------------------------------------------------------------------------------------------------------+--------------------------+---------------------------+----------------------------------+-----------------------------+-------------+--------------------------+-------------+ - | :ref:`Zigbee application template ` | n/a | n/a | n/a | n/a | n/a | n/a | n/a | - +------------------------------------------------------------------------------------------------------------------------+--------------------------+---------------------------+----------------------------------+-----------------------------+-------------+--------------------------+-------------+ - | :ref:`Zigbee shell ` | n/a | n/a | n/a | n/a | n/a | n/a | n/a | - +------------------------------------------------------------------------------------------------------------------------+--------------------------+---------------------------+----------------------------------+-----------------------------+-------------+--------------------------+-------------+ - | :ref:`Zigbee shell over USB ` | n/a | n/a | n/a | n/a | n/a | n/a | n/a | - +------------------------------------------------------------------------------------------------------------------------+--------------------------+---------------------------+----------------------------------+-----------------------------+-------------+--------------------------+-------------+ - - .. group-tab:: nRF54L10 - - The following table lists memory requirements for samples running on the `nRF54L10 emulation on the nRF54L15 DK `_ (`nrf54l15dk`_). - - +------------------------------------------------------------------------------------------------------------------------+--------------------------+---------------------------+----------------------------------+-----------------------------+-------------+--------------------------+-------------+ - | 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 | - +========================================================================================================================+==========================+===========================+==================================+=============================+=============+==========================+=============+ - | :ref:`Network coordinator ` | 387 | 0 | 32 | 4 | 423 | 80 | 80 | - +------------------------------------------------------------------------------------------------------------------------+--------------------------+---------------------------+----------------------------------+-----------------------------+-------------+--------------------------+-------------+ - | :ref:`Light bulb ` | 411 | 0 | 32 | 4 | 447 | 60 | 60 | - +------------------------------------------------------------------------------------------------------------------------+--------------------------+---------------------------+----------------------------------+-----------------------------+-------------+--------------------------+-------------+ - | :ref:`Light switch ` | 317 | 0 | 32 | 4 | 353 | 50 | 50 | - +------------------------------------------------------------------------------------------------------------------------+--------------------------+---------------------------+----------------------------------+-----------------------------+-------------+--------------------------+-------------+ - | :ref:`Light switch ` with :ref:`lib_zigbee_fota` | 333 | 66 | 32 | 4 | 435 | 58 | 58 | - +------------------------------------------------------------------------------------------------------------------------+--------------------------+---------------------------+----------------------------------+-----------------------------+-------------+--------------------------+-------------+ - | :ref:`Light switch ` with :ref:`zigbee_light_switch_sample_nus` | 444 | 0 | 32 | 4 | 480 | 67 | 67 | - +------------------------------------------------------------------------------------------------------------------------+--------------------------+---------------------------+----------------------------------+-----------------------------+-------------+--------------------------+-------------+ - | :ref:`NCP ` | 410 | 0 | 32 | 4 | 446 | 87 | 87 | - +------------------------------------------------------------------------------------------------------------------------+--------------------------+---------------------------+----------------------------------+-----------------------------+-------------+--------------------------+-------------+ - | :ref:`NCP with USB transport ` | n/a | n/a | n/a | n/a | n/a | n/a | n/a | - +------------------------------------------------------------------------------------------------------------------------+--------------------------+---------------------------+----------------------------------+-----------------------------+-------------+--------------------------+-------------+ - | :ref:`Zigbee application template ` | 386 | 0 | 32 | 4 | 422 | 70 | 70 | - +------------------------------------------------------------------------------------------------------------------------+--------------------------+---------------------------+----------------------------------+-----------------------------+-------------+--------------------------+-------------+ - | :ref:`Zigbee shell ` | 465 | 0 | 32 | 4 | 501 | 86 | 86 | - +------------------------------------------------------------------------------------------------------------------------+--------------------------+---------------------------+----------------------------------+-----------------------------+-------------+--------------------------+-------------+ - | :ref:`Zigbee shell over USB ` | n/a | n/a | n/a | n/a | n/a | n/a | n/a | - +------------------------------------------------------------------------------------------------------------------------+--------------------------+---------------------------+----------------------------------+-----------------------------+-------------+--------------------------+-------------+ - - .. group-tab:: nRF54L15 - - The following table lists memory requirements for samples running on the `nRF54L15 DK `_ (`nrf54l15dk`_). - - +------------------------------------------------------------------------------------------------------------------------+--------------------------+---------------------------+----------------------------------+-----------------------------+-------------+--------------------------+-------------+ - | 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 | - +========================================================================================================================+==========================+===========================+==================================+=============================+=============+==========================+=============+ - | :ref:`Network coordinator ` | 387 | 0 | 32 | 4 | 423 | 80 | 80 | - +------------------------------------------------------------------------------------------------------------------------+--------------------------+---------------------------+----------------------------------+-----------------------------+-------------+--------------------------+-------------+ - | :ref:`Light bulb ` | 411 | 0 | 32 | 4 | 447 | 60 | 60 | - +------------------------------------------------------------------------------------------------------------------------+--------------------------+---------------------------+----------------------------------+-----------------------------+-------------+--------------------------+-------------+ - | :ref:`Light bulb ` with :ref:`zigbee_light_bulb_sample_matter` (debug) | 1055 | 56 | 32 | 4 | 1147 | 228 | 228 | - +------------------------------------------------------------------------------------------------------------------------+--------------------------+---------------------------+----------------------------------+-----------------------------+-------------+--------------------------+-------------+ - | :ref:`Light bulb ` with :ref:`zigbee_light_bulb_sample_matter` (release) | 962 | 56 | 32 | 4 | 1054 | 228 | 228 | - +------------------------------------------------------------------------------------------------------------------------+--------------------------+---------------------------+----------------------------------+-----------------------------+-------------+--------------------------+-------------+ - | :ref:`Light switch ` | 317 | 0 | 32 | 4 | 353 | 50 | 50 | - +------------------------------------------------------------------------------------------------------------------------+--------------------------+---------------------------+----------------------------------+-----------------------------+-------------+--------------------------+-------------+ - | :ref:`Light switch ` with :ref:`lib_zigbee_fota` | 333 | 66 | 32 | 4 | 435 | 58 | 58 | - +------------------------------------------------------------------------------------------------------------------------+--------------------------+---------------------------+----------------------------------+-----------------------------+-------------+--------------------------+-------------+ - | :ref:`Light switch ` with :ref:`zigbee_light_switch_sample_nus` | 444 | 0 | 32 | 4 | 480 | 67 | 67 | - +------------------------------------------------------------------------------------------------------------------------+--------------------------+---------------------------+----------------------------------+-----------------------------+-------------+--------------------------+-------------+ - | :ref:`Light switch ` with :ref:`zigbee_light_switch_sample_matter` (debug) | 927 | 56 | 32 | 4 | 1019 | 200 | 200 | - +------------------------------------------------------------------------------------------------------------------------+--------------------------+---------------------------+----------------------------------+-----------------------------+-------------+--------------------------+-------------+ - | :ref:`Light switch ` with :ref:`zigbee_light_switch_sample_matter` (release) | 834 | 56 | 32 | 4 | 926 | 200 | 200 | - +------------------------------------------------------------------------------------------------------------------------+--------------------------+---------------------------+----------------------------------+-----------------------------+-------------+--------------------------+-------------+ - | :ref:`NCP ` | 410 | 0 | 32 | 4 | 446 | 87 | 87 | - +------------------------------------------------------------------------------------------------------------------------+--------------------------+---------------------------+----------------------------------+-----------------------------+-------------+--------------------------+-------------+ - | :ref:`NCP with USB transport ` | n/a | n/a | n/a | n/a | n/a | n/a | n/a | - +------------------------------------------------------------------------------------------------------------------------+--------------------------+---------------------------+----------------------------------+-----------------------------+-------------+--------------------------+-------------+ - | :ref:`Zigbee application template ` | 386 | 0 | 32 | 4 | 422 | 70 | 70 | - +------------------------------------------------------------------------------------------------------------------------+--------------------------+---------------------------+----------------------------------+-----------------------------+-------------+--------------------------+-------------+ - | :ref:`Zigbee shell ` | 465 | 0 | 32 | 4 | 501 | 86 | 86 | - +------------------------------------------------------------------------------------------------------------------------+--------------------------+---------------------------+----------------------------------+-----------------------------+-------------+--------------------------+-------------+ - | :ref:`Zigbee shell over USB ` | n/a | n/a | n/a | n/a | n/a | n/a | n/a | - +------------------------------------------------------------------------------------------------------------------------+--------------------------+---------------------------+----------------------------------+-----------------------------+-------------+--------------------------+-------------+ - - .. group-tab:: nRF54LM20 - - The following table lists memory requirements for samples running on the `nRF54LM20 DK `_ (`nrf54lm20dk`_) with the ``nrf54lm20dk/nrf54lm20a/cpuapp`` or ``nrf54lm20dk/nrf54lm20b/cpuapp`` board targets. - - +------------------------------------------------------------------------------------------------------------------------+--------------------------+---------------------------+----------------------------------+-----------------------------+-------------+--------------------------+-------------+ - | 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 | - +========================================================================================================================+==========================+===========================+==================================+=============================+=============+==========================+=============+ - | :ref:`Network coordinator ` | 387 | 0 | 32 | 4 | 423 | 74 | 74 | - +------------------------------------------------------------------------------------------------------------------------+--------------------------+---------------------------+----------------------------------+-----------------------------+-------------+--------------------------+-------------+ - | :ref:`Light bulb ` | 413 | 0 | 32 | 4 | 449 | 64 | 64 | - +------------------------------------------------------------------------------------------------------------------------+--------------------------+---------------------------+----------------------------------+-----------------------------+-------------+--------------------------+-------------+ - | :ref:`Light bulb ` with :ref:`zigbee_light_bulb_sample_matter` (debug) | 1070 | 42 | 32 | 4 | 1148 | 228 | 228 | - +------------------------------------------------------------------------------------------------------------------------+--------------------------+---------------------------+----------------------------------+-----------------------------+-------------+--------------------------+-------------+ - | :ref:`Light bulb ` with :ref:`zigbee_light_bulb_sample_matter` (release) | 979 | 42 | 32 | 4 | 1057 | 228 | 228 | - +------------------------------------------------------------------------------------------------------------------------+--------------------------+---------------------------+----------------------------------+-----------------------------+-------------+--------------------------+-------------+ - | :ref:`Light switch ` | 315 | 0 | 32 | 4 | 351 | 44 | 44 | - +------------------------------------------------------------------------------------------------------------------------+--------------------------+---------------------------+----------------------------------+-----------------------------+-------------+--------------------------+-------------+ - | :ref:`Light switch ` with :ref:`lib_zigbee_fota` | 338 | 58 | 32 | 4 | 432 | 47 | 47 | - +------------------------------------------------------------------------------------------------------------------------+--------------------------+---------------------------+----------------------------------+-----------------------------+-------------+--------------------------+-------------+ - | :ref:`Light switch ` with :ref:`zigbee_light_switch_sample_nus` | 425 | 0 | 32 | 4 | 461 | 60 | 60 | - +------------------------------------------------------------------------------------------------------------------------+--------------------------+---------------------------+----------------------------------+-----------------------------+-------------+--------------------------+-------------+ - | :ref:`Light switch ` with :ref:`zigbee_light_switch_sample_nus` and :ref:`lib_zigbee_fota` | n/a | n/a | n/a | n/a | n/a | n/a | n/a | - +------------------------------------------------------------------------------------------------------------------------+--------------------------+---------------------------+----------------------------------+-----------------------------+-------------+--------------------------+-------------+ - | :ref:`Light switch ` with :ref:`zigbee_light_switch_sample_matter` (debug) | 940 | 42 | 32 | 4 | 1018 | 201 | 201 | - +------------------------------------------------------------------------------------------------------------------------+--------------------------+---------------------------+----------------------------------+-----------------------------+-------------+--------------------------+-------------+ - | :ref:`Light switch ` with :ref:`zigbee_light_switch_sample_matter` (release) | 849 | 42 | 32 | 4 | 927 | 201 | 201 | - +------------------------------------------------------------------------------------------------------------------------+--------------------------+---------------------------+----------------------------------+-----------------------------+-------------+--------------------------+-------------+ - | :ref:`NCP ` | 410 | 0 | 32 | 4 | 446 | 81 | 81 | - +------------------------------------------------------------------------------------------------------------------------+--------------------------+---------------------------+----------------------------------+-----------------------------+-------------+--------------------------+-------------+ - | :ref:`NCP with USB transport ` | 444 | 66 | 32 | 4 | 546 | 91 | 91 | - +------------------------------------------------------------------------------------------------------------------------+--------------------------+---------------------------+----------------------------------+-----------------------------+-------------+--------------------------+-------------+ - | :ref:`Zigbee application template ` | 385 | 0 | 32 | 4 | 421 | 63 | 63 | - +------------------------------------------------------------------------------------------------------------------------+--------------------------+---------------------------+----------------------------------+-----------------------------+-------------+--------------------------+-------------+ - | :ref:`Zigbee shell ` | 470 | 0 | 32 | 4 | 506 | 80 | 80 | - +------------------------------------------------------------------------------------------------------------------------+--------------------------+---------------------------+----------------------------------+-----------------------------+-------------+--------------------------+-------------+ - | :ref:`Zigbee shell over USB ` | 512 | 0 | 32 | 4 | 548 | 91 | 91 | - +------------------------------------------------------------------------------------------------------------------------+--------------------------+---------------------------+----------------------------------+-----------------------------+-------------+--------------------------+-------------+ + .. group-tab:: Charts + + .. tabs:: + + .. group-tab:: nRF52833 + + Memory requirements for samples running on the `nRF52833 DK `_ (`nrf52833dk`_). + + .. memory-board:: + :board: nrf52833 + + .. group-tab:: nRF52840 + + Memory requirements for samples running on the `nRF52840 DK `_ (`nrf52840dk`_). + + .. memory-board:: + :board: nrf52840 + + .. group-tab:: nRF52840 Dongle + + Memory requirements for samples running on the `nRF52840 Dongle DK `_ (`nrf52840dongle`_). + + .. memory-board:: + :board: nrf52840_dongle + + .. group-tab:: nRF5340 + + Memory requirements for samples running on the `nRF5340 DK `_ (`nrf5340dk`_). + + .. memory-board:: + :board: nrf5340 + + .. group-tab:: nRF54L05 + + Memory requirements for samples running on the `nRF54L05 emulation on the nRF54L15 DK `_ (`nrf54l15dk`_). + + .. memory-board:: + :board: nrf54l05 + + .. group-tab:: nRF54L10 + + Memory requirements for samples running on the `nRF54L10 emulation on the nRF54L15 DK `_ (`nrf54l15dk`_). + + .. memory-board:: + :board: nrf54l10 + + .. group-tab:: nRF54L15 + + Memory requirements for samples running on the `nRF54L15 DK `_ (`nrf54l15dk`_). + + .. memory-board:: + :board: nrf54l15 + + .. group-tab:: nRF54LM20 + + Memory requirements for samples running on the `nRF54LM20 DK `_ (`nrf54lm20dk`_) with the ``nrf54lm20dk/nrf54lm20a/cpuapp`` or ``nrf54lm20dk/nrf54lm20b/cpuapp`` board targets. + + .. memory-board:: + :board: nrf54lm20 + + .. group-tab:: Tables + + .. tabs:: + + .. group-tab:: nRF52833 + + The following table lists memory requirements for samples running on the `nRF52833 DK `_ (`nrf52833dk`_). + + .. memory-table:: + :board: nrf52833 + + .. group-tab:: nRF52840 + + The following table lists memory requirements for samples running on the `nRF52840 DK `_ (`nrf52840dk`_). + + .. memory-table:: + :board: nrf52840 + + .. group-tab:: nRF52840 Dongle + + The following table lists memory requirements for samples running on the `nRF52840 Dongle DK `_ (`nrf52840dongle`_). + + .. memory-table:: + :board: nrf52840_dongle + + .. group-tab:: nRF5340 + + The following table lists memory requirements for samples running on the `nRF5340 DK `_ (`nrf5340dk`_). + + .. memory-table:: + :board: nrf5340 + + .. group-tab:: nRF54L05 + + The following table lists memory requirements for samples running on the `nRF54L05 emulation on the nRF54L15 DK `_ (`nrf54l15dk`_). + + .. memory-table:: + :board: nrf54l05 + + .. group-tab:: nRF54L10 + + The following table lists memory requirements for samples running on the `nRF54L10 emulation on the nRF54L15 DK `_ (`nrf54l15dk`_). + + .. memory-table:: + :board: nrf54l10 + + .. group-tab:: nRF54L15 + + The following table lists memory requirements for samples running on the `nRF54L15 DK `_ (`nrf54l15dk`_). + + .. memory-table:: + :board: nrf54l15 + + .. group-tab:: nRF54LM20 + + The following table lists memory requirements for samples running on the `nRF54LM20 DK `_ (`nrf54lm20dk`_) with the ``nrf54lm20dk/nrf54lm20a/cpuapp`` or ``nrf54lm20dk/nrf54lm20b/cpuapp`` board targets. + + .. memory-table:: + :board: nrf54lm20 Stack memory requirements ************************* -The following table lists stack memory requirement values for ``main`` and ``zboss`` threads. +The following tables and bar charts list 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`` @@ -375,58 +252,66 @@ Values are provided in bytes (B). .. tabs:: - .. group-tab:: nRF52840 - - 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 | - +================================================================+===============================+==============================+================================+===============================+ - | :ref:`Network coordinator ` | 656 | 2048 | 3032 | 5120 | - +----------------------------------------------------------------+-------------------------------+------------------------------+--------------------------------+-------------------------------+ - | :ref:`Light bulb ` | 664 | 2048 | 3036 | 5120 | - +----------------------------------------------------------------+-------------------------------+------------------------------+--------------------------------+-------------------------------+ - | :ref:`Light switch ` | 728 | 2048 | 3008 | 5120 | - +----------------------------------------------------------------+-------------------------------+------------------------------+--------------------------------+-------------------------------+ - - .. group-tab:: nRF5340 - - The following table lists memory requirements for the `nRF5340 `_ device. - - +----------------------------------------------------------------+-------------------------------+------------------------------+--------------------------------+-------------------------------+ - | Sample | ``main`` thread stack usage | ``main`` thread stack size | ``zboss`` thread stack usage | ``zboss`` thread stack size | - +================================================================+===============================+==============================+================================+===============================+ - | :ref:`Network coordinator ` | 756 | 2048 | 1376 | 5120 | - +----------------------------------------------------------------+-------------------------------+------------------------------+--------------------------------+-------------------------------+ - | :ref:`Light bulb ` | 756 | 2048 | 1376 | 5120 | - +----------------------------------------------------------------+-------------------------------+------------------------------+--------------------------------+-------------------------------+ - | :ref:`Light switch ` | 760 | 2048 | 1376 | 5120 | - +----------------------------------------------------------------+-------------------------------+------------------------------+--------------------------------+-------------------------------+ - - .. group-tab:: nRF54L Series - - The following table lists memory requirements for the `nRF54L Series `_ devices. - - +----------------------------------------------------------------+-------------------------------+------------------------------+--------------------------------+-------------------------------+ - | Sample | ``main`` thread stack usage | ``main`` thread stack size | ``zboss`` thread stack usage | ``zboss`` thread stack size | - +================================================================+===============================+==============================+================================+===============================+ - | :ref:`Network coordinator ` | 840 | 2048 | 2312 | 5120 | - +----------------------------------------------------------------+-------------------------------+------------------------------+--------------------------------+-------------------------------+ - | :ref:`Light bulb ` | 840 | 2048 | 2112 | 5120 | - +----------------------------------------------------------------+-------------------------------+------------------------------+--------------------------------+-------------------------------+ - | :ref:`Light switch ` | 912 | 2048 | 2128 | 5120 | - +----------------------------------------------------------------+-------------------------------+------------------------------+--------------------------------+-------------------------------+ - - .. group-tab:: nRF54LM20 - - The following table lists stack usage for samples running on the `nRF54LM20 DK `_ with the ``nrf54lm20dk/nrf54lm20a/cpuapp`` or ``nrf54lm20dk/nrf54lm20b/cpuapp`` board target. - - +----------------------------------------------------------------+-------------------------------+------------------------------+--------------------------------+-------------------------------+ - | Sample | ``main`` thread stack usage | ``main`` thread stack size | ``zboss`` thread stack usage | ``zboss`` thread stack size | - +================================================================+===============================+==============================+================================+===============================+ - | :ref:`Network coordinator ` | 832 | 2048 | 2288 | 5120 | - +----------------------------------------------------------------+-------------------------------+------------------------------+--------------------------------+-------------------------------+ - | :ref:`Light bulb ` | 912 | 2048 | 2104 | 5120 | - +----------------------------------------------------------------+-------------------------------+------------------------------+--------------------------------+-------------------------------+ - | :ref:`Light switch ` | 984 | 2048 | 2104 | 5120 | - +----------------------------------------------------------------+-------------------------------+------------------------------+--------------------------------+-------------------------------+ + .. group-tab:: Charts + + .. tabs:: + + .. group-tab:: nRF52840 + + Stack usage for samples running on the `nRF52840 DK `_ (`nrf52840dk`_). + + .. stack-board:: + :board: nrf52840 + + .. group-tab:: nRF5340 + + Stack usage for samples running on the `nRF5340 DK `_ (`nrf5340dk`_). + + .. stack-board:: + :board: nrf5340 + + .. group-tab:: nRF54L15 + + Stack usage for samples running on the `nRF54L15 DK `_ (`nrf54l15dk`_). + + .. stack-board:: + :board: nrf54l15 + + .. group-tab:: nRF54LM20 + + Stack usage for samples running on the `nRF54LM20 DK `_ (`nrf54lm20dk`_) with the ``nrf54lm20dk/nrf54lm20a/cpuapp`` or ``nrf54lm20dk/nrf54lm20b/cpuapp`` board targets. + + .. stack-board:: + :board: nrf54lm20 + + .. group-tab:: Tables + + .. tabs:: + + .. group-tab:: nRF52840 + + The following table lists stack usage for samples running on the `nRF52840 DK `_ (`nrf52840dk`_). + + .. stack-table:: + :board: nrf52840 + + .. group-tab:: nRF5340 + + The following table lists stack usage for samples running on the `nRF5340 DK `_ (`nrf5340dk`_). + + .. stack-table:: + :board: nrf5340 + + .. group-tab:: nRF54L15 + + The following table lists stack usage for samples running on the `nRF54L15 DK `_ (`nrf54l15dk`_). + + .. stack-table:: + :board: nrf54l15 + + .. group-tab:: nRF54LM20 + + The following table lists stack usage for samples running on the `nRF54LM20 DK `_ (`nrf54lm20dk`_) with the ``nrf54lm20dk/nrf54lm20a/cpuapp`` or ``nrf54lm20dk/nrf54lm20b/cpuapp`` board targets. + + .. stack-table:: + :board: nrf54lm20