RIOT-OS / RIOT

RIOT - The friendly OS for IoT
https://riot-os.org
GNU Lesser General Public License v2.1
4.85k stars 1.97k forks source link

sys/riotboot/flashwrite: unaligned write when skipping `RIOTBOOT_MAGIC` on stm32wb #15917

Closed fjmolinas closed 3 weeks ago

fjmolinas commented 3 years ago

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:

https://github.com/RIOT-OS/RIOT/blob/3b2a55a923fa3bbf215bc90ac6d882f48bf5b8a0/sys/riotboot/flashwrite.c#L141-L155

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. https://github.com/RIOT-OS/RIOT/pull/15559 can be used to reproduce in any case:

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.
maribu commented 1 year ago

@benpicco Is this still an issue?

benpicco commented 1 year ago

I don't have the hardware to check this

aabadie commented 1 year ago

Could it be related #19618 ?

maribu commented 1 year ago

I don't have the hardware to check this

I think I have an stm32wb somewhere. I'll give it a try when I find it, both with master and https://github.com/RIOT-OS/RIOT/pull/19618

crasbe commented 3 weeks ago

tl;dr: This issue seems to be fixed. The suit_update example failed once for me but that could've had a lot of reasons. I retried it multiple times and it never failed.

IMO this issue can be closed @maribu. The original author doesn't seem to be active anymore :(


The "riot_flashboot" test gives the following output:

chris@ThinkPias:~/flashdev-riot/RIOT/tests/riotboot_flashwrite$ BOARD=p-nucleo-wb55 make flash test-with-config
Building application "tests_riotboot_flashwrite" for "p-nucleo-wb55" with CPU "stm32".

"make" -C /home/chris/flashdev-riot/RIOT/pkg/cmsis/ 
"make" -C /home/chris/flashdev-riot/RIOT/boards/common/init
"make" -C /home/chris/flashdev-riot/RIOT/boards/p-nucleo-wb55
...
"make" -C /home/chris/flashdev-riot/RIOT/sys/stdio_null
compiling /home/chris/flashdev-riot/RIOT/dist/tools/riotboot_gen_hdr/bin/genhdr...
make: Nothing to be done for 'all'.
creating /home/chris/flashdev-riot/RIOT/tests/riotboot_flashwrite/bin/p-nucleo-wb55/riotboot_files/slot0.1720049003.bin...
   text    data     bss     dec     hex filename
  68056     176   13032   81264   13d70 /home/chris/flashdev-riot/RIOT/tests/riotboot_flashwrite/bin/p-nucleo-wb55/tests_riotboot_flashwrite.elf
/home/chris/flashdev-riot/RIOT/dist/tools/openocd/openocd.sh flash /home/chris/flashdev-riot/RIOT/tests/riotboot_flashwrite/bin/p-nucleo-wb55/riotboot_files/slot0-extended.bin
### Flashing Target ###
Binfile detected, adding ROM base address: 0x08000000
Flashing with IMAGE_OFFSET: 0x08000000
Open On-Chip Debugger 0.11.0
Licensed under GNU GPL v2
For bug reports, read
    http://openocd.org/doc/doxygen/bugs.html
hla_swd
Info : The selected transport took over low-level target control. The results might differ compared to plain JTAG/SWD
srst_only separate srst_nogate srst_open_drain connect_assert_srst

Info : clock speed 500 kHz
Info : STLINK V2J40M27 (API v2) VID:PID 0483:374B
Info : Target voltage: 3.236292
Info : stm32wbx.cpu: hardware has 6 breakpoints, 4 watchpoints
Info : starting gdb server for stm32wbx.cpu on 0
Info : Listening on port 32821 for gdb connections
    TargetName         Type       Endian TapName            State       
--  ------------------ ---------- ------ ------------------ ------------
 0* stm32wbx.cpu       hla_target little stm32wbx.cpu       reset

Info : Unable to match requested speed 500 kHz, using 480 kHz
Info : Unable to match requested speed 500 kHz, using 480 kHz
target halted due to debug-request, current mode: Thread 
xPSR: 0x01000000 pc: 0x0800038c msp: 0x20000200
Info : device idcode = 0x20016495 (STM32WB5x - Rev 2.1 : 0x2001)
Info : flash size = 1024kbytes
Info : flash mode : single-bank
Warn : Adding extra erase range, 0x08066200 .. 0x08066fff
auto erase enabled
wrote 418304 bytes from file /home/chris/flashdev-riot/RIOT/tests/riotboot_flashwrite/bin/p-nucleo-wb55/riotboot_files/slot0-extended.bin in 15.787079s (25.876 KiB/s)

verified 418304 bytes in 12.088158s (33.793 KiB/s)

Info : Unable to match requested speed 500 kHz, using 480 kHz
Info : Unable to match requested speed 500 kHz, using 480 kHz
shutdown command invoked
Done flashing
make -C benchmark_udp
make[2]: Für das Ziel „all“ ist nichts zu tun.
make -C dose
make[2]: Für das Ziel „all“ ist nichts zu tun.
make -C ethos
make[2]: Für das Ziel „all“ ist nichts zu tun.
make -C uhcpd
make[2]: Für das Ziel „all“ ist nichts zu tun.
make -C sliptty
make[2]: Für das Ziel „all“ ist nichts zu tun.
make -C zep_dispatch
cc -g -O3 -Wall -Wextra -I/home/chris/flashdev-riot/RIOT/core/lib/include -I/home/chris/flashdev-riot/RIOT/cpu/native/include -I/home/chris/flashdev-riot/RIOT/drivers/include -I/home/chris/flashdev-riot/RIOT/sys/include -DNDEBUG   main.c topology.c zep_parser.c /home/chris/flashdev-riot/RIOT/sys/net/link_layer/ieee802154/ieee802154.c /home/chris/flashdev-riot/RIOT/sys/fmt/fmt.c /home/chris/flashdev-riot/RIOT/sys/net/link_layer/l2util/l2util.c -o bin/zep_dispatch

make -C benchmark_udp
make[3]: Für das Ziel „all“ ist nichts zu tun.
make -C dose
make[3]: Für das Ziel „all“ ist nichts zu tun.
make -C ethos
make[3]: Für das Ziel „all“ ist nichts zu tun.
make -C uhcpd
make[3]: Für das Ziel „all“ ist nichts zu tun.
make -C sliptty
make[3]: Für das Ziel „all“ ist nichts zu tun.
make -C zep_dispatch
cc -g -O3 -Wall -Wextra -I/home/chris/flashdev-riot/RIOT/core/lib/include -I/home/chris/flashdev-riot/RIOT/cpu/native/include -I/home/chris/flashdev-riot/RIOT/drivers/include -I/home/chris/flashdev-riot/RIOT/sys/include -DNDEBUG  topogen.c -o bin/topogen -lm
/home/chris/flashdev-riot/RIOT/dist/tools/ethos/ethos riot0 /dev/ttyACM0 
----> ethos: sending hello.
----> ethos: activating serial pass through.
----> ethos: hello received
Failed to send flush request: Operation not permitted
gnrc_uhcpc: Using 5 as border interface and 0 as wireless interface.
gnrc_uhcpc: only one interface found, skipping setup.
main(): This is RIOT! (Version: 2024.07-devel-2-g17d52-pr/wb55_adc)
riotboot_flashwrite test application
Running from slot 0
Image magic_number: 0x544f4952
Image Version: 0x6685dd6b
Image start address: 0x08002200
Header chksum: 0x52ba0b93

