Skip to content

dist/testbed-support: add reset after flash for IoT-LAB nodes#22287

Closed
baptleduc wants to merge 1 commit into
RIOT-OS:masterfrom
baptleduc:fix/iotlab-flash-recipe
Closed

dist/testbed-support: add reset after flash for IoT-LAB nodes#22287
baptleduc wants to merge 1 commit into
RIOT-OS:masterfrom
baptleduc:fix/iotlab-flash-recipe

Conversation

@baptleduc

@baptleduc baptleduc commented May 12, 2026

Copy link
Copy Markdown
Contributor

makefile.iotlab.single.inc.mk does not define flash-recipe, so it falls back to the default defined in Makefile.include:832:

define default-flash-recipe
  $(call check_cmd,$(FLASHER),Flash program)
  $(PROGRAMMER_FLASH)
endef
flash-recipe ?= $(default-flash-recipe)

This default doesn't reset the board after flashing. As a result, the node does not restart automatically and produces no output until a manual reset is triggered.

This was observed on b-l072z-lrwan1 nodes at the IoT-LAB Saclay site: examples/basic/hello-world produced no serial output after make flash term until the node was reset manually.

Fix: define an iotlab-flash-recipe that appends a reset step after flashing.

Testing procedure

Tested on b-l072z-lrwan1 at IoT-LAB Saclay. After flashing, the node now resets automatically and serial output appears immediately without manual intervention.

Issues/PRs references

Originally posted in #22271 (comment)

Declaration of AI Tools / LLMs usage

  • Claude Code for code review and guidance, with user authorship of the implementation

Without an explicit flash-recipe, the default was used which skips
the node reset. The iotlab-flash-recipe now runs reset after flash
to ensure the firmware starts correctly.

Signed-off-by: Baptiste Le Duc <baptiste.le-duc@vates.tech>
@github-actions github-actions Bot added Area: build system Area: Build system Area: tools Area: Supplementary tools labels May 12, 2026
@crasbe crasbe added Type: bug The issue reports a bug / The PR fixes a bug (including spelling errors) CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR labels May 12, 2026
@riot-ci

riot-ci commented May 12, 2026

Copy link
Copy Markdown

Murdock results

✔️ PASSED

def4576 dist/testbed-support: add flash-recipe to iotlab

Success Failures Total Runtime
1 0 1 01m:21s

Artifacts

@AnnsAnns

Copy link
Copy Markdown
Member

🤔 I wonder whether this also fixes some release test weirdness with iotlab

@crasbe

crasbe commented May 13, 2026

Copy link
Copy Markdown
Contributor

🤔 I wonder whether this also fixes some release test weirdness with iotlab

There is only one way to find out... Do another release! 😈

@baptleduc

Copy link
Copy Markdown
Contributor Author

🤔 I wonder whether this also fixes some release test weirdness with iotlab

There is only one way to find out... Do another release! 😈

Could I help you in any way ?

@crasbe

crasbe commented May 14, 2026

Copy link
Copy Markdown
Contributor

🤔 I wonder whether this also fixes some release test weirdness with iotlab

There is only one way to find out... Do another release! 😈

Could I help you in any way ?

That was just a joke. The release tests can be run without doing a release too :D

@baptleduc

baptleduc commented May 14, 2026

Copy link
Copy Markdown
Contributor Author

🤔 I wonder whether this also fixes some release test weirdness with iotlab

There is only one way to find out... Do another release! 😈

Could I help you in any way ?

That was just a joke. The release tests can be run without doing a release too :D

Oops 😅😂

But do you want me to open a PR in te iot lab repo ?

@baptleduc

Copy link
Copy Markdown
Contributor Author

Hello,
Is it possible to have an update please ?
Thanks in advance

@crasbe

crasbe commented May 28, 2026

Copy link
Copy Markdown
Contributor

Unfortunately I have no experience with the IoT-LAB, but I pinged the other maintainers to take a look.

@aabadie

aabadie commented May 28, 2026

Copy link
Copy Markdown
Contributor

I tried to flash a RIOT firmware on a b-l072z-lrwan1 board of the IoT-LAB Saclay site. Here is the output:

$ make BOARD=b-l072z-lrwan1 -C examples/basic/default/ flash term IOTLAB_NODE=auto
make: Entering directory '/work/riot/RIOT/examples/basic/default'
Building application "default" for "b-l072z-lrwan1" with CPU "stm32".

[...]

   text	   data	    bss	    dec	    hex	filename
  43164	    124	   6320	  49608	   c1c8	/work/riot/RIOT/examples/basic/default/bin/b-l072z-lrwan1/default.elf
iotlab-node --jmespath='keys(@)[0]' --format='lambda ret: exit(int(ret))'  --list saclay,st-lrwan1,10 --flash /work/riot/RIOT/examples/basic/default/bin/b-l072z-lrwan1/default.bin
ssh -t abadie@saclay.iot-lab.info 'socat - tcp:st-lrwan1-10.saclay.iot-lab.info:20000' 
main(): This is RIOT! (Version: 2025.10-devel-463-gce692)
Welcome to RIOT!
> help
help
Command              Description
---------------------------------------
ifconfig             Configure network interfaces
txtsnd               Sends a custom string as is over the link layer
pm                   interact with layered PM subsystem
ps                   Prints information about running threads.
rtc                  control RTC peripheral interface
saul                 interact with sensors and actuators using SAUL
version              Prints current RIOT_VERSION
reboot               Reboot the node
> ^CConnection to saclay.iot-lab.info closed.

As you can see the firmware starts automatically. So I insist that in your case (you are testing with the "hello-world" application), what you are experiencing is that the firmware has already finished executing when the socat terminal client connect to the serial output.
Just add a "ztimer_sleep(ZTIMER_SEC, 5)" at the beginning of main and add the ztimer dependency in the makefile, and you'll the hello world coming after the 5s delay.

@aabadie

aabadie commented May 28, 2026

Copy link
Copy Markdown
Contributor

Here is the openocd code called when flashing a firmware on those devices in iot-lab: https://github.com/iot-lab/iot-lab-gateway/blob/71ab066ea3229cdcd4be22a5b8e43910888293ef/gateway_code/utils/openocd.py#L72-L79
As you can see the there's a call to "reset run" after the firmware is written on the flash.

@aabadie

aabadie commented May 29, 2026

Copy link
Copy Markdown
Contributor

BTW, the output above was obtained from the master branch of RIOT (to avoid confusion)

@baptleduc

Copy link
Copy Markdown
Contributor Author

Thank you very much for your explanation.
I think we can, therefore, close this PR.

@AnnsAnns

Copy link
Copy Markdown
Member

Thank you for testing this @aabadie and also thank you for initially trying to solve this issue @baptleduc 👍

@AnnsAnns AnnsAnns closed this May 29, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Area: build system Area: Build system Area: tools Area: Supplementary tools CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR Type: bug The issue reports a bug / The PR fixes a bug (including spelling errors)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants