From 665b320c2ccf2f8e33c9e82e8ed85f3d4df028da Mon Sep 17 00:00:00 2001 From: Jaafar BEN YOUNES Date: Fri, 23 Aug 2024 14:17:10 +0200 Subject: [PATCH] [NXP] [rt1060] OTA requestor enablement on RT1060-EVKC+Firecrest --- .../all-clusters-app/nxp/rt/rt1060/BUILD.gn | 26 ++++++++----------- src/platform/nxp/rt/rt1060/BUILD.gn | 2 -- src/platform/nxp/rt/rt1060/args.gni | 12 +++++++-- 3 files changed, 21 insertions(+), 19 deletions(-) diff --git a/examples/all-clusters-app/nxp/rt/rt1060/BUILD.gn b/examples/all-clusters-app/nxp/rt/rt1060/BUILD.gn index 43da4bcf32e7bf..b0117619cb581b 100644 --- a/examples/all-clusters-app/nxp/rt/rt1060/BUILD.gn +++ b/examples/all-clusters-app/nxp/rt/rt1060/BUILD.gn @@ -177,20 +177,12 @@ rt_executable("all_cluster_app") { ] } - if (chip_enable_ota_requestor) { - sources += [ - "${common_example_dir}/ota_requestor/source/OTARequestorInitiator.cpp", - "${common_example_dir}/ota_requestor/source/OTARequestorInitiatorCommon.cpp", - "${chip_root}/examples/platform/nxp/common/mcuboot_app_support/flash_partitioning.h", - - #Adding mcuboot files - "${chip_root}/examples/platform/nxp/common/mcuboot_app_support/mcuboot_app_support.c", - "${chip_root}/examples/platform/nxp/common/mcuboot_app_support/mcuboot_app_support.h", - ] - include_dirs += [ - "$${common_example_dir}/ota_requestor/include", - "${chip_root}/examples/platform/nxp/common/mcuboot_app_support", - ] + if (chip_enable_ota_requestor) { + include_dirs += ["${common_example_dir}/ota_requestor/include"] + sources += [ + "${common_example_dir}/ota_requestor/source/OTARequestorInitiator.cpp", + "${common_example_dir}/ota_requestor/source/OTARequestorInitiatorCommon.cpp", + ] } if (wifi_auto_connect_at_boot) { @@ -256,6 +248,10 @@ rt_executable("all_cluster_app") { "-Wl,--no-warn-rwx-segments", ] + if (evkname == "evkcmimxrt1060"){ + ldflags += [ "-Wl,--defsym=gEVKCFlashSize_d=0x1000000" ] + } + if (enable_ota_provider) { # As the OTA file will be stored in the littlefs file system, it is required to increase the size of the file system # To be able to store an OTA file with a MAX size of 640K, @@ -270,7 +266,7 @@ rt_executable("all_cluster_app") { # we would need to reserve enough space for the bootloader (MCUBoot) # MCUBoot requires 0x11000 Bytes to be reserved at the base of the flash # Consequently, some sections will need to be shifted - ldflags += [ "-Wl,--defsym=__mcu_boot_size__=0x11000" ] + ldflags += [ "-Wl,--defsym=__m_mcuboot_size__=0x40000" ] } output_dir = root_out_dir diff --git a/src/platform/nxp/rt/rt1060/BUILD.gn b/src/platform/nxp/rt/rt1060/BUILD.gn index 4a701b99ba5a4d..b92d080d172309 100644 --- a/src/platform/nxp/rt/rt1060/BUILD.gn +++ b/src/platform/nxp/rt/rt1060/BUILD.gn @@ -116,8 +116,6 @@ static_library("nxp_platform") { "../../common/OTAImageProcessorImpl.cpp", "../../common/OTAImageProcessorImpl.h", ] - include_dirs = - [ "${chip_root}/examples/platform/nxp/common/mcuboot_app_support/" ] } if (chip_enable_openthread) { diff --git a/src/platform/nxp/rt/rt1060/args.gni b/src/platform/nxp/rt/rt1060/args.gni index 966e7cc464be8a..b5fe5340f8ff38 100644 --- a/src/platform/nxp/rt/rt1060/args.gni +++ b/src/platform/nxp/rt/rt1060/args.gni @@ -35,12 +35,20 @@ chip_build_tests = false #This enables the EventList global attribute enable_eventlist_attribute = true -mbedtls_target = "${nxp_sdk_build_root}:nxp_mbedtls" - +# TODO : Enable the OTA Requestor by default. +# This requires the mcuboot bootloader to be used, which reserves the first 256 kB of the flash. +# If mcuboot is not used, "no_mcuboot" must be set to true in the gn gen build command +# in order for the application to be linked at the base of the flash. +#chip_enable_ota_requestor = true declare_args() { + # TODO : set no_mcuboot to false by default when enabling ota requestor by default + no_mcuboot = true + chip_enable_secondary_nwk_if = false } +mbedtls_target = "${nxp_sdk_build_root}:nxp_mbedtls" + openthread_external_mbedtls = mbedtls_target openthread_project_core_config_file = "OpenThreadConfig.h" openthread_core_config_deps = [ "${chip_root}/third_party/openthread/platforms/nxp/${nxp_platform}:openthread_core_config_rt1060" ]