Starting the shell
> ----> ethos: hello received
Failed to send flush request: Operation not permitted
gnrc_uhcpc: Using 5 as border interface and 0 as wireless interface.
gnrc_uhcpc: only one interface found, skipping setup.
main(): This is RIOT! (Version: 2024.07-devel-2-g17d52-pr/wb55_adc)
riotboot_flashwrite test application
Running from slot 0
Image magic_number: 0x544f4952
Image Version: 0x6685dd6b
Image start address: 0x08002200
Header chksum: 0x52ba0b93

Starting the shell
> ----> ethos: hello reply received
Failed to send flush request: Operation not permitted
----> ethos: hello reply received
Failed to send flush request: Operation not permitted

riotboot-hdr

current-slot
ifconfig

> 
> 
> 
> riotboot-hdr
Image magic_number: 0x544f4952
Image Version: 0x6685dd6b
Image start address: 0x08002200
Header chksum: 0x52ba0b93

> 
> 
> current-slot
Running from slot 0
> ifconfig
Iface  5  HWaddr: E6:A6:36:71:18:E9 
          L2-PDU:1500  MTU:1500  HL:64  Source address length: 6
          Link type: wired
          inet6 addr: fe80::e4a6:36ff:fe71:18e9  scope: link  VAL
pinging node...
PING fe80::e4a6:36ff:fe71:18e9%riot0(fe80::e4a6:36ff:fe71:18e9%riot0) 56 data bytes

--- fe80::e4a6:36ff:fe71:18e9%riot0 ping statistics ---
1 packets transmitted, 1 received, 0% packet loss, time 0ms
rtt min/avg/max/mdev = 40.915/40.915/40.915/0.000 ms
pinging node succeeded.
compiling /home/chris/flashdev-riot/RIOT/dist/tools/riotboot_gen_hdr/bin/genhdr...
make: Nothing to be done for 'all'.
creating /home/chris/flashdev-riot/RIOT/tests/riotboot_flashwrite/bin/p-nucleo-wb55/riotboot_files/slot0.1720049004.bin...
creating /home/chris/flashdev-riot/RIOT/tests/riotboot_flashwrite/bin/p-nucleo-wb55/riotboot_files/slot1.1720049004.bin...
          inet6 addr: fe80::2  scope: link  VAL
          inet6 group: ff02::1
          inet6 group: ff02::1:ff71:18e9
          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
_flashwrite_handler(): received data: offset=64 len=64 blockwise=1 more=1
_flashwrite_handler(): received data: offset=128 len=64 blockwise=1 more=1
_flashwrite_handler(): received data: offset=192 len=64 blockwise=1 more=1
_flashwrite_handler(): received data: offset=256 len=64 blockwise=1 more=1
...
_flashwrite_handler(): received data: offset=68544 len=64 blockwise=1 more=1
_flashwrite_handler(): received data: offset=68608 len=64 blockwise=1 more=1
_flashwrite_handler(): received data: offset=68672 len=64 blockwise=1 more=1
_flashwrite_handler(): received data: offset=68736 len=8 blockwise=1 more=0
_flashwrite_handler(): finish
WARNING:coap.blockwise-requester:Block1 option completely ignored by server, assuming it knows what it is doing.
reboot
reboot
----> ethos: hello received
Failed to send flush request: Operation not permitted
gnrc_uhcpc: Using 5 as border interface and 0 as wireless interface.
gnrc_uhcpc: only one interface found, skipping setup.
main(): This is RIOT! (Version: 2024.07-devel-2-g17d52-pr/wb55_adc)
riotboot_flashwrite test application
Running from slot 1
Image magic_number: 0x544f4952
Image Version: 0x6685dd6c
Image start address: 0x08066200
Header chksum: 0xd2c44b9a

Starting the shell

> current-slot

> 
> current-slot
Running from slot 1
> ifconfig
ifconfig
Iface  5  HWaddr: E6:A6:36:71:18:E9 
          L2-PDU:1500  MTU:1500  HL:64  Source address length: 6
          Link type: wired
          inet6 addr: fe80::e4a6:36ff:fe71:18e9  scope: link  VAL
pinging node...
PING fe80::e4a6:36ff:fe71:18e9%riot0(fe80::e4a6:36ff:fe71:18e9%riot0) 56 data bytes

--- fe80::e4a6:36ff:fe71:18e9%riot0 ping statistics ---
1 packets transmitted, 1 received, 0% packet loss, time 0ms
rtt min/avg/max/mdev = 40.990/40.990/40.990/0.000 ms
pinging node succeeded.
compiling /home/chris/flashdev-riot/RIOT/dist/tools/riotboot_gen_hdr/bin/genhdr...
make: Nothing to be done for 'all'.
creating /home/chris/flashdev-riot/RIOT/tests/riotboot_flashwrite/bin/p-nucleo-wb55/riotboot_files/slot0.1720049005.bin...
creating /home/chris/flashdev-riot/RIOT/tests/riotboot_flashwrite/bin/p-nucleo-wb55/riotboot_files/slot1.1720049005.bin...
          inet6 addr: fe80::2  scope: link  VAL
          inet6 group: ff02::1
          inet6 group: ff02::1:ff71:18e9
          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 0
_flashwrite_handler(): received data: offset=64 len=64 blockwise=1 more=1
_flashwrite_handler(): received data: offset=128 len=64 blockwise=1 more=1
_flashwrite_handler(): received data: offset=192 len=64 blockwise=1 more=1
_flashwrite_handler(): received data: offset=256 len=64 blockwise=1 more=1
...
_flashwrite_handler(): received data: offset=68480 len=64 blockwise=1 more=1
_flashwrite_handler(): received data: offset=68544 len=64 blockwise=1 more=1
_flashwrite_handler(): received data: offset=68608 len=64 blockwise=1 more=1
_flashwrite_handler(): received data: offset=68672 len=64 blockwise=1 more=1
_flashwrite_handler(): received data: offset=68736 len=8 blockwise=1 more=0
_flashwrite_handler(): finish
WARNING:coap.blockwise-requester:Block1 option completely ignored by server, assuming it knows what it is doing.
reboot
reboot
----> ethos: hello received
Failed to send flush request: Operation not permitted
gnrc_uhcpc: Using 5 as border interface and 0 as wireless interface.
gnrc_uhcpc: only one interface found, skipping setup.
main(): This is RIOT! (Version: 2024.07-devel-2-g17d52-pr/wb55_adc)
riotboot_flashwrite test application
Running from slot 0
Image magic_number: 0x544f4952
Image Version: 0x6685dd6d
Image start address: 0x08002200
Header chksum: 0x52c20b95

Starting the shell

> current-slot

> 
> current-slot
Running from slot 0
> ifconfig
ifconfig
Iface  5  HWaddr: E6:A6:36:71:18:E9 
          L2-PDU:1500  MTU:1500  HL:64  Source address length: 6
          Link type: wired
          inet6 addr: fe80::e4a6:36ff:fe71:18e9  scope: link  VAL
pinging node...
PING fe80::e4a6:36ff:fe71:18e9%riot0(fe80::e4a6:36ff:fe71:18e9%riot0) 56 data bytes

--- fe80::e4a6:36ff:fe71:18e9%riot0 ping statistics ---
1 packets transmitted, 1 received, 0% packet loss, time 0ms
rtt min/avg/max/mdev = 40.360/40.360/40.360/0.000 ms
pinging node succeeded.
riotboot-invalidate 0
reboot
          inet6 addr: fe80::2  scope: link  VAL
          inet6 group: ff02::1
          inet6 group: ff02::1:ff71:18e9
          inet6 group: ff02::1:ff00:2

