Skip to content

Commit

Permalink
Merge pull request #2387 from particle-iot/fix/gen3-module-info-valid…
Browse files Browse the repository at this point in the history
…ation

[gen3] hal: only skip modules that fail integrity check from module info
  • Loading branch information
avtolstoy committed Jan 13, 2022
2 parents 3cb05eb + 4574fba commit 846464e
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion hal/src/nRF52840/ota_flash_hal.cpp
Expand Up @@ -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;
Expand Down

0 comments on commit 846464e

Please sign in to comment.