From ec4803728ddfd8840cd7b4d019b606f65fdae7c5 Mon Sep 17 00:00:00 2001 From: Koen Zandberg Date: Tue, 27 Oct 2020 09:27:28 +0100 Subject: [PATCH 1/2] suit/storage/flashwrite: use riotboot_slot_offset Fixes an issue with riotboot on the stm32f1 and other MCUs where the flash is remapped to a different region --- sys/suit/storage/flashwrite.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/suit/storage/flashwrite.c b/sys/suit/storage/flashwrite.c index 40fff1055e..3a332337ee 100644 --- a/sys/suit/storage/flashwrite.c +++ b/sys/suit/storage/flashwrite.c @@ -174,7 +174,7 @@ static bool _flashwrite_match_offset(const suit_storage_t *storage, (void)storage; int target_slot = riotboot_slot_other(); - uintptr_t slot_start = (intptr_t)riotboot_slot_get_hdr(target_slot); + uintptr_t slot_start = (uintptr_t)riotboot_slot_offset(target_slot); return (slot_start == (uintptr_t)offset); } From 9d7a2508c29beb99591cbc45675530c45cde80d4 Mon Sep 17 00:00:00 2001 From: Koen Zandberg Date: Tue, 27 Oct 2020 09:49:08 +0100 Subject: [PATCH 2/2] examples/suit: Adapt test script to storage changes --- examples/suit_update/tests/01-run.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/examples/suit_update/tests/01-run.py b/examples/suit_update/tests/01-run.py index d10f300ac0..b16e1cb846 100755 --- a/examples/suit_update/tests/01-run.py +++ b/examples/suit_update/tests/01-run.py @@ -68,8 +68,7 @@ def publish(server_dir, server_url, app_ver, keys='default', latest_name=None): def wait_for_update(child): return child.expect([r"Fetching firmware \|[█ ]+\|\s+\d+\%", - "riotboot_flashwrite: riotboot flashing " - "completed successfully"], + "Finalizing payload store"], timeout=UPDATING_TIMEOUT)