> riotboot-invalidate 0
> reboot
----> ethos: hello received
Failed to send flush request: Operation not permitted
gnrc_uhcpc: Using 5 as border interface and 0 as wireless interface.
gnrc_uhcpc: only one interface found, skipping setup.
main(): This is RIOT! (Version: 2024.07-devel-2-g17d52-pr/wb55_adc)
riotboot_flashwrite test application
Running from slot 1
Image magic_number: 0x544f4952
Image Version: 0x6685dd6c
Image start address: 0x08066200
Header chksum: 0xd2c44b9a

Starting the shell

> current-slot

> 
> current-slot
Running from slot 1
TEST PASSED

The "suit_update" example seems to work more or less. It can flash slot 1 and boot from it. But when it tries to flash slot 0, a HARD FAULT occurs.

chris@ThinkPias:~/flashdev-riot/RIOT$ BOARD=p-nucleo-wb55 make -C examples/suit_update flash test-with-config
make: Verzeichnis „/home/chris/flashdev-riot/RIOT/examples/suit_update“ wird betreten
Building application "suit_update" for "p-nucleo-wb55" with CPU "stm32".

make[1]: Für das Ziel „prepare“ ist nichts zu tun.
"make" -C /home/chris/flashdev-riot/RIOT/pkg/c25519/ 
"make" -C /home/chris/flashdev-riot/RIOT/build/pkg/c25519/src -f /home/chris/flashdev-riot/RIOT/Makefile.base MODULE=c25519
"make" -C /home/chris/flashdev-riot/RIOT/pkg/cmsis/ 
"make" -C /home/chris/flashdev-riot/RIOT/pkg/libcose/ 
"make" -C /home/chris/flashdev-riot/RIOT/build/pkg/libcose/src -f /home/chris/flashdev-riot/RIOT/Makefile.base MODULE=libcose
"make" -C /home/chris/flashdev-riot/RIOT/build/pkg/libcose/src/crypt -f /home/chris/flashdev-riot/RIOT/pkg/libcose/Makefile.libcose_crypt
"make" -C /home/chris/flashdev-riot/RIOT/pkg/nanocbor/ 
"make" -C /home/chris/flashdev-riot/RIOT/build/pkg/nanocbor/src -f /home/chris/flashdev-riot/RIOT/Makefile.base MODULE=nanocbor
"make" -C /home/chris/flashdev-riot/RIOT/boards/common/init
"make" -C /home/chris/flashdev-riot/RIOT/boards/p-nucleo-wb55
...
"make" -C /home/chris/flashdev-riot/RIOT/sys/stdio_null
compiling /home/chris/flashdev-riot/RIOT/dist/tools/riotboot_gen_hdr/bin/genhdr...
make: Nothing to be done for 'all'.
creating /home/chris/flashdev-riot/RIOT/examples/suit_update/bin/p-nucleo-wb55/riotboot_files/slot0.1720046814.bin...
   text    data     bss     dec     hex filename
  95336     320   20752  116408   1c6b8 /home/chris/flashdev-riot/RIOT/examples/suit_update/bin/p-nucleo-wb55/suit_update.elf
/home/chris/flashdev-riot/RIOT/dist/tools/openocd/openocd.sh flash /home/chris/flashdev-riot/RIOT/examples/suit_update/bin/p-nucleo-wb55/riotboot_files/slot0-extended.bin
### Flashing Target ###
Binfile detected, adding ROM base address: 0x08000000
Flashing with IMAGE_OFFSET: 0x08000000
Open On-Chip Debugger 0.11.0
Licensed under GNU GPL v2
For bug reports, read
    http://openocd.org/doc/doxygen/bugs.html
hla_swd
Info : The selected transport took over low-level target control. The results might differ compared to plain JTAG/SWD
srst_only separate srst_nogate srst_open_drain connect_assert_srst

Info : clock speed 500 kHz
Info : STLINK V2J40M27 (API v2) VID:PID 0483:374B
Info : Target voltage: 3.237870
Info : stm32wbx.cpu: hardware has 6 breakpoints, 4 watchpoints
Info : starting gdb server for stm32wbx.cpu on 0
Info : Listening on port 36691 for gdb connections
    TargetName         Type       Endian TapName            State       
--  ------------------ ---------- ------ ------------------ ------------
 0* stm32wbx.cpu       hla_target little stm32wbx.cpu       reset

Info : Unable to match requested speed 500 kHz, using 480 kHz
Info : Unable to match requested speed 500 kHz, using 480 kHz
target halted due to debug-request, current mode: Thread 
xPSR: 0x01000000 pc: 0x0800038c msp: 0x20000200
Info : device idcode = 0x20016495 (STM32WB5x - Rev 2.1 : 0x2001)
Info : flash size = 1024kbytes
Info : flash mode : single-bank
Warn : Adding extra erase range, 0x08066200 .. 0x08066fff
auto erase enabled
wrote 418304 bytes from file /home/chris/flashdev-riot/RIOT/examples/suit_update/bin/p-nucleo-wb55/riotboot_files/slot0-extended.bin in 15.724252s (25.979 KiB/s)

verified 418304 bytes in 12.093657s (33.778 KiB/s)

Info : Unable to match requested speed 500 kHz, using 480 kHz
Info : Unable to match requested speed 500 kHz, using 480 kHz
shutdown command invoked
Done flashing
make -C benchmark_udp
make[2]: Für das Ziel „all“ ist nichts zu tun.
make -C dose
make[2]: Für das Ziel „all“ ist nichts zu tun.
make -C ethos
make[2]: Für das Ziel „all“ ist nichts zu tun.
make -C uhcpd
make[2]: Für das Ziel „all“ ist nichts zu tun.
make -C sliptty
make[2]: Für das Ziel „all“ ist nichts zu tun.
make -C zep_dispatch
cc -g -O3 -Wall -Wextra -I/home/chris/flashdev-riot/RIOT/core/lib/include -I/home/chris/flashdev-riot/RIOT/cpu/native/include -I/home/chris/flashdev-riot/RIOT/drivers/include -I/home/chris/flashdev-riot/RIOT/sys/include -DNDEBUG  topogen.c -o bin/topogen -lm

/usr/bin/make -C benchmark_udp
make[3]: Für das Ziel „all“ ist nichts zu tun.
/usr/bin/make -C dose
make[3]: Für das Ziel „all“ ist nichts zu tun.
/usr/bin/make -C ethos
make[3]: Für das Ziel „all“ ist nichts zu tun.
/usr/bin/make -C uhcpd
make[3]: Für das Ziel „all“ ist nichts zu tun.
/usr/bin/make -C sliptty
make[3]: Für das Ziel „all“ ist nichts zu tun.
/usr/bin/make -C zep_dispatch
cc -g -O3 -Wall -Wextra -I/home/chris/flashdev-riot/RIOT/core/lib/include -I/home/chris/flashdev-riot/RIOT/cpu/native/include -I/home/chris/flashdev-riot/RIOT/drivers/include -I/home/chris/flashdev-riot/RIOT/sys/include -DNDEBUG   main.c topology.c zep_parser.c /home/chris/flashdev-riot/RIOT/sys/net/link_layer/ieee802154/ieee802154.c /home/chris/flashdev-riot/RIOT/sys/fmt/fmt.c /home/chris/flashdev-riot/RIOT/sys/net/link_layer/l2util/l2util.c -o bin/zep_dispatch
/home/chris/flashdev-riot/RIOT/dist/tools/ethos/ethos riot0 /dev/ttyACM0 
----> ethos: sending hello.
----> ethos: activating serial pass through.
----> ethos: hello received
gnrc_uhcpc: Using 5 as border interface and 0 as wireless interface.
gnrc_uhcpc: only one interface found, skipping setup.
main(): This is RIOT! (Version: 2024.07-devel-2-g17d52-pr/wb55_adc)
RIOT SUIT update example application
Running from slot 0
Image magic_number: 0x544f4952
Image Version: 0x6685d4de
Image start address: 0x08002200
Header chksum: 0x30860306

