mgmt: hawkbit: use flash_img_get_upload_slot()

don't assume, that the slot to upload is the second.

Signed-off-by: Fin Maaß <f.maass@vogl-electronic.com>
This commit is contained in:
Fin Maaß 2024-11-06 13:52:46 +01:00 committed by Benjamin Cabé
parent beffba6d87
commit ca43888f54

View file

@ -859,7 +859,7 @@ int hawkbit_init(void)
} }
LOG_DBG("Marked current image as OK"); LOG_DBG("Marked current image as OK");
ret = boot_erase_img_bank(FIXED_PARTITION_ID(SLOT1_LABEL)); ret = boot_erase_img_bank(flash_img_get_upload_slot());
if (ret < 0) { if (ret < 0) {
LOG_ERR("Failed to erase second slot: %d", ret); LOG_ERR("Failed to erase second slot: %d", ret);
return ret; return ret;