lib: updatehub: Add missing do upgrade request call

After a success image download, UpdateHub needs inform MCUboot that
must test new image and then, on success, commit this new image. This
add missing upgrade request call step and fixes the upgarde flow.

Signed-off-by: Gerson Fernando Budke <gerson.budke@ossystems.com.br>
Signed-off-by: Otavio Salvador <otavio@ossystems.com.br>
This commit is contained in:
Gerson Fernando Budke 2020-03-28 16:25:11 -03:00 committed by Jukka Rissanen
commit d1e2d345fb

View file

@ -757,6 +757,12 @@ enum updatehub_response updatehub_update(void)
goto error; goto error;
} }
if (boot_request_upgrade(BOOT_UPGRADE_TEST)) {
LOG_ERR("Could not reporting downloaded state");
ctx.code_status = UPDATEHUB_INSTALL_ERROR;
goto error;
}
if (report(UPDATEHUB_STATE_INSTALLED) < 0) { if (report(UPDATEHUB_STATE_INSTALLED) < 0) {
LOG_ERR("Could not reporting installed state"); LOG_ERR("Could not reporting installed state");
goto error; goto error;