Starting the shell
> ----> ethos: hello received
gnrc_uhcpc: Using 5 as border interface and 0 as wireless interface.
gnrc_uhcpc: only one interface found, skipping setup.
main(): This is RIOT! (Version: 2024.07-devel-2-g17d52-pr/wb55_adc)
RIOT SUIT update example application
Running from slot 0
Image magic_number: 0x544f4952
Image Version: 0x6685d4de
Image start address: 0x08002200
Header chksum: 0x30860306

Starting the shell
> ----> ethos: hello reply rec

suit seq_no
eived
----> ethos: hello reply received

> 
> 
> 
> suit seq_no
seq_no: 0x6685d4de
> ifconfig
ifconfig
Iface  5  HWaddr: E6:A6:36:71:18:E9 
          L2-PDU:1500  MTU:1500  HL:64  Source address length: 6
          Link type: wired
          inet6 addr: fe80::e4a6:36ff:fe71:18e9  scope: link  VAL
pinging node...
PING fe80::e4a6:36ff:fe71:18e9%riot0(fe80::e4a6:36ff:fe71:18e9%riot0) 56 data bytes

--- fe80::e4a6:36ff:fe71:18e9%riot0 ping statistics ---
1 packets transmitted, 1 received, 0% packet loss, time 0ms
rtt min/avg/max/mdev = 39.587/39.587/39.587/0.000 ms
pinging node succeeded.
suit
          inet6 addr: fe80::2  scope: link  VAL
          inet6 group: ff02::1
          inet6 group: ff02::1:ff71:18e9
          inet6 group: ff02::1:ff00:2

> suit
Usage: suit fetch <manifest url>
compiling /home/chris/flashdev-riot/RIOT/dist/tools/riotboot_gen_hdr/bin/genhdr...
make: Nothing to be done for 'all'.
creating /home/chris/flashdev-riot/RIOT/examples/suit_update/bin/p-nucleo-wb55/riotboot_files/slot0.1720046815.bin...
creating /home/chris/flashdev-riot/RIOT/examples/suit_update/bin/p-nucleo-wb55/riotboot_files/slot1.1720046815.bin...
published "/home/chris/flashdev-riot/RIOT/examples/suit_update/bin/p-nucleo-wb55/suit_files/riot.suit.1720046815.bin"
       as "coap://[fd00:dead:beef::1]/fw/suit_update/p-nucleo-wb55/riot.suit.1720046815.bin"
published "/home/chris/flashdev-riot/RIOT/examples/suit_update/bin/p-nucleo-wb55/suit_files/riot.suit.latest.bin"
       as "coap://[fd00:dead:beef::1]/fw/suit_update/p-nucleo-wb55/riot.suit.latest.bin"
published "/home/chris/flashdev-riot/RIOT/examples/suit_update/bin/p-nucleo-wb55/riotboot_files/slot0.1720046815.bin"
       as "coap://[fd00:dead:beef::1]/fw/suit_update/p-nucleo-wb55/slot0.1720046815.bin"
published "/home/chris/flashdev-riot/RIOT/examples/suit_update/bin/p-nucleo-wb55/riotboot_files/slot1.1720046815.bin"
       as "coap://[fd00:dead:beef::1]/fw/suit_update/p-nucleo-wb55/slot1.1720046815.bin"
aiocoap-client -m POST "coap://[fe80::e4a6:36ff:fe71:18e9%riot0]/suit/trigger" \
    --payload "coap://[fd00:dead:beef::1]/fw/suit_update/p-nucleo-wb55/riot.suit.1720046815.bin" && \
    echo "Triggered [fe80::e4a6:36ff:fe71:18e9%riot0] to update."
Triggered [fe80::e4a6:36ff:fe71:18e9%riot0] to update.
       suit seq_no
       suit revert
> suit: received URL: "coap://[fd00:dead:beef::1]/fw/suit_update/p-nucleo-wb55/riot.suit.1720046815.bin"
suit_worker: started.
suit_worker: downloading "coap://[fd00:dead:beef::1]/fw/suit_update/p-nucleo-wb55/riot.suit.1720046815.bin"
suit_worker: got manifest with size 501
suit: verifying manifest signature
Unable to validate signature: -2
compiling /home/chris/flashdev-riot/RIOT/dist/tools/riotboot_gen_hdr/bin/genhdr...
make: Nothing to be done for 'all'.
creating /home/chris/flashdev-riot/RIOT/examples/suit_update/bin/p-nucleo-wb55/riotboot_files/slot0.1720046814.bin...
creating /home/chris/flashdev-riot/RIOT/examples/suit_update/bin/p-nucleo-wb55/riotboot_files/slot1.1720046814.bin...
published "/home/chris/flashdev-riot/RIOT/examples/suit_update/bin/p-nucleo-wb55/suit_files/riot.suit.1720046814.bin"
       as "coap://[fd00:dead:beef::1]/fw/suit_update/p-nucleo-wb55/riot.suit.1720046814.bin"
published "/home/chris/flashdev-riot/RIOT/examples/suit_update/bin/p-nucleo-wb55/suit_files/riot.suit.latest.bin"
       as "coap://[fd00:dead:beef::1]/fw/suit_update/p-nucleo-wb55/riot.suit.latest.bin"
published "/home/chris/flashdev-riot/RIOT/examples/suit_update/bin/p-nucleo-wb55/riotboot_files/slot0.1720046814.bin"
       as "coap://[fd00:dead:beef::1]/fw/suit_update/p-nucleo-wb55/slot0.1720046814.bin"
published "/home/chris/flashdev-riot/RIOT/examples/suit_update/bin/p-nucleo-wb55/riotboot_files/slot1.1720046814.bin"
       as "coap://[fd00:dead:beef::1]/fw/suit_update/p-nucleo-wb55/slot1.1720046814.bin"
aiocoap-client -m POST "coap://[fe80::e4a6:36ff:fe71:18e9%riot0]/suit/trigger" \
    --payload "coap://[fd00:dead:beef::1]/fw/suit_update/p-nucleo-wb55/riot.suit.1720046814.bin" && \
    echo "Triggered [fe80::e4a6:36ff:fe71:18e9%riot0] to update."
Triggered [fe80::e4a6:36ff:fe71:18e9%riot0] to update.
suit_worker: suit_parse() failed. res=-6
suit_worker: update failed, hdr invalid
 suit: received URL: "coap://[fd00:dead:beef::1]/fw/suit_update/p-nucleo-wb55/riot.suit.1720046814.bin"
suit_worker: started.
suit_worker: downloading "coap://[fd00:dead:beef::1]/fw/suit_update/p-nucleo-wb55/riot.suit.1720046814.bin"
suit_worker: got manifest with size 501
suit: verifying manifest signature
suit: validated manifest version
Manifest seq_no: 1720046814, highest available: 1720046814
seq_nr <= running image
compiling /home/chris/flashdev-riot/RIOT/dist/tools/riotboot_gen_hdr/bin/genhdr...
make: Nothing to be done for 'all'.
creating /home/chris/flashdev-riot/RIOT/examples/suit_update/bin/p-nucleo-wb55/riotboot_files/slot0.1720046815.bin...
creating /home/chris/flashdev-riot/RIOT/examples/suit_update/bin/p-nucleo-wb55/riotboot_files/slot1.1720046815.bin...
published "/home/chris/flashdev-riot/RIOT/examples/suit_update/bin/p-nucleo-wb55/suit_files/riot.suit.1720046815.bin"
       as "coap://[fd00:dead:beef::1]/fw/suit_update/p-nucleo-wb55/riot.suit.1720046815.bin"
published "/home/chris/flashdev-riot/RIOT/examples/suit_update/bin/p-nucleo-wb55/suit_files/riot.suit.latest.bin"
       as "coap://[fd00:dead:beef::1]/fw/suit_update/p-nucleo-wb55/riot.suit.latest.bin"
published "/home/chris/flashdev-riot/RIOT/examples/suit_update/bin/p-nucleo-wb55/riotboot_files/slot0.1720046815.bin"
       as "coap://[fd00:dead:beef::1]/fw/suit_update/p-nucleo-wb55/slot0.1720046815.bin"
published "/home/chris/flashdev-riot/RIOT/examples/suit_update/bin/p-nucleo-wb55/riotboot_files/slot1.1720046815.bin"
       as "coap://[fd00:dead:beef::1]/fw/suit_update/p-nucleo-wb55/slot1.1720046815.bin"
aiocoap-client -m POST "coap://[fe80::e4a6:36ff:fe71:18e9%riot0]/suit/trigger" \
    --payload "coap://[fd00:dead:beef::1]/fw/suit_update/p-nucleo-wb55/riot.suit.1720046815.bin" && \
    echo "Triggered [fe80::e4a6:36ff:fe71:18e9%riot0] to update."
Triggered [fe80::e4a6:36ff:fe71:18e9%riot0] to update.
suit_worker: suit_parse() failed. res=-5
suit_worker: update failed, hdr invalid
 suit: received URL: "coap://[fd00:dead:beef::1]/fw/suit_update/p-nucleo-wb55/riot.suit.1720046815.bin"
suit_worker: started.
suit_worker: downloading "coap://[fd00:dead:beef::1]/fw/suit_update/p-nucleo-wb55/riot.suit.1720046815.bin"
suit_worker: got manifest with size 501
suit: verifying manifest signature
suit: validated manifest version
Manifest seq_no: 1720046815, highest available: 1720046814
suit: validated sequence number
Formatted component name: 
Comparing manifest offset 2000 with other slot offset
Comparing manifest offset 66000 with other slot offset
validating vendor ID
Comparing 547d0d74-6d3a-5a92-9662-4881afd9407b to 547d0d74-6d3a-5a92-9662-4881afd9407b from manifest
validating vendor ID: OK
validating class id
Comparing 358349c8-0175-58c6-b485-315d784b8368 to 358349c8-0175-58c6-b485-315d784b8368 from manifest
validating class id: OK
Comparing manifest offset 2000 with other slot offset
Comparing manifest offset 66000 with other slot offset
SUIT policy check OK.
Formatted component name: 
riotboot_flashwrite: initializing update to target slot 1
Fetching firmware |█████████████████████████| 100%
Finalizing payload store
Verifying image digest
Starting digest verification against image
Install correct payload
Verified installed payload
Verifying image digest
Starting digest verification against image
Verified installed payload
Image magic_number: 0x544f4952
Image Version: 0x6685d4df
Image start address: 0x08066200
Header chksum: 0xb090430d

suit_worker: update successful
suit_worker: rebooting...
----> ethos: hello received
Failed to send flush request: Operation not permitted
gnrc_uhcpc: Using 5 as border interface and 0 as wireless interface.
gnrc_uhcpc: only one interface found, skipping setup.
main(): This is RIOT! (Version: 2024.07-devel-2-g17d52-pr/wb55_adc)
RIOT SUIT update example application
Running from slot 1
Image magic_number: 0x544f4952
Image Version: 0x6685d4df
Image start address: 0x08066200
Header chksum: 0xb090430d

Starting the shell
> ifconfig
ifconfig
Iface  5  HWaddr: E6:A6:36:71:18:E9 
          L2-PDU:1500  MTU:1500  HL:64  Source address length: 6
          Link type: wired
          inet6 addr: fe80::e4a6:36ff:fe71:18e9  scope: link  VAL
pinging node...
PING fe80::e4a6:36ff:fe71:18e9%riot0(fe80::e4a6:36ff:fe71:18e9%riot0) 56 data bytes

--- fe80::e4a6:36ff:fe71:18e9%riot0 ping statistics ---
1 packets transmitted, 1 received, 0% packet loss, time 0ms
rtt min/avg/max/mdev = 39.815/39.815/39.815/0.000 ms
pinging node succeeded.

          inet6 addr: fe80::2  scope: link  VAL
          inet6 group: ff02::1
          inet6 group: ff02::1:ff71:18e9
          inet6 group: ff02::1:ff00:2

> suit seq_no

> 
> suit seq_no
seq_no: 0x6685d4df
> compiling /home/chris/flashdev-riot/RIOT/dist/tools/riotboot_gen_hdr/bin/genhdr...
make: Nothing to be done for 'all'.
creating /home/chris/flashdev-riot/RIOT/examples/suit_update/bin/p-nucleo-wb55/riotboot_files/slot0.1720046816.bin...
creating /home/chris/flashdev-riot/RIOT/examples/suit_update/bin/p-nucleo-wb55/riotboot_files/slot1.1720046816.bin...
published "/home/chris/flashdev-riot/RIOT/examples/suit_update/bin/p-nucleo-wb55/suit_files/riot.suit.1720046816.bin"
       as "coap://[fd00:dead:beef::1]/fw/suit_update/p-nucleo-wb55/riot.suit.1720046816.bin"
published "/home/chris/flashdev-riot/RIOT/examples/suit_update/bin/p-nucleo-wb55/suit_files/riot.suit.latest.bin"
       as "coap://[fd00:dead:beef::1]/fw/suit_update/p-nucleo-wb55/riot.suit.latest.bin"
published "/home/chris/flashdev-riot/RIOT/examples/suit_update/bin/p-nucleo-wb55/riotboot_files/slot0.1720046816.bin"
       as "coap://[fd00:dead:beef::1]/fw/suit_update/p-nucleo-wb55/slot0.1720046816.bin"
published "/home/chris/flashdev-riot/RIOT/examples/suit_update/bin/p-nucleo-wb55/riotboot_files/slot1.1720046816.bin"
       as "coap://[fd00:dead:beef::1]/fw/suit_update/p-nucleo-wb55/slot1.1720046816.bin"
aiocoap-client -m POST "coap://[fe80::e4a6:36ff:fe71:18e9%riot0]/suit/trigger" \
    --payload "coap://[fd00:dead:beef::1]/fw/suit_update/p-nucleo-wb55/riot.suit.1720046816.bin" && \
    echo "Triggered [fe80::e4a6:36ff:fe71:18e9%riot0] to update."
