FATAL ERROR: required program nrfjprog not found; install it or add its location to PATH

Hi,

I recently followed the instructions to install nRF Connect on Visual Studio by completing Exercise 1 of the nRF Connect SDK Fundamentals course:
Exercise 1-1

I noticed that the SDK seems to be actively updated. A few days ago, the latest version was 3.1.0, but now it is 3.1.1. Additionally, the installation process has changed—Toolchain and SDK are now bundled together.

When I try to flash my project using the VS Code flash button, the west flash command runs, but I encounter the following error:

-- west flash: rebuilding
[0/5] Performing build step for 'tag_v0_1_0'
ninja: no work to do.
[4/5] cmd.exe /C "cd /D Path_to_proj\build\_sysbuild && C:\ncs\toolchains\c1a76fddb2\opt\bin\cmake.exe -E true"
-- west flash: using runner nrfjprog
-- runners.nrfjprog: mass erase requested
-- runners.nrfjprog: reset after flashing requested
FATAL ERROR: required program nrfjprog not found; install it or add its location to PATH

It seems that nrfjprog was part of the nRF Command Line Tool, which is now deprecated.

Could you please advise me on how to resolve this issue?

Best regards,
Luca

  • Hi Luca,
    I can help with that. The nrfjprog tool is deprecated, and we’ve switched to nrfutil. First, can you confirm that you have nrfutil installed?

    Best regards,
    Benjamin

  • Hi Benjamin,

    Yes, I confirm that I have installed nrfutil and added it to the path, as the exercise suggest.

    Thanks in advance for your help.

    Best,

    Luca

  • The runner is set in your board’s CMake files. Runners in West are Python wrappers that provide a unified interface to command line tools for flashing and debugging etc. You need the runner that uses nrfutil. Right now, it’s set to nrfjprog, which you don’t have installed (and don’t want to use).


    What board are you building for? Do you base this on a sample? Do you experience this for other samples?


    For a quick fix, try running:
    west flash --runner nrfutil

    Also check out Choosing a Runner.

  • I'm building for a custom board based on the nRF52840. I have an nRF52840 DK, which I used for prototyping and am currently using to flash the custom board via P19.

    I don’t quite remember how the project was originally set up — I recently changed PCs and migrated the project from the old one. I haven’t run any other samples yet, but flashing with the command you suggested seems to have done the trick.

    I’d like to configure the VS Code extension to use nrfutil so I can continue development within the VS Code GUI. For now, I’m fine flashing the board from the command line with west, as long as that works.

    Thanks for your help, and please let me know if it’s possible to configure VS Code to use nrfutil.

    Best regards,
    Luca

  • You need to update your custom board’s runner settings by modifying the board.cmake file. Add the following line:

    include(${ZEPHYR_BASE}/boards/common/nrfutil.board.cmake)

    Also, note that the line needs to be before the similar line for nrfjprog. If this doesn't work, please share your board.cmake file.

    Best regards,
    Benjamin

Related