diff --git a/subsys/mgmt/hawkbit/hawkbit.c b/subsys/mgmt/hawkbit/hawkbit.c index ddfbce4ecb0..28666b033d1 100644 --- a/subsys/mgmt/hawkbit/hawkbit.c +++ b/subsys/mgmt/hawkbit/hawkbit.c @@ -859,7 +859,7 @@ int hawkbit_init(void) } 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) { LOG_ERR("Failed to erase second slot: %d", ret); return ret;