Skip to content

Commit 58088c0

Browse files
committed
[nrf noup] zephyr: Keep boot preference after reboot
Add a possibility to keep the boot preference value between device resets. Ref: NCSDK-35479 Signed-off-by: Tomasz Chyrowicz <[email protected]>
1 parent 19c0a68 commit 58088c0

File tree

6 files changed

+886
-306
lines changed

6 files changed

+886
-306
lines changed

boot/bootutil/include/bootutil/boot_request.h

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,10 @@ bool boot_request_detect_firmware_loader(void);
9393
int boot_request_init(void);
9494

9595
/**
96-
* @brief Clear/drop all requests.
96+
* @brief Clear boot requests.
97+
*
98+
* @details If the CONFIG_NRF_MCUBOOT_BOOT_REQUEST_PREFERENCE_KEEP option is
99+
* enabled, all requests, except the preferred slot requests, are cleared.
97100
*
98101
* @return 0 if successful, negative error code otherwise.
99102
*/

boot/bootutil/zephyr/CMakeLists.txt

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,15 @@ zephyr_library_sources(
1717
../src/bootutil_public.c
1818
)
1919
if(CONFIG_NRF_MCUBOOT_BOOT_REQUEST)
20+
zephyr_library_sources(
21+
src/boot_request.c
22+
)
2023
zephyr_library_sources_ifdef(CONFIG_NRF_MCUBOOT_BOOT_REQUEST_IMPL_RETENTION
2124
src/boot_request_retention.c
2225
)
26+
zephyr_library_sources_ifdef(CONFIG_NRF_MCUBOOT_BOOT_REQUEST_IMPL_FLASH
27+
src/boot_request_flash.c
28+
)
2329
endif()
2430
zephyr_library_sources_ifdef(CONFIG_NCS_MCUBOOT_MANIFEST_UPDATES
2531
../src/mcuboot_manifest.c

0 commit comments

Comments
 (0)