Triggered [fe80::e4a6:36ff:fe71:18e9%riot0] to update.
suit: received URL: "coap://[fd00:dead:beef::1]/fw/suit_update/p-nucleo-wb55/riot.suit.1720046816.bin"
suit_worker: started.
suit_worker: downloading "coap://[fd00:dead:beef::1]/fw/suit_update/p-nucleo-wb55/riot.suit.1720046816.bin"
suit_worker: got manifest with size 501
suit: verifying manifest signature
suit: validated manifest version
Manifest seq_no: 1720046816, highest available: 1720046815
suit: validated sequence number
Formatted component name: 
Comparing manifest offset 2000 with other slot offset
validating vendor ID
Comparing 547d0d74-6d3a-5a92-9662-4881afd9407b to 547d0d74-6d3a-5a92-9662-4881afd9407b from manifest
validating vendor ID: OK
validating class id
Comparing 358349c8-0175-58c6-b485-315d784b8368 to 358349c8-0175-58c6-b485-315d784b8368 from manifest
validating class id: OK
Comparing manifest offset 2000 with other slot offset
SUIT policy check OK.
Formatted component name: 
riotboot_flashwrite: initializing update to target slot 0
Fetching firmware |████                     |  14%*** RIOT kernel panic:
HARD FAULT HANDLER

*** rebooting...

----> ethos: hello received
Failed to send flush request: Operation not permitted
gnrc_uhcpc: Using 5 as border interface and 0 as wireless interface.
gnrc_uhcpc: only one interface found, skipping setup.
main(): This is RIOT! (Version: 2024.07-devel-2-g17d52-pr/wb55_adc)
RIOT SUIT update example application
Running from slot 1
Image magic_number: 0x544f4952
Image Version: 0x6685d4df
Image start address: 0x08066200
Header chksum: 0xb090430d

Starting the shell
> Timeout in expect script at "return child.expect(" (examples/suit_update/tests-with-config/01-run.py:92)

make: *** [/home/chris/flashdev-riot/RIOT/makefiles/tests/tests.inc.mk:70: test-with-config] Fehler 1
make: Verzeichnis „/home/chris/flashdev-riot/RIOT/examples/suit_update“ wird verlassen

However when I tested it again, it worked. Maybe I wiggled the USB cable or something:

chris@ThinkPias:~/flashdev-riot/RIOT/examples/suit_update$ BOARD=p-nucleo-wb55 make test-with-config
make -C benchmark_udp
make[2]: Für das Ziel „all“ ist nichts zu tun.
make -C dose
make[2]: Für das Ziel „all“ ist nichts zu tun.
make -C ethos
make[2]: Für das Ziel „all“ ist nichts zu tun.
make -C uhcpd
make[2]: Für das Ziel „all“ ist nichts zu tun.
make -C sliptty
make[2]: Für das Ziel „all“ ist nichts zu tun.
make -C zep_dispatch
cc -g -O3 -Wall -Wextra -I/home/chris/flashdev-riot/RIOT/core/lib/include -I/home/chris/flashdev-riot/RIOT/cpu/native/include -I/home/chris/flashdev-riot/RIOT/drivers/include -I/home/chris/flashdev-riot/RIOT/sys/include -DNDEBUG   main.c topology.c zep_parser.c /home/chris/flashdev-riot/RIOT/sys/net/link_layer/ieee802154/ieee802154.c /home/chris/flashdev-riot/RIOT/sys/fmt/fmt.c /home/chris/flashdev-riot/RIOT/sys/net/link_layer/l2util/l2util.c -o bin/zep_dispatch

/usr/bin/make -C benchmark_udp
make[3]: Für das Ziel „all“ ist nichts zu tun.
/usr/bin/make -C dose
make[3]: Für das Ziel „all“ ist nichts zu tun.
/usr/bin/make -C ethos
make[3]: Für das Ziel „all“ ist nichts zu tun.
/usr/bin/make -C uhcpd
make[3]: Für das Ziel „all“ ist nichts zu tun.
/usr/bin/make -C sliptty
make[3]: Für das Ziel „all“ ist nichts zu tun.
/usr/bin/make -C zep_dispatch
cc -g -O3 -Wall -Wextra -I/home/chris/flashdev-riot/RIOT/core/lib/include -I/home/chris/flashdev-riot/RIOT/cpu/native/include -I/home/chris/flashdev-riot/RIOT/drivers/include -I/home/chris/flashdev-riot/RIOT/sys/include -DNDEBUG  topogen.c -o bin/topogen -lm
/home/chris/flashdev-riot/RIOT/dist/tools/ethos/ethos riot0 /dev/ttyACM0 
----> ethos: sending hello.
----> ethos: activating serial pass through.
----> ethos: hello received
gnrc_uhcpc: Using 5 as border interface and 0 as wireless interface.
gnrc_uhcpc: only one interface found, skipping setup.
main(): This is RIOT! (Version: 2024.07-devel-2-g17d52-pr/wb55_adc)
RIOT SUIT update example application
Running from slot 0
Image magic_number: 0x544f4952
Image Version: 0x6685dbcb
Image start address: 0x08002200
Header chksum: 0x4c3a09f3

Starting the shell
> ----> ethos: hello received
Failed to send flush request: Operation not permitted
gnrc_uhcpc: Using 5 as border interface and 0 as wireless interface.
gnrc_uhcpc: only one interface found, skipping setup.
main(): This is RIOT! (Version: 2024.07-devel-2-g17d52-pr/wb55_adc)
RIOT SUIT update example application
Running from slot 0
Image magic_number: 0x544f4952
Image Version: 0x6685dbcb
Image s----> ethos: hello reply received
Failed to send flush request: Operation not permitted

suit seq_no

> 
> 
> 
> suit seq_no
seq_no: 0x6685dbcb
> ifconfig
ifconfig
Iface  5  HWaddr: E6:A6:36:71:18:E9 
          L2-PDU:1500  MTU:1500  HL:64  Source address length: 6
          Link type: wired
          inet6 addr: fe80::e4a6:36ff:fe71:18e9  scope: link  VAL
pinging node...
PING fe80::e4a6:36ff:fe71:18e9%riot0(fe80::e4a6:36ff:fe71:18e9%riot0) 56 data bytes

--- fe80::e4a6:36ff:fe71:18e9%riot0 ping statistics ---
1 packets transmitted, 1 received, 0% packet loss, time 0ms
rtt min/avg/max/mdev = 40.754/40.754/40.754/0.000 ms
pinging node succeeded.
suit
          inet6 addr: fe80::2  scope: link  VAL
          inet6 group: ff02::1
          inet6 group: ff02::1:ff71:18e9
          inet6 group: ff02::1:ff00:2

> suit
Usage: suit fetch <manifest url>
compiling /home/chris/flashdev-riot/RIOT/dist/tools/riotboot_gen_hdr/bin/genhdr...
make: Nothing to be done for 'all'.
creating /home/chris/flashdev-riot/RIOT/examples/suit_update/bin/p-nucleo-wb55/riotboot_files/slot0.1720048588.bin...
creating /home/chris/flashdev-riot/RIOT/examples/suit_update/bin/p-nucleo-wb55/riotboot_files/slot1.1720048588.bin...
published "/home/chris/flashdev-riot/RIOT/examples/suit_update/bin/p-nucleo-wb55/suit_files/riot.suit.1720048588.bin"
       as "coap://[fd00:dead:beef::1]/fw/suit_update/p-nucleo-wb55/riot.suit.1720048588.bin"
