katyo / zephyr-rtos.nix

Battle-tested nix env for Zephyr RTOS developers
12 stars 0 forks source link

how to add nrfjprog to west flash a real hardware board? #15

Open jiaqiwang969 opened 1 month ago

jiaqiwang969 commented 1 month ago

I am connect my nrf9160 sd board into the nixos, with zephyr-rtos.nix env.

when i type west flash, it log: fatal error: required program nrfjprog not found; install it or add its location to path

katyo commented 1 month ago

Seems currently NixOS lacks packaging for nrfjprog. Could you seek for alternative flashing options for you hardware (OpenOCD)? Or you can add it youself.

jiaqiwang969 commented 1 month ago

Thanks. I found the way:

First, add J-Link v7.94e

Second, install nrf command line tools

Finally, add path in flake.nix:

devShells = forAllSystems (system: { default = nixpkgsFor.${system}.mkZephyrSdk { shellHook = '' export PATH=$PATH:/opt/nrf-command-line-tools/bin export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/opt/nrf-command-line-tools/lib ''; }; });