1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2025-12-25 06:23:53 +01:00

Merge pull request #15469 from benpicco/sys/riotboot_finish_raw

riotboot: don't always return error in riotboot_flashwrite_finish_raw()
This commit is contained in:
benpicco 2020-11-23 16:40:17 +01:00 committed by GitHub
commit ee5f2f76fb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -151,12 +151,10 @@ int riotboot_flashwrite_putbytes(riotboot_flashwrite_t *state,
}
int riotboot_flashwrite_finish_raw(riotboot_flashwrite_t *state,
const uint8_t *bytes, size_t len)
const uint8_t *bytes, size_t len)
{
assert(len <= FLASHPAGE_SIZE);
int res = -1;
uint8_t *slot_start = (uint8_t *)riotboot_slot_get_hdr(state->target_slot);
#if CONFIG_RIOTBOOT_FLASHWRITE_RAW
@ -179,11 +177,11 @@ int riotboot_flashwrite_finish_raw(riotboot_flashwrite_t *state,
int flashpage = flashpage_page((void *)slot_start);
if (flashpage_write_and_verify(flashpage, firstpage) == FLASHPAGE_OK) {
LOG_INFO(LOG_PREFIX "riotboot flashing completed successfully\n");
res = 0;
}
else {
LOG_WARNING(LOG_PREFIX "re-flashing first block failed!\n");
LOG_ERROR(LOG_PREFIX "re-flashing first block failed!\n");
return -1;
}
#endif /* !CONFIG_RIOTBOOT_FLASHWRITE_RAW */
return res;
return 0;
}