From 4574fba5e675909c8c0d6b0dd62364df2f358fbf Mon Sep 17 00:00:00 2001 From: Andrey Tolstoy Date: Thu, 13 Jan 2022 22:30:45 +0700 Subject: [PATCH] [gen3] hal: only skip modules that fail integrity check from module info --- hal/src/nRF52840/ota_flash_hal.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/hal/src/nRF52840/ota_flash_hal.cpp b/hal/src/nRF52840/ota_flash_hal.cpp index 5cd9c79035..2a3e3d7dda 100644 --- a/hal/src/nRF52840/ota_flash_hal.cpp +++ b/hal/src/nRF52840/ota_flash_hal.cpp @@ -187,7 +187,11 @@ int HAL_System_Info(hal_system_info_t* info, bool construct, void* reserved) continue; } bool valid = fetch_module(module, bounds, false, MODULE_VALIDATION_INTEGRITY); - valid = valid && (module->validity_checked == module->validity_result); + // NOTE: fetch_module may return other validation flags in module->validity_checked + // and module->validity_result + // Here specifically we are only concerned whether the integrity check passes or not + // and skip such 'broken' modules from module info + valid = valid && (module->validity_result & MODULE_VALIDATION_INTEGRITY); if (bounds->store == MODULE_STORE_MAIN && bounds->module_function == MODULE_FUNCTION_USER_PART) { if (valid) { user_module_found = true;