From 634519e1ecbf34a06ce4ced21d305691d13f4fe7 Mon Sep 17 00:00:00 2001 From: Sergei Lissianoi <54454955+selissia@users.noreply.github.com> Date: Mon, 13 Jun 2022 12:38:09 -0400 Subject: [PATCH] [EFR32] Adjust the internal flash layout (#19523) * Do not initialize the certificate pointer in ApplicationProperties_t The certificate pointer is updated when the certificate is actually injected into the image, there is no need to initialize it at compile time * Reserve the last page of the flash for the manufacturing tokens * Remove merge artifacts --- examples/platform/efr32/OTAConfig.cpp | 25 +++---------------- .../platform/efr32/ldscripts/efr32mg12.ld | 1 + .../platform/efr32/ldscripts/efr32mg24.ld | 3 ++- 3 files changed, 7 insertions(+), 22 deletions(-) diff --git a/examples/platform/efr32/OTAConfig.cpp b/examples/platform/efr32/OTAConfig.cpp index f3601247f4d2ee..8f42f6951e1cdc 100644 --- a/examples/platform/efr32/OTAConfig.cpp +++ b/examples/platform/efr32/OTAConfig.cpp @@ -21,19 +21,6 @@ #include "platform/bootloader/api/application_properties.h" #include -#define BOOTLOADER_SUPPORT_CERTIFICATES 1 -#define APPLICATION_CERTIFICATE_VERSION (1UL) - -#if defined(BOOTLOADER_SUPPORT_CERTIFICATES) -const ApplicationCertificate_t sl_app_certificate = { - .structVersion = APPLICATION_CERTIFICATE_VERSION, - .flags = { 0U }, - .key = { 0U }, - .version = 0, - .signature = { 0U }, -}; -#endif - // Header used for building the image GBL file #define APP_PROPERTIES_VERSION 1 #define APP_PROPERTIES_ID \ @@ -71,15 +58,11 @@ __attribute__((used)) ApplicationProperties_t sl_app_properties = { /// Unique ID (e.g. UUID/GUID) for the product this application is built for .productId = APP_PROPERTIES_ID, }, -#if defined(BOOTLOADER_SUPPORT_CERTIFICATES) - // If certificate based boot chain is enabled, the bootloader binary will be provided with - // a certificate that does not contain any key. - // A valid certificate needs to be injected to the bootloader images using Simplicity Commander. - // Simplicity Commander will replace this certificate. - .cert = (ApplicationCertificate_t *)&sl_app_certificate, -#else + + /// Pointer to information about the certificate .cert = NULL, -#endif + + /// Pointer to Long Token Data Section .longTokenSectionAddress = NULL, }; diff --git a/examples/platform/efr32/ldscripts/efr32mg12.ld b/examples/platform/efr32/ldscripts/efr32mg12.ld index 9dba3e1ded84e2..0851b5ffdf6a60 100644 --- a/examples/platform/efr32/ldscripts/efr32mg12.ld +++ b/examples/platform/efr32/ldscripts/efr32mg12.ld @@ -255,6 +255,7 @@ SECTIONS KEEP(*(.simee*)) } > FLASH + /* Last page of flash is reserved for the manufacturing token space */ linker_nvm_end = __main_flash_end__ - 2048; linker_nvm_begin = linker_nvm_end - SIZEOF(.nvm); linker_nvm_size = SIZEOF(.nvm); diff --git a/examples/platform/efr32/ldscripts/efr32mg24.ld b/examples/platform/efr32/ldscripts/efr32mg24.ld index 06bfc7c1842170..7b19dbea1bc03f 100644 --- a/examples/platform/efr32/ldscripts/efr32mg24.ld +++ b/examples/platform/efr32/ldscripts/efr32mg24.ld @@ -255,7 +255,8 @@ SECTIONS KEEP(*(.simee*)) } > FLASH - linker_nvm_end = __main_flash_end__; + /* Last page of flash is reserved for the manufacturing token space */ + linker_nvm_end = __main_flash_end__ - 8192; linker_nvm_begin = linker_nvm_end - SIZEOF(.nvm); linker_nvm_size = SIZEOF(.nvm); __nvm3Base = linker_nvm_begin;