From d1e2d345fb7097972c84ac9c5c173f78ae5396d5 Mon Sep 17 00:00:00 2001 From: Gerson Fernando Budke Date: Sat, 28 Mar 2020 16:25:11 -0300 Subject: [PATCH] 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 Signed-off-by: Otavio Salvador --- lib/updatehub/updatehub.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/lib/updatehub/updatehub.c b/lib/updatehub/updatehub.c index 1d389f534bf..0a7f458ee30 100644 --- a/lib/updatehub/updatehub.c +++ b/lib/updatehub/updatehub.c @@ -757,6 +757,12 @@ enum updatehub_response updatehub_update(void) 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) { LOG_ERR("Could not reporting installed state"); goto error;