-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Closed
Closed
Copy link
Labels
Area: OTAArea: Over-the-air updatesArea: Over-the-air updatesArea: cpuArea: CPU/MCU portsArea: CPU/MCU portsPlatform: ARMPlatform: This PR/issue effects ARM-based platformsPlatform: This PR/issue effects ARM-based platformsType: bugThe issue reports a bug / The PR fixes a bug (including spelling errors)The issue reports a bug / The PR fixes a bug (including spelling errors)
Description
Description
While testing #15914 I realized that riotboot/flashwrite has been broken on stm32wb for a while. It seems to be caused by the following sections:
RIOT/sys/riotboot/flashwrite.c
Lines 141 to 155 in 3b2a55a
| #if CONFIG_RIOTBOOT_FLASHWRITE_RAW /* Guards access to state::firstblock_buf */ | |
| void * addr = flashpage_addr(state->flashpage); | |
| if (addr == riotboot_slot_get_hdr(state->target_slot) && | |
| state->offset == RIOTBOOT_FLASHPAGE_BUFFER_SIZE) { | |
| /* Skip flashing the first block, store it for later to flash it | |
| * during the flashwrite_finish function */ | |
| memcpy(state->firstblock_buf, | |
| state->flashpage_buf, RIOTBOOT_FLASHPAGE_BUFFER_SIZE); | |
| } | |
| else { | |
| flashpage_write((uint8_t*)addr + flashpage_pos, | |
| state->flashpage_buf, | |
| RIOTBOOT_FLASHPAGE_BUFFER_SIZE); | |
| } | |
| #else |
The offset is initially set to 4 and when the required alignment is 8. Weirdly enough I only get this error with stm32wb and not with stm32l4.
Steps to reproduce the issue
Any application using riotboot/flashwrite so examples/suit_udpate or tests/riotboot_flashwrite. #15559 can be used to reproduce in any case:
sudo ./dist/tools/ethos/setup_network.sh riot0 2001:db8::/64make -C <examples/suit_update or tests/riotboot_flashwrite> flash test-with-config
Expected results
Test passes
Actual results
inet6 addr: fe80::2 scope: link VAL
inet6 group: ff02::2
inet6 group: ff02::1
inet6 group: ff02::1:fff0:17c1
inet6 group: ff02::1:ff00:2
> _flashwrite_handler(): received data: offset=0 len=64 blockwise=1 more=1
_flashwrite_handler(): init len=64
riotboot_flashwrite: initializing update to target slot 1
riotboot_flashwrite: processing bytes 4-63
cpu/stm32/periph/flashpage.c:208 => 0x80017f5
*** RIOT kernel panic:
FAILED ASSERTION.
*** halted.
Reactions are currently unavailable
Metadata
Metadata
Labels
Area: OTAArea: Over-the-air updatesArea: Over-the-air updatesArea: cpuArea: CPU/MCU portsArea: CPU/MCU portsPlatform: ARMPlatform: This PR/issue effects ARM-based platformsPlatform: This PR/issue effects ARM-based platformsType: bugThe issue reports a bug / The PR fixes a bug (including spelling errors)The issue reports a bug / The PR fixes a bug (including spelling errors)