Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[nrf noup] Remove support for nRF54H20 #564

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
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
22 changes: 0 additions & 22 deletions config/nrfconnect/chip-module/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -52,15 +52,9 @@ config CHIP_NFC_COMMISSIONING

choice CHIP_BOOTLOADER
prompt "Bootloader implementation for Matter purposes"
default CHIP_BOOTLOADER_SUIT if SOC_SERIES_NRF54HX
default CHIP_BOOTLOADER_MCUBOOT if !BOARD_NRF21540DK
default CHIP_BOOTLOADER_NONE

config CHIP_BOOTLOADER_SUIT
bool "SUIT for Matter purposes"
imply SUIT
imply SSF_SUIT_SERVICE_ENABLED

config CHIP_BOOTLOADER_MCUBOOT
bool "MCUBOOT for Matter Bootloader purpose"
imply BOOTLOADER_MCUBOOT
Expand All @@ -71,23 +65,12 @@ config CHIP_BOOTLOADER_NONE

endchoice

if CHIP_BOOTLOADER_SUIT
choice SUIT_DFU_CANDIDATE_PROCESSING_LEVEL
default SUIT_DFU_CANDIDATE_PROCESSING_PUSH_TO_CACHE
endchoice
endif # CHIP_BOOTLOADER_SUIT

config CHIP_DFU_LIBRARY_MCUMGR
bool "Use mcumgr library for Matter DFU purposes"
# MCUBOOT
select MCUMGR_GRP_IMG if CHIP_BOOTLOADER_MCUBOOT
select MCUMGR_GRP_OS if CHIP_BOOTLOADER_MCUBOOT
select MCUMGR_GRP_IMG_STATUS_HOOKS if CHIP_BOOTLOADER_MCUBOOT
# SUIT
select MGMT_SUITFU if CHIP_BOOTLOADER_SUIT
select MGMT_SUITFU_GRP_SUIT if CHIP_BOOTLOADER_SUIT
select MCUMGR_SMP_LEGACY_RC_BEHAVIOUR if CHIP_BOOTLOADER_SUIT
select MGMT_SUITFU_GRP_SUIT_CACHE_RAW_UPLOAD if CHIP_BOOTLOADER_SUIT
# COMMON
select MCUMGR
imply STREAM_FLASH
Expand All @@ -96,11 +79,6 @@ config CHIP_DFU_LIBRARY_MCUMGR
config CHIP_DFU_LIBRARY_DFU_TARGET
bool "Use dfu target library for Matter DFU purposes"
imply DFU_MULTI_IMAGE
# SUIT
imply DFU_TARGET_SUIT if CHIP_BOOTLOADER_SUIT
# Initialize SUIT dfu by dfu target if not using mcumgr.
# If using mcumgr, SUIT dfu is initialized by mcumgr.
imply DFU_TARGET_SUIT_INITIALIZE_SUIT if (!CHIP_DFU_LIBRARY_MCUMGR && CHIP_BOOTLOADER_SUIT)
# COMMON
imply DFU_TARGET
imply STREAM_FLASH
Expand Down
3 changes: 1 addition & 2 deletions config/nrfconnect/chip-module/Kconfig.defaults
Original file line number Diff line number Diff line change
Expand Up @@ -242,11 +242,10 @@ config BOOT_IMAGE_ACCESS_HOOKS

config UPDATEABLE_IMAGE_NUMBER
default 3 if NRF_WIFI_PATCHES_EXT_FLASH_STORE
default 2 if SOC_SERIES_NRF53X || CHIP_BOOTLOADER_SUIT
default 2 if SOC_SERIES_NRF53X

config DFU_MULTI_IMAGE_MAX_IMAGE_COUNT
default 3 if NRF_WIFI_PATCHES_EXT_FLASH_STORE
default 2 if CHIP_BOOTLOADER_SUIT

