1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2024-12-29 04:50:03 +01:00
RIOT/tests/riotboot_flashwrite
bors[bot] 0101663e39
Merge #19485
19485: sys/shell: Fix missing dependency r=aabadie a=maribu

### Contribution description

The shell commands depend on the shell module being use. This was already the case in KConfig, but was overlooked in the shell's `Makefile.dep`.

In addition, this uncovered that `tests/memarray` had a bogus dependency on shell commands without every using the shell.

### Testing procedure

Ideally binaries should not differ (except for debug section).

### Issues/PRs references

Split out of https://github.com/RIOT-OS/RIOT/pull/19483

Co-authored-by: Marian Buschsieweke <marian.buschsieweke@ovgu.de>
2023-04-22 06:21:38 +00:00
..
tests-with-config makefiles/boot/riotboot: refactor file storage and naming 2022-04-21 11:39:25 +02:00
coap_handler.c examples: check return value of coap_build_reply() 2022-11-04 20:00:51 +01:00
main.c tests/riotboot/flashwrite: add automatic test 2021-06-07 08:55:34 +02:00
Makefile examples,tests: Drop redundant dependency 2023-04-19 16:58:10 +02:00
Makefile.ci tests/riotboot_flashwrite: blacklist GD32V boards 2023-04-19 12:54:35 +02:00
README.md makefiles/boot/riotboot: refactor file storage and naming 2022-04-21 11:39:25 +02:00

Introduction

This test application allows to test the riotboot_flashwrite module over coap.

WARNING: never use this code for anything else. It allows updating the device over network without any kind of authentication or other security!

Please see the README of examples/nanocoap_server for instructions on how to set up a network for testing.

Requirements

This test uses aiocoap to send the firmware to the device over coap.

How to test over Ethos

First set up the network:

$ sudo dist/tools/ethos/setup_network.sh riot0 2001:db8::/64

Then provide de device and test:

$ BOARD=<board> make flash test-with-config

How to test over the air (802.15.4)

On another device setup a BR and start start_network.sh on that device serial port.

$ BOARD=<board> make -C examples/gnrc_border_router flash

$ sudo dist/tools/ethos/start_network.sh /dev/ttyACMx riot0 2001:db8::/64

Then provide the device and test:

$ USE_ETHOS=0 BOARD=<board> make flash test-with-config

Manual test

First, compile and flash with riotboot enabled:

$ BOARD=<board> make flash

Confirm it booted from slot 0 (it should print "Current slot=0"), then recompile in order to get an image for the second slot with a newer version number:

$ BOARD=<board> make riotboot

Then send via CoAP, for example, with libcoap's coap_client:

$ coap-client -m post coap://[<ip address of node>]/flashwrite \
   -f bin/<board>/riotboot_files/slot1.bin -b 64

Then reboot the node manually, confirming that it booted from slot 1.