published "/home/chris/flashdev-riot/RIOT/examples/suit_update/bin/p-nucleo-wb55/suit_files/riot.suit.latest.bin"
       as "coap://[fd00:dead:beef::1]/fw/suit_update/p-nucleo-wb55/riot.suit.latest.bin"
published "/home/chris/flashdev-riot/RIOT/examples/suit_update/bin/p-nucleo-wb55/riotboot_files/slot0.1720048588.bin"
       as "coap://[fd00:dead:beef::1]/fw/suit_update/p-nucleo-wb55/slot0.1720048588.bin"
published "/home/chris/flashdev-riot/RIOT/examples/suit_update/bin/p-nucleo-wb55/riotboot_files/slot1.1720048588.bin"
       as "coap://[fd00:dead:beef::1]/fw/suit_update/p-nucleo-wb55/slot1.1720048588.bin"
aiocoap-client -m POST "coap://[fe80::e4a6:36ff:fe71:18e9%riot0]/suit/trigger" \
    --payload "coap://[fd00:dead:beef::1]/fw/suit_update/p-nucleo-wb55/riot.suit.1720048588.bin" && \
    echo "Triggered [fe80::e4a6:36ff:fe71:18e9%riot0] to update."
Triggered [fe80::e4a6:36ff:fe71:18e9%riot0] to update.
       suit seq_no
       suit revert
> suit: received URL: "coap://[fd00:dead:beef::1]/fw/suit_update/p-nucleo-wb55/riot.suit.1720048588.bin"
suit_worker: started.
suit_worker: downloading "coap://[fd00:dead:beef::1]/fw/suit_update/p-nucleo-wb55/riot.suit.1720048588.bin"
suit_worker: got manifest with size 501
suit: verifying manifest signature
Unable to validate signature: -2
compiling /home/chris/flashdev-riot/RIOT/dist/tools/riotboot_gen_hdr/bin/genhdr...
make: Nothing to be done for 'all'.
creating /home/chris/flashdev-riot/RIOT/examples/suit_update/bin/p-nucleo-wb55/riotboot_files/slot0.1720048587.bin...
creating /home/chris/flashdev-riot/RIOT/examples/suit_update/bin/p-nucleo-wb55/riotboot_files/slot1.1720048587.bin...
published "/home/chris/flashdev-riot/RIOT/examples/suit_update/bin/p-nucleo-wb55/suit_files/riot.suit.1720048587.bin"
       as "coap://[fd00:dead:beef::1]/fw/suit_update/p-nucleo-wb55/riot.suit.1720048587.bin"
published "/home/chris/flashdev-riot/RIOT/examples/suit_update/bin/p-nucleo-wb55/suit_files/riot.suit.latest.bin"
       as "coap://[fd00:dead:beef::1]/fw/suit_update/p-nucleo-wb55/riot.suit.latest.bin"
published "/home/chris/flashdev-riot/RIOT/examples/suit_update/bin/p-nucleo-wb55/riotboot_files/slot0.1720048587.bin"
       as "coap://[fd00:dead:beef::1]/fw/suit_update/p-nucleo-wb55/slot0.1720048587.bin"
published "/home/chris/flashdev-riot/RIOT/examples/suit_update/bin/p-nucleo-wb55/riotboot_files/slot1.1720048587.bin"
       as "coap://[fd00:dead:beef::1]/fw/suit_update/p-nucleo-wb55/slot1.1720048587.bin"
aiocoap-client -m POST "coap://[fe80::e4a6:36ff:fe71:18e9%riot0]/suit/trigger" \
    --payload "coap://[fd00:dead:beef::1]/fw/suit_update/p-nucleo-wb55/riot.suit.1720048587.bin" && \
    echo "Triggered [fe80::e4a6:36ff:fe71:18e9%riot0] to update."
Triggered [fe80::e4a6:36ff:fe71:18e9%riot0] to update.
suit_worker: suit_parse() failed. res=-6
suit_worker: update failed, hdr invalid
 suit: received URL: "coap://[fd00:dead:beef::1]/fw/suit_update/p-nucleo-wb55/riot.suit.1720048587.bin"
suit_worker: started.
suit_worker: downloading "coap://[fd00:dead:beef::1]/fw/suit_update/p-nucleo-wb55/riot.suit.1720048587.bin"
suit_worker: got manifest with size 501
suit: verifying manifest signature
suit: validated manifest version
Manifest seq_no: 1720048587, highest available: 1720048587
seq_nr <= running image
compiling /home/chris/flashdev-riot/RIOT/dist/tools/riotboot_gen_hdr/bin/genhdr...
make: Nothing to be done for 'all'.
creating /home/chris/flashdev-riot/RIOT/examples/suit_update/bin/p-nucleo-wb55/riotboot_files/slot0.1720048588.bin...
creating /home/chris/flashdev-riot/RIOT/examples/suit_update/bin/p-nucleo-wb55/riotboot_files/slot1.1720048588.bin...
published "/home/chris/flashdev-riot/RIOT/examples/suit_update/bin/p-nucleo-wb55/suit_files/riot.suit.1720048588.bin"
       as "coap://[fd00:dead:beef::1]/fw/suit_update/p-nucleo-wb55/riot.suit.1720048588.bin"
published "/home/chris/flashdev-riot/RIOT/examples/suit_update/bin/p-nucleo-wb55/suit_files/riot.suit.latest.bin"
       as "coap://[fd00:dead:beef::1]/fw/suit_update/p-nucleo-wb55/riot.suit.latest.bin"
published "/home/chris/flashdev-riot/RIOT/examples/suit_update/bin/p-nucleo-wb55/riotboot_files/slot0.1720048588.bin"
       as "coap://[fd00:dead:beef::1]/fw/suit_update/p-nucleo-wb55/slot0.1720048588.bin"
published "/home/chris/flashdev-riot/RIOT/examples/suit_update/bin/p-nucleo-wb55/riotboot_files/slot1.1720048588.bin"
       as "coap://[fd00:dead:beef::1]/fw/suit_update/p-nucleo-wb55/slot1.1720048588.bin"
aiocoap-client -m POST "coap://[fe80::e4a6:36ff:fe71:18e9%riot0]/suit/trigger" \
    --payload "coap://[fd00:dead:beef::1]/fw/suit_update/p-nucleo-wb55/riot.suit.1720048588.bin" && \
    echo "Triggered [fe80::e4a6:36ff:fe71:18e9%riot0] to update."
Triggered [fe80::e4a6:36ff:fe71:18e9%riot0] to update.
suit_worker: suit_parse() failed. res=-5
suit_worker: update failed, hdr invalid
 suit: received URL: "coap://[fd00:dead:beef::1]/fw/suit_update/p-nucleo-wb55/riot.suit.1720048588.bin"
suit_worker: started.
suit_worker: downloading "coap://[fd00:dead:beef::1]/fw/suit_update/p-nucleo-wb55/riot.suit.1720048588.bin"
suit_worker: got manifest with size 501
suit: verifying manifest signature
suit: validated manifest version
Manifest seq_no: 1720048588, highest available: 1720048587
suit: validated sequence number
Formatted component name: 
Comparing manifest offset 2000 with other slot offset
Comparing manifest offset 66000 with other slot offset
validating vendor ID
Comparing 547d0d74-6d3a-5a92-9662-4881afd9407b to 547d0d74-6d3a-5a92-9662-4881afd9407b from manifest
validating vendor ID: OK
validating class id
Comparing 358349c8-0175-58c6-b485-315d784b8368 to 358349c8-0175-58c6-b485-315d784b8368 from manifest
validating class id: OK
Comparing manifest offset 2000 with other slot offset
Comparing manifest offset 66000 with other slot offset
SUIT policy check OK.
Formatted component name: 
riotboot_flashwrite: initializing update to target slot 1
Fetching firmware |█████████████████████████| 100%
Finalizing payload store
Verifying image digest
Starting digest verification against image
Install correct payload
Verified installed payload
Verifying image digest
Starting digest verification against image
Verified installed payload
Image magic_number: 0x544f4952
Image Version: 0x6685dbcc
Image start address: 0x08066200
Header chksum: 0xcc4449fa

