Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion boot/bootutil/src/loader.c
Original file line number Diff line number Diff line change
Expand Up @@ -825,11 +825,14 @@ boot_validate_slot(struct boot_loader_state *state, int slot,
check_addresses = true;
} else
#endif
#ifdef MCUBOOT_IS_SECOND_STAGE
if (IMAGE_IS_SECOND_STAGE_MCUBOOT(state)) {
min_addr = SECOND_STAGE_INACTIVE_MCUBOOT_OFFSET;
max_addr = (SECOND_STAGE_INACTIVE_MCUBOOT_OFFSET + SECOND_STAGE_INACTIVE_MCUBOOT_SIZE);
check_addresses = true;
} else if (BOOT_CURR_IMG(state) == CONFIG_MCUBOOT_APPLICATION_IMAGE_NUMBER) {
} else
#endif
if (BOOT_CURR_IMG(state) == CONFIG_MCUBOOT_APPLICATION_IMAGE_NUMBER) {
min_addr = flash_area_get_off(BOOT_IMG_AREA(state, BOOT_SLOT_PRIMARY));
max_addr = flash_area_get_size(BOOT_IMG_AREA(state, BOOT_SLOT_PRIMARY)) + min_addr;

Expand Down
21 changes: 21 additions & 0 deletions boot/zephyr/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -841,3 +841,24 @@ if(SYSBUILD AND CONFIG_PCD_APP)
set(RAM_FLASH_ADDR "${ram_flash_addr}" CACHE STRING "" FORCE)
set(RAM_FLASH_SIZE "${ram_flash_size}" CACHE STRING "" FORCE)
endif()

if(NOT CONFIG_PARTITION_MANAGER_ENABLED AND CONFIG_SOC_NRF5340_CPUAPP)
if(CONFIG_MCUBOOT_NETWORK_CORE_IMAGE_NUMBER AND NOT CONFIG_MCUBOOT_NETWORK_CORE_IMAGE_NUMBER EQUAL -1)
if(NOT TARGET b0n_target)
add_custom_target(b0n_target)
zephyr_dt_import(EDT_PICKLE_FILE ${CMAKE_BINARY_DIR}/../b0n/zephyr/edt.pickle TARGET b0n_target)
endif()
# Really this dependency if set for MCUboot, but it will also cover s1 image,
# since contition that let us here checks for `CONFIG_MCUBOOT` which is only
# set for MCUboot builds.
add_dependencies(${TARGET_NAME} b0n_target)

dt_nodelabel(s0_partition_path NODELABEL s0_partition REQUIRED TARGET b0n_target)
dt_reg_addr(s0_partition_address PATH ${s0_partition_path} TARGET b0n_target)
dt_reg_size(s0_partition_size PATH ${s0_partition_path} TARGET b0n_target)
# Using same identifiers as nrf5340 hooks use, as they represnt the same
# information in hooks.
zephyr_compile_definitions("PCD_NET_CORE_APP_ADDRESS=${s0_partition_address}")
zephyr_compile_definitions("PCD_NET_CORE_APP_SIZE=${s0_partition_size}")
endif()
endif()
7 changes: 7 additions & 0 deletions boot/zephyr/include/sysflash/sysflash.h
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,13 @@
#define SPI_FLASH_0_ID 1
#endif

/* Support for NETCPU application image updates */
#if CONFIG_MCUBOOT_NETWORK_CORE_IMAGE_NUMBER != -1
#define NETCPU_APP_SLOT_OFFSET PCD_NET_CORE_APP_ADDRESS
#define NETCPU_APP_SLOT_SIZE PCD_NET_CORE_APP_SIZE
#define NETCPU_APP_SLOT_END (NETCPU_APP_SLOT_OFFSET + NETCPU_APP_SLOT_SIZE)
#endif

/* This is workaround because of bootutil public interface also requiring this
* file. In reality application is supposed to maintain flash area access,
* but bootutil uses own definitions, taken directly from DTS, which includes
Expand Down
Loading