From fddcf70d57d0b941ec40877c3e142eefb81e02cf Mon Sep 17 00:00:00 2001 From: Jamie McCrae Date: Fri, 9 Jan 2026 09:57:10 +0000 Subject: [PATCH] snippets: Add slot1-partition snippet Adds a snippet which sets the chosen code partition to slot1_partition, which can be used with things like MCUboot Signed-off-by: Jamie McCrae --- snippets/slot1-partition/README.rst | 24 +++++++++++++++++++ .../slot1-partition/slot1-partition.overlay | 5 ++++ snippets/slot1-partition/snippet.yml | 3 +++ 3 files changed, 32 insertions(+) create mode 100644 snippets/slot1-partition/README.rst create mode 100644 snippets/slot1-partition/slot1-partition.overlay create mode 100644 snippets/slot1-partition/snippet.yml diff --git a/snippets/slot1-partition/README.rst b/snippets/slot1-partition/README.rst new file mode 100644 index 00000000000..89cee1172c5 --- /dev/null +++ b/snippets/slot1-partition/README.rst @@ -0,0 +1,24 @@ +.. _snippet-slot1-partition: + +Slot1 partition snippet (slot1-partition) +######################################### + +.. code-block:: console + + west build -S slot1-partition [...] + +Overview +******** + +This snippet changes the chosen flash partition to be the ``slot1_partition`` node, this can be +used to build for the alternate slot in MCUboot direct-xip or firmware loader modes. + +Requirements +************ + +Partition mapping correct setup in devicetree, for example: + +.. literalinclude:: ../../dts/vendor/nordic/nrf52840_partition.dtsi + :language: dts + :dedent: + :lines: 15- diff --git a/snippets/slot1-partition/slot1-partition.overlay b/snippets/slot1-partition/slot1-partition.overlay new file mode 100644 index 00000000000..eba132c978b --- /dev/null +++ b/snippets/slot1-partition/slot1-partition.overlay @@ -0,0 +1,5 @@ +/ { + chosen { + zephyr,code-partition = &slot1_partition; + }; +}; diff --git a/snippets/slot1-partition/snippet.yml b/snippets/slot1-partition/snippet.yml new file mode 100644 index 00000000000..1be2b7d1d5d --- /dev/null +++ b/snippets/slot1-partition/snippet.yml @@ -0,0 +1,3 @@ +name: slot1-partition +append: + EXTRA_DTC_OVERLAY_FILE: slot1-partition.overlay