File tree Expand file tree Collapse file tree 3 files changed +38
-0
lines changed Expand file tree Collapse file tree 3 files changed +38
-0
lines changed Original file line number Diff line number Diff line change 1+ #
2+ # Copyright (c) 2025 Nordic Semiconductor ASA
3+ #
4+ # SPDX-License-Identifier: LicenseRef-Nordic-5-Clause
5+ #
6+
7+ function (setup_bootconf_data)
8+ add_custom_target (bootconf_target
9+ ALL
10+ DEPENDS ${CMAKE_BINARY_DIR} /bootconf.hex
11+ )
12+
13+ dt_nodelabel(boot_partition_node_full_path NODELABEL "boot_partition" )
14+ dt_reg_size(boot_partition_node_size PATH "${boot_partition_node_full_path} " )
15+ if (${boot_partition_node_size} GREATER 0x7c00)
16+ message (WARNING "boot_partition doesn't fit into protection region.
17+ Protection will be applied over maximum allowed span." )
18+ endif ()
19+
20+ add_custom_command (OUTPUT ${CMAKE_BINARY_DIR} /bootconf.hex
21+ COMMAND ${Python3_EXECUTABLE}
22+ ${ZEPHYR_NRF_MODULE_DIR} /scripts/reglock.py
23+ --output ${CMAKE_BINARY_DIR} /bootconf.hex
24+ --size ${boot_partition_node_size}
25+ VERBATIM
26+ )
27+
28+ endfunction ()
29+
30+ setup_bootconf_data()
Original file line number Diff line number Diff line change @@ -9,4 +9,5 @@ include(${ZEPHYR_NRF_MODULE_DIR}/modules/mcuboot/CMakeLists.txt)
99if (CONFIG_MCUBOOT AND CONFIG_NCS_BM)
1010 include (${ZEPHYR_NRF_BM_MODULE_DIR} /cmake/image_signing_softdevice.cmake)
1111 include (${ZEPHYR_NRF_BM_MODULE_DIR} /cmake/flash_metadata.cmake)
12+ include (${ZEPHYR_NRF_BM_MODULE_DIR} /cmake/sysbuild/bootconf.cmake)
1213endif ()
Original file line number Diff line number Diff line change @@ -84,6 +84,13 @@ config BM_BOOT_IMG_HASH_ALG_PURE
8484
8585endchoice
8686
87+ config BM_BOOT_BOOTCONF_LOCK_WRITES
88+ bool "Protect bootloader's NVM from writes"
89+ depends on SOC_NRF54L15_CPUAPP || SOC_NRF54L05_CPUAPP || SOC_NRF54L10_CPUAPP
90+ default y
91+ help
92+ Sets RRAMC's BOOTCONF region protection to disable writes.
93+
8794endmenu
8895
8996endif # BM_BOOTLOADER_MCUBOOT
You can’t perform that action at this time.
0 commit comments