From 983ebbb5d3f8cbf3894ee5241ae6b73afc509abf Mon Sep 17 00:00:00 2001 From: Andrey Tolstoy Date: Fri, 25 Jun 2021 22:37:52 +0700 Subject: [PATCH] [nrf52840] platform: we only need to erase user application when building in modular --- platform/MCU/nRF52840/src/flash_mal.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/platform/MCU/nRF52840/src/flash_mal.c b/platform/MCU/nRF52840/src/flash_mal.c index d015f604ba..eb9446b075 100644 --- a/platform/MCU/nRF52840/src/flash_mal.c +++ b/platform/MCU/nRF52840/src/flash_mal.c @@ -385,6 +385,7 @@ int FLASH_CopyMemory(flash_device_t sourceDeviceID, uint32_t sourceAddress, } #endif // SOFTDEVICE_MBR_UPDATES +#ifdef MODULAR_FIRMWARE // Make sure to invalidate the compat application, otherwise we'll keep booting into the compat application // as it takes precedence if (module_function == MODULE_FUNCTION_USER_PART && destinationAddress == USER_FIRMWARE_IMAGE_LOCATION) { @@ -392,6 +393,7 @@ int FLASH_CopyMemory(flash_device_t sourceDeviceID, uint32_t sourceAddress, return FLASH_ACCESS_RESULT_ERROR; } } +#endif // MODULAR_FIRMWARE if (!FLASH_EraseMemory(destinationDeviceID, destinationAddress, dest_size)) { return FLASH_ACCESS_RESULT_ERROR;