Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

nrfutil uses subcommands incompatible with the latest version #19511

Closed
chrysn opened this issue Apr 25, 2023 · 3 comments · Fixed by #19513
Closed

nrfutil uses subcommands incompatible with the latest version #19511

chrysn opened this issue Apr 25, 2023 · 3 comments · Fixed by #19513
Labels
Area: tools Area: Supplementary tools

Comments

@chrysn
Copy link
Member

chrysn commented Apr 25, 2023

Nordic updated their nrfutil:

  • The 6.x series is deprecated.
  • The 6.x series is also barely usable any more: It doesn't work with Python 3.11 (trying there would install a way older Python 2 version). The workaround I'm using while I have a Python 3.10 around is python3 -m virtualenv --python /usr/bin/python3.10 /tmp/nrfutil -- unlike the builtin venv, virtualenv can create those even for older Python versions.
  • The newer 7.x series is available from their website as a binary only; the 6.x series was not Free Software either, but at least source was available.
  • The 7.x series doesn't work with our Makefiles:
nrfutil pkg generate --hw-version 52 --sd-req 0x00 --application-version 1 --application .../examples/opendsme/bin/nrf52840dongle/opendsme_example.hex .../examples/opendsme/bin/nrf52840dongle/opendsme_example.hex.zip
Error: nrfutil command `pkg` not found. See `nrfutil list` for full list of installed commands, `nrfutil search` for installable commands, and `nrfutil install` for installation of new commands.
                                                                                                          
Caused by:                                                                                                
    Subcommand nrfutil-pkg not found         

AFAICT this only affects the nrf52840dongle as it's the only board that can actually use the (non-adafruit, they forked off some time ago) nrfutil.

I have no clear way forward. Might be "ditch nrfutil and focus on riotboot", but it'd be great to have some way to migrate without using old software and without using an external programmer.

@chrysn chrysn added the Area: tools Area: Supplementary tools label Apr 25, 2023
@aabadie
Copy link
Contributor

aabadie commented Apr 26, 2023

Why not check from the RIOT build system which version of nrfutil is installed and adapt the command line accordingly ?

@chrysn
Copy link
Member Author

chrysn commented Apr 26, 2023

Probably, but given it's nonfree software I'll only touch it when absolutely necessary. The fact that it writes to ~/.nrfutil without asking doesn't make me any happier about using it, and the fact that it tries to create a file /tmp/nrfutil on self-upgrade (tough look, I have a dir there, may I introduce you to mktmp...) gives me serious doubt about its quality of implementation to the point where I'm not sure I'd support it in RIOT at all.

@chrysn
Copy link
Member Author

chrysn commented Apr 26, 2023

... and it also sometimes fails silently (eg. when the USB stack of the target device is just hanging). Great engineering. But anyhow:

Compatible functionality can be restored by running nrfutil install nrf5sdk-tools, and then the RIOT tools at least work. I'll yet have to make up my mind as to whether I'll try to put that into the Makefiles (not pretty, b/c testing for the FLASHER is an automated step, and testing for any special properties would be weird) or just add a note in the documentation, leaning towards the latter.

bors bot added a commit that referenced this issue Apr 26, 2023
19346: pkg/tinydtls: allow build for AVR r=benpicco a=benpicco



19512: SUBSYSTEMS.md: add jia200x to subsystems r=benpicco a=jia200x



19513: boards/nrf52840dongle/doc: Update nrfutil pointers r=benpicco a=chrysn

### Contribution description

Nordic changed its nrfutil; this change adjust to it.

I'm not fully happy with recommending that tool at all due to its bad quality (see rambling in #19511), but short of soldering on a debug header or touch-probing it with wires it's the only way in to the device. I may later add follow-up recommendations to switch to riotboot, but this now at least fixes the immediate issue.

### Testing procedure

* Look at the updated documentation.

### Issues/PRs references

Closes: #19511

19514: dist/testbed-support: remove obsolete boards from iotlab archi r=benpicco a=aabadie



Co-authored-by: Benjamin Valentin <benjamin.valentin@ml-pa.com>
Co-authored-by: Benjamin Valentin <benjamin.valentin@bht-berlin.de>
Co-authored-by: Jose Alamos <jose@alamos.cc>
Co-authored-by: chrysn <chrysn@fsfe.org>
Co-authored-by: Alexandre Abadie <alexandre.abadie@inria.fr>
@bors bors bot closed this as completed in 2b50c61 Apr 26, 2023
zhaolanhuang pushed a commit to zhaolanhuang/RIOT that referenced this issue Dec 6, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area: tools Area: Supplementary tools
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants