This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

[SDK11][GCC][LINUX] Error 127 for nrfjprog [closed]

Hi,
I'm using GCC with SDK11 on linux. I'm able to build successfully. When I try to run "make flash" or "make flash_softdevice", I get error nrfjprog command not found, error 127. I have double checked that nrfjprog is in my path, and I am able to flash the softdevice if I copy the command from Makefile to terminal in the same directory. I am using command line tools 8.4.0 64bit.
Any suggestion would be helpful.

Regards
Lalit

Parents
  • Hi,

    When running "make flash" it should output something like this:

    Flashing: _build/nrf52832_xxaa_s132.hex
    nrfjprog --program _build/nrf52832_xxaa_s132.hex -f nrf52  --sectorerase
    

    If it does not properly detect the .hex file, the output would be like this:

    Flashing: _build/.hex
    nrfjprog --program _build/.hex -f nrf52  --sectorerase
    

    I suspect that you're seeing an output where "make flash" is unable to find the .hex file properly. You can fix this by manually running nrfjprog, or altering the makefile to provide (assuming that you're using nRF52832 in this scenario):

    flash: nrf52832_xxaa_s132
    	@echo Flashing: $(OUTPUT_BINARY_DIRECTORY)/*.hex
    	nrfjprog --program $(OUTPUT_BINARY_DIRECTORY)/*.hex -f nrf52  --sectorerase
    	nrfjprog --reset -f nrf52
    

    Since you're using linux, it will use the wildcard "*" to find the only .hex file in your _build directory.

Reply
  • Hi,

    When running "make flash" it should output something like this:

    Flashing: _build/nrf52832_xxaa_s132.hex
    nrfjprog --program _build/nrf52832_xxaa_s132.hex -f nrf52  --sectorerase
    

    If it does not properly detect the .hex file, the output would be like this:

    Flashing: _build/.hex
    nrfjprog --program _build/.hex -f nrf52  --sectorerase
    

    I suspect that you're seeing an output where "make flash" is unable to find the .hex file properly. You can fix this by manually running nrfjprog, or altering the makefile to provide (assuming that you're using nRF52832 in this scenario):

    flash: nrf52832_xxaa_s132
    	@echo Flashing: $(OUTPUT_BINARY_DIRECTORY)/*.hex
    	nrfjprog --program $(OUTPUT_BINARY_DIRECTORY)/*.hex -f nrf52  --sectorerase
    	nrfjprog --reset -f nrf52
    

    Since you're using linux, it will use the wildcard "*" to find the only .hex file in your _build directory.

Children
  • I'm able to flash the softdevice and program from terminal by typing the command as provided in the makefile, but am unable to do so using "make flash_softdevice" command. The output is

    Flashing: s130_nrf51_2.0.0_softdevice.hex
    nrfjprog --program ../../../../../nordic/nRF5_SDK_11.0.0_89a8197/components/softdevice/s130/hex/s130_nrf51_2.0.0_softdevice.hex -f nrf51 --chiperase
    make: nrfjprog: Command not found
    make: *** [flash_softdevice] Error 127
    
Related