config NRF_WIFI_FW_PATCH_DFU
default y if NRF_WIFI_PATCHES_EXT_FLASH_STORE
Expand Down
6 changes: 1 addition & 5 deletions config/nrfconnect/chip-module/generate_factory_data.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -205,11 +205,7 @@ if(CONFIG_CHIP_FACTORY_DATA_MERGE_WITH_FIRMWARE)
set_property(GLOBAL PROPERTY factory_data_PM_TARGET factory_data)
else()
set_property(GLOBAL APPEND PROPERTY HEX_FILES_TO_MERGE ${OUTPUT_FILE_PATH}/factory_data.hex ${OUTPUT_FILE_PATH}/zephyr.hex)
if(NOT CONFIG_SOC_SERIES_NRF54HX)
# Do not overwrite runners while using nRF54H series.
# In this case we need to rely on SUIT mechanisms.
set_property(TARGET runners_yaml_props_target PROPERTY hex_file ${OUTPUT_FILE_PATH}/merged.hex)
endif()
set_property(TARGET runners_yaml_props_target PROPERTY hex_file ${OUTPUT_FILE_PATH}/merged.hex)
endif()
endif()

Expand Down
21 changes: 1 addition & 20 deletions src/platform/nrfconnect/OTAImageProcessorImpl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -35,12 +35,9 @@

#include <dfu/dfu_target.h>

#ifdef CONFIG_DFU_TARGET_SUIT
#include <dfu/dfu_target_suit.h>
#else
#include <dfu/dfu_target_mcuboot.h>
#include <zephyr/dfu/mcuboot.h>
#endif

#include <dfu/dfu_multi_image.h>

#include <zephyr/logging/log.h>
Expand Down Expand Up @@ -96,27 +93,15 @@ CHIP_ERROR OTAImageProcessorImpl::PrepareDownloadImpl()
{
mHeaderParser.Init();
mParams = {};
#ifdef CONFIG_DFU_TARGET_SUIT
ReturnErrorOnFailure(System::MapErrorZephyr(dfu_target_suit_set_buf(mBuffer, sizeof(mBuffer))));
#else
ReturnErrorOnFailure(System::MapErrorZephyr(dfu_target_mcuboot_set_buf(mBuffer, sizeof(mBuffer))));
#endif // CONFIG_DFU_TARGET_SUIT
ReturnErrorOnFailure(System::MapErrorZephyr(dfu_multi_image_init(mBuffer, sizeof(mBuffer))));

for (int image_id = 0; image_id < CONFIG_UPDATEABLE_IMAGE_NUMBER; ++image_id)
{
dfu_image_writer writer;

#ifdef CONFIG_DFU_TARGET_SUIT
// The first image is the SUIT manifest and must be placed in id=0, while all other images must be placed in id + 1,
// because id=1 is dedicated for internal DFU purposes when the SUIT manifest contains the firmware.
// In our case, we use cache processing, so we need to put firmware images starting from id=2.
writer.image_id = image_id == 0 ? image_id : image_id + 1;
writer.open = [](int id, size_t size) { return dfu_target_init(DFU_TARGET_IMAGE_TYPE_SUIT, id, size, nullptr); };
#else
writer.image_id = image_id;
writer.open = [](int id, size_t size) { return dfu_target_init(DFU_TARGET_IMAGE_TYPE_MCUBOOT, id, size, nullptr); };
#endif
writer.write = [](const uint8_t * chunk, size_t chunk_size) { return dfu_target_write(chunk, chunk_size); };
writer.close = [](bool success) { return success ? dfu_target_done(success) : dfu_target_reset(); };

Expand Down Expand Up @@ -181,11 +166,7 @@ CHIP_ERROR OTAImageProcessorImpl::Apply()
[](System::Layer *, void * /* context */) {
PlatformMgr().HandleServerShuttingDown();
k_msleep(CHIP_DEVICE_CONFIG_SERVER_SHUTDOWN_ACTIONS_SLEEP_MS);
#ifdef CONFIG_DFU_TARGET_SUIT
dfu_target_suit_reboot();
#else
Reboot(SoftwareRebootReason::kSoftwareUpdate);
#endif
},
nullptr /* context */);
}
Expand Down
4 changes: 0 additions & 4 deletions src/platform/nrfconnect/OTAImageProcessorImpl.h
Original file line number Diff line number Diff line change
Expand Up @@ -58,10 +58,6 @@ class OTAImageProcessorImpl : public OTAImageProcessorInterface
private:
bool mImageConfirmed = false;
uint32_t mDfuSyncMutexId;

#ifdef CONFIG_SUIT
bool mDfuTargetSuitInitialized = false;
#endif
};

} // namespace DeviceLayer
Expand Down
Loading