You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: samples/dfu/ab/README.rst
+68Lines changed: 68 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -42,6 +42,71 @@ The sample supports the following MCUmgr transports by default:
42
42
* Bluetooth
43
43
* Serial (UART)
44
44
45
+
A/B functionality
46
+
=================
47
+
48
+
When the A/B functionality is used, the device has two slots for the application: slot A and slot B.
49
+
The slots are equivalent, and the device can boot from either of them.
50
+
In the case of MCUboot, this is achieved by using the Direct XIP feature.
51
+
Thus, note that the terms slot 0, primary slot, slot A and slot 1, secondary slot, slot B are used interchangeably throughout the documentation.
52
+
This configuration allows a background update of the non-active slot while the application runs from the active slot.
53
+
After the update is complete, the device can quickly switch to the updated slot on the next reboot.
54
+
55
+
The following conditions decide which slot will be booted (active) on the next reboot:
56
+
57
+
1. If one of the slots is not valid, the other slot is selected as active.
58
+
#. If both slots are valid, the slot marked as "preferred" is selected as active.
59
+
#. If both slots are valid and none is marked as "preferred," the slot with the higher version number is selected as active.
60
+
#. If none of the above conditions is met, slot A is selected as active.
61
+
62
+
You can set the preferred slot using the ``boot_request_set_preferred_slot`` function.
63
+
Currently, this only sets the boot preference for a single reboot.
64
+
65
+
Identifying the active slot
66
+
---------------------------
67
+
68
+
If the project uses the Partition Manager, the currently running slot can be identified by checking if ``CONFIG_NCS_IS_VARIANT_IMAGE`` is defined.
69
+
If it is defined, the application is running from slot B.
70
+
Otherwise, it is running from slot A.
71
+
72
+
If the project does not use the Partition Manager (a configuration currently only supported on the nRF54H20), the currently running slot can be identified by comparing the address pointed `zephyr,code-partition` to specific node addresses defined in the device tree.
73
+
The following node partitions are used by default:
74
+
75
+
* ``slot0_partition`` - Application core, slot A
76
+
* ``slot1_partition`` - Application core, slot B
77
+
* ``cpurad_slot0_partition`` - Radio core, slot A
78
+
* ``cpurad_slot1_partition`` - Radio core, slot B
79
+
80
+
For example, verifying that the application is running from slot A can be done by using the following macro:
0 commit comments