Skip to content

Conversation

chrysn
Copy link
Contributor

@chrysn chrysn commented May 16, 2025

This option applies the requested operation at all connected bootloaders.

There's one use case I think for which this is really practical: listing the devices using --get-image or --all.

When --all is given, the device (and serial number) is shown in front of all items, so you might get:

$ nrfdfu --all
Port /dev/ttyACM2 (serial: "EB86723B4658")
Port /dev/ttyACM3 (serial: "D2C505A7E0C6")
error: No actions performed; provide an .elf file on the command line to flash, or set querying options.
$ nrfdfu --all --get-images
Port /dev/ttyACM2 (serial: "EB86723B4658")
* image 0: Bootloader, version 0. Starting 0xe0000, length 122880.
* image 1: Application, version 0. Starting 0x1000, length 9412.
Port /dev/ttyACM3 (serial: "D2C505A7E0C6")
* image 0: Bootloader, version 0. Starting 0xe0000, length 122880.
* image 1: Application, version 0. Starting 0x1000, length 19556.

I'm not sure there are use cases for all combinations, but they kind of fall out neatly from how things are set up -- so you can also flash a file to all connected chips (convenient device-to-device tests) or reboot them all into the firmware. The most useful application IMO is getting the serial numbers for later use with --serial -- that wouldn't need --all fundamentally, but it fits nicely. I'm open to other ideas just as well (eg. not making it too --allish and instead having a --list option that behaves largely like --all now standalone, but only combines with --get-images). Or anything else that makes this better user-experience-wise.

chrysn added 4 commits May 16, 2025 23:07
This allows keeping the image immutable for longer time, simplifying
multiple operations on it.
A comment is added explaining why the "nothing happened" error was
always in the tail position.
@jonathanpallant
Copy link
Collaborator

Looks good to me - just one query about the phrasing.

@chrysn
Copy link
Contributor Author

chrysn commented May 19, 2025

Thanks for the review, I've applied the suggestion.

(Also, I don't have anything immediate in the pipeline -- I do want to have a look at #17 at some point, but that'll have to wait a bit. So if the current activity around this package, which I think was caused by people looking into using nrf52840dongle for Ariel OS, has otherwise subsided, after this might be a good time for a release if you could manage.)

@jonathanpallant
Copy link
Collaborator

Perfect timing. I have a training starting Wednesday.

@jonathanpallant jonathanpallant merged commit 7935ad8 into knurling-rs:main May 19, 2025
4 checks passed
@chrysn chrysn deleted the all-devices branch May 19, 2025 13:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants