FATAL ERROR: required program nrfjprog not found; install it or add its location to PATH
If this error looks familiar to you, probably after installing zephyr and setting west environment you forget about last step which is nrf tools. In this article I will show you how to manually install „nRF Command Line Tools” on linux systems. The nRF Command Line Tools is a necessary tool for development, programming and debugging of Nordic Semiconductor’s nRF51, nRF52, nRF53 and nRF91 Series devices. It includes a few components:
- nrfjprog executable – tool for programming through SEGGER J-LINK programmers and debuggers
- mergehex executable – enables you to combine up to three .HEX files into one single file
- nrfjprog DLL – a DLL that exports functions for programming and controlling nRF51, nRF52, nRF53 and nRF91 Series devices and lets developers create their own development tools using the DLLs API
- SEGGER J-Link software and documentation pack
This software is available for all platforms: Windows, Linux and macOS. Unfortunately installation on Linux is not as simple as running .exe file on a Windows machine, but don’t worry, in this article I will show you step-by-step instructions on how to do that. Let’s get started
- First step is to go to the Nordic Semiconductors webpage https://www.nordicsemi.com/Products/Development-tools/nRF-Command-Line-Tools/Download?lang=en#infotabs where you can find more information about nRF Command Line Tools
- Go to the section „Downloads„, select your Linux system version and save .tar.gz file
- Open terminal and go to the downloaded file. In my case, /home/downloads. Copy downloaded file to the /opt1 directory
Note that the version provided in this article examples is older that your, so check your version and use correct file name.
sudo cp /home/downloads/nrf-command-line-tools-10.24.2_linux-amd64.tar /opt/
- Go to the /opt directory and extract the downloaded archive
cd /opt
sudo tar -xzf nrf-command-line-tools-10.24.2_linux-amd64.tar.gz
- Install JLink
- go to https://www.segger.com/downloads/jlink and download proper version
- Install deb package
cd /home/downloads/
sudo dpkg -i JLink_Linux_V798g_X86_64.deb
- Follow the instructions to create links into /usr/local/bin, so you can run installed programs from every place
cd /usr/local/bin
sudo ln -s /opt/nrf-command-line-tools/bin/nrfjprog /usr/local/bin/nrfjprog
sudo ln -s /opt/nrf-command-line-tools/bin/mergehex /usr/local/bin/mergehex
- Go back to $HOME and check if you can run nrfjprog and mergehex
nrfjprog --version
mergehex --version
NOTES:
- The „/opt” directory is a designated location for optional software installations, separating them from the core operating system components ↩︎
SOURCES:
- https://torun4ever.com/zephyr-install-ubuntu-20-04/
- https://www.nordicsemi.com/Products/Development-tools/nRF-Command-Line-Tools/Download?lang=en#infotabs
TROUBLESHOOTING:
- If you run into problem with JLinkARM DLL library „ERROR: JLinkARM DLL load failed. Try again. If it keeps failing, please reinstall latest JLinkARM from Segger webpage”. Make sure you follow
[…] to find the right archive, there are a few simple steps to follow. Some time ago I covered the manual installation of nrfprog. You may want to check it out as it is very similar. Today I will show you how to install the stm32 […]