Skip to content

Commit 3907963

Browse files
committed
Revert "[nrf noup] mgmt: mcumgr: Fix nRF5340 network core hook"
This reverts commit b856d4e. Signed-off-by: Tomasz Chyrowicz <[email protected]>
1 parent b58d2f8 commit 3907963

File tree

4 files changed

+19
-19
lines changed

4 files changed

+19
-19
lines changed

subsys/mgmt/mcumgr/CMakeLists.txt

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,10 @@ add_subdirectory_ifdef(CONFIG_SMP_CLIENT smp_client)
1717

1818
zephyr_library_link_libraries(mgmt_mcumgr)
1919

20-
if(CONFIG_MCUMGR_GRP_IMG_NRF5340_BOOTUTIL_HOOK)
21-
zephyr_include_directories(
22-
${ZEPHYR_MCUBOOT_MODULE_DIR}/boot/bootutil/include
23-
${ZEPHYR_MCUBOOT_MODULE_DIR}/boot/zephyr/include
24-
)
25-
26-
zephyr_library_sources(bootutil_hooks/nrf53_hooks.c)
20+
if (CONFIG_BOOT_IMAGE_ACCESS_HOOKS)
21+
zephyr_include_directories(
22+
${ZEPHYR_MCUBOOT_MODULE_DIR}/boot/bootutil/include
23+
${ZEPHYR_MCUBOOT_MODULE_DIR}/boot/zephyr/include
24+
)
25+
zephyr_library_sources(bootutil_hooks/nrf53_hooks.c)
2726
endif()

subsys/mgmt/mcumgr/Kconfig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ menuconfig MCUMGR
66
bool "mcumgr Support"
77
depends on NET_BUF
88
depends on ZCBOR
9-
imply BOOT_IMAGE_ACCESS_HOOKS if SOC_NRF5340_CPUAPP && MCUMGR_GRP_IMG && MCUBOOT_NETWORK_CORE_IMAGE_NUMBER > -1
9+
imply BOOT_IMAGE_ACCESS_HOOKS if (SOC_NRF5340_CPUAPP_QKAA && MCUMGR_GRP_IMG)
1010
help
1111
This option enables the mcumgr management library.
1212

subsys/mgmt/mcumgr/bootutil_hooks/nrf53_hooks.c

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,19 @@
88
#include <zephyr/device.h>
99
#include "bootutil/bootutil_public.h"
1010

11-
int boot_read_swap_state_primary_slot_hook(int image_index, struct boot_swap_state *state)
11+
#if CONFIG_MCUBOOT_NETWORK_CORE_IMAGE_NUMBER != -1
12+
/* Sysbuild */
13+
#define NET_CORE_IMAGE CONFIG_MCUBOOT_NETWORK_CORE_IMAGE_NUMBER
14+
#else
15+
/* Legacy child/parent */
16+
#define NET_CORE_IMAGE 1
17+
#endif
18+
19+
int boot_read_swap_state_primary_slot_hook(int image_index,
20+
struct boot_swap_state *state)
1221
{
13-
if (image_index == CONFIG_MCUBOOT_NETWORK_CORE_IMAGE_NUMBER) {
14-
/* Pretend that primary slot of the network core update image is unpopulated */
22+
if (image_index == NET_CORE_IMAGE) {
23+
/* Pretend that primary slot of image 1 unpopulated */
1524
state->magic = BOOT_MAGIC_UNSET;
1625
state->swap_type = BOOT_SWAP_TYPE_NONE;
1726
state->image_num = image_index;

subsys/mgmt/mcumgr/grp/img_mgmt/Kconfig

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -245,14 +245,6 @@ config MCUMGR_GRP_IMG_QSPI_XIP_SPLIT_IMAGE
245245
sysbuild if needed. This enables selecting the correct slot when running a QSPI XIP
246246
split image application in DirectXIP mode.
247247

248-
config MCUMGR_GRP_IMG_NRF5340_BOOTUTIL_HOOK
249-
bool "nRF5340 network core bootutil hook"
250-
depends on SOC_NRF5340_CPUAPP && BOOT_IMAGE_ACCESS_HOOKS && MCUBOOT_NETWORK_CORE_IMAGE_NUMBER > -1
251-
default y
252-
help
253-
This option will enable a bootutil hook that populates the network core update image
254-
slot with dummy data to allow for uploading a firmware update to the network core.
255-
256248
module = MCUMGR_GRP_IMG
257249
module-str = mcumgr_grp_img
258250
source "subsys/logging/Kconfig.template.log_config"

0 commit comments

Comments
 (0)