suit_worker: update successful
suit_worker: rebooting...
----> ethos: hello received
Failed to send flush request: Operation not permitted
gnrc_uhcpc: Using 5 as border interface and 0 as wireless interface.
gnrc_uhcpc: only one interface found, skipping setup.
main(): This is RIOT! (Version: 2024.07-devel-2-g17d52-pr/wb55_adc)
RIOT SUIT update example application
Running from slot 1
Image magic_number: 0x544f4952
Image Version: 0x6685dbcc
Image start address: 0x08066200
Header chksum: 0xcc4449fa

Starting the shell
> ifconfig
ifconfig
Iface  5  HWaddr: E6:A6:36:71:18:E9 
          L2-PDU:1500  MTU:1500  HL:64  Source address length: 6
          Link type: wired
          inet6 addr: fe80::e4a6:36ff:fe71:18e9  scope: link  VAL
pinging node...
PING fe80::e4a6:36ff:fe71:18e9%riot0(fe80::e4a6:36ff:fe71:18e9%riot0) 56 data bytes

--- fe80::e4a6:36ff:fe71:18e9%riot0 ping statistics ---
1 packets transmitted, 1 received, 0% packet loss, time 0ms
rtt min/avg/max/mdev = 40.444/40.444/40.444/0.000 ms
pinging node succeeded.

          inet6 addr: fe80::2  scope: link  VAL
          inet6 group: ff02::1
          inet6 group: ff02::1:ff71:18e9
          inet6 group: ff02::1:ff00:2

> suit seq_no

> 
> suit seq_no
seq_no: 0x6685dbcc
> compiling /home/chris/flashdev-riot/RIOT/dist/tools/riotboot_gen_hdr/bin/genhdr...
make: Nothing to be done for 'all'.
creating /home/chris/flashdev-riot/RIOT/examples/suit_update/bin/p-nucleo-wb55/riotboot_files/slot0.1720048589.bin...
creating /home/chris/flashdev-riot/RIOT/examples/suit_update/bin/p-nucleo-wb55/riotboot_files/slot1.1720048589.bin...
published "/home/chris/flashdev-riot/RIOT/examples/suit_update/bin/p-nucleo-wb55/suit_files/riot.suit.1720048589.bin"
       as "coap://[fd00:dead:beef::1]/fw/suit_update/p-nucleo-wb55/riot.suit.1720048589.bin"
published "/home/chris/flashdev-riot/RIOT/examples/suit_update/bin/p-nucleo-wb55/suit_files/riot.suit.latest.bin"
       as "coap://[fd00:dead:beef::1]/fw/suit_update/p-nucleo-wb55/riot.suit.latest.bin"
published "/home/chris/flashdev-riot/RIOT/examples/suit_update/bin/p-nucleo-wb55/riotboot_files/slot0.1720048589.bin"
       as "coap://[fd00:dead:beef::1]/fw/suit_update/p-nucleo-wb55/slot0.1720048589.bin"
published "/home/chris/flashdev-riot/RIOT/examples/suit_update/bin/p-nucleo-wb55/riotboot_files/slot1.1720048589.bin"
       as "coap://[fd00:dead:beef::1]/fw/suit_update/p-nucleo-wb55/slot1.1720048589.bin"
aiocoap-client -m POST "coap://[fe80::e4a6:36ff:fe71:18e9%riot0]/suit/trigger" \
    --payload "coap://[fd00:dead:beef::1]/fw/suit_update/p-nucleo-wb55/riot.suit.1720048589.bin" && \
    echo "Triggered [fe80::e4a6:36ff:fe71:18e9%riot0] to update."
Triggered [fe80::e4a6:36ff:fe71:18e9%riot0] to update.
suit: received URL: "coap://[fd00:dead:beef::1]/fw/suit_update/p-nucleo-wb55/riot.suit.1720048589.bin"
suit_worker: started.
suit_worker: downloading "coap://[fd00:dead:beef::1]/fw/suit_update/p-nucleo-wb55/riot.suit.1720048589.bin"
suit_worker: got manifest with size 501
suit: verifying manifest signature
suit: validated manifest version
Manifest seq_no: 1720048589, highest available: 1720048588
suit: validated sequence number
Formatted component name: 
Comparing manifest offset 2000 with other slot offset
validating vendor ID
Comparing 547d0d74-6d3a-5a92-9662-4881afd9407b to 547d0d74-6d3a-5a92-9662-4881afd9407b from manifest
validating vendor ID: OK
validating class id
Comparing 358349c8-0175-58c6-b485-315d784b8368 to 358349c8-0175-58c6-b485-315d784b8368 from manifest
validating class id: OK
Comparing manifest offset 2000 with other slot offset
SUIT policy check OK.
Formatted component name: 
riotboot_flashwrite: initializing update to target slot 0
Fetching firmware |█████████████████████████| 100%
Finalizing payload store
Verifying image digest
Starting digest verification against image
Install correct payload
Verified installed payload
Verifying image digest
Starting digest verification against image
Verified installed payload
Image magic_number: 0x544f4952
Image Version: 0x6685dbcd
Image start address: 0x08002200
Header chksum: 0x4c4209f5

suit_worker: update successful
suit_worker: rebooting...
----> ethos: hello received
Failed to send flush request: Operation not permitted
gnrc_uhcpc: Using 5 as border interface and 0 as wireless interface.
gnrc_uhcpc: only one interface found, skipping setup.
main(): This is RIOT! (Version: 2024.07-devel-2-g17d52-pr/wb55_adc)
RIOT SUIT update example application
Running from slot 0
Image magic_number: 0x544f4952
Image Version: 0x6685dbcd
Image start address: 0x08002200
Header chksum: 0x4c4209f5

Starting the shell
> ifconfig
ifconfig
Iface  5  HWaddr: E6:A6:36:71:18:E9 
          L2-PDU:1500  MTU:1500  HL:64  Source address length: 6
          Link type: wired
          inet6 addr: fe80::e4a6:36ff:fe71:18e9  scope: link  VAL
pinging node...
PING fe80::e4a6:36ff:fe71:18e9%riot0(fe80::e4a6:36ff:fe71:18e9%riot0) 56 data bytes

--- fe80::e4a6:36ff:fe71:18e9%riot0 ping statistics ---
1 packets transmitted, 1 received, 0% packet loss, time 0ms
rtt min/avg/max/mdev = 40.572/40.572/40.572/0.000 ms
pinging node succeeded.

          inet6 addr: fe80::2  scope: link  VAL
          inet6 group: ff02::1
          inet6 group: ff02::1:ff71:18e9
          inet6 group: ff02::1:ff00:2

> suit seq_no

> 
> suit seq_no
seq_no: 0x6685dbcd
> TEST PASSED
maribu commented 3 weeks ago

@crasbe: Thx for looking into this ❤️