subsys/mgmt/hawkbit: Warning if image is unconfirmed

Add a warning if the image is unconfirmed. Add a delay before rebooting
so that the user knows what happened.

Signed-off-by: Yong Cong Sin <yongcong.sin@gmail.com>
This commit is contained in:
Yong Cong Sin 2021-08-28 18:26:58 +08:00 committed by Christopher Friedt
commit dfb55e5353
2 changed files with 6 additions and 1 deletions

View file

@ -52,7 +52,9 @@ void main(void)
case HAWKBIT_UNCONFIRMED_IMAGE: case HAWKBIT_UNCONFIRMED_IMAGE:
LOG_ERR("Image is unconfirmed"); LOG_ERR("Image is unconfirmed");
LOG_ERR("Rebooting to previous confirmed image"); LOG_ERR("Rebooting to previous confirmed image");
LOG_ERR("If this image is flashed using a hardware tool");
LOG_ERR("Make sure that it is a confirmed image");
k_sleep(K_SECONDS(1));
sys_reboot(SYS_REBOOT_WARM); sys_reboot(SYS_REBOOT_WARM);
break; break;

View file

@ -1334,6 +1334,9 @@ static void autohandler(struct k_work *work)
case HAWKBIT_UNCONFIRMED_IMAGE: case HAWKBIT_UNCONFIRMED_IMAGE:
LOG_ERR("Image is unconfirmed"); LOG_ERR("Image is unconfirmed");
LOG_ERR("Rebooting to previous confirmed image"); LOG_ERR("Rebooting to previous confirmed image");
LOG_ERR("If this image is flashed using a hardware tool");
LOG_ERR("Make sure that it is a confirmed image");
k_sleep(K_SECONDS(1));
sys_reboot(SYS_REBOOT_WARM); sys_reboot(SYS_REBOOT_WARM);
break; break;