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

Can't flash. Merge.hex error.

Hi, all!

After updating all libs can't flash. Have this error:
Tested also with asset_tracker sample.

Using runner: nrfjprog
nrfjprog --ids
Flashing file: /home/ilya/projects/ncs/asset_tracker/build/zephyr/merged.hex
nrfjprog --program /home/ilya/projects/ncs/asset_tracker/build/zephyr/merged.hex -f NRF91 --snr 960092785 --sectorerase
Parsing hex file.
ERROR: The file specified could not be found.
ERROR: command exited with status 51: nrfjprog --program /home/ilya/projects/ncs/asset_tracker/build/zephyr/merged.hex -f NRF91 --snr 960092785 --sectorerase



  • Hi.

    ERROR: The file specified could not be found.

     Are you sure that the file is located in the path you specified?

    Best regards,

    Andreas

  • Hi, Andreas.

    There is no file merged.hex 
    I think it must be file zephyr.hex as always. But now it is trying to flash merged.hex.

  • Hi.

    Which branch are you using? The master branch?

    Best regards,

    Andreas

  • I am seeing the same thing. On master branch.

    It looks like CMakeCache is showing this path

    //Path to merged image in Intel Hex format
    ZEPHYR_RUNNER_CONFIG_KERNEL_HEX:STRING=C:/PROJECTCODE/ncs/nrf/applications/asset_tracker/build/zephyr/merged.hex

    Here is what happens when I issue flash command

    C:\PROJECTCODE\ncs\nrf\applications\asset_tracker\build>ninja flash
    [141/147] Linking C executable zephyr\zephyr_prebuilt.elf
    Memory region         Used Size  Region Size  %age Used
               FLASH:      169608 B       992 KB     16.70%
                SRAM:       54416 B       128 KB     41.52%
            IDT_LIST:         120 B         2 KB      5.86%
    [146/147] Flashing nrf9160_pca10090ns
    Using runner: nrfjprog
    Flashing file: C:/PROJECTCODE/ncs/nrf/applications/asset_tracker/build/zephyr/merged.hex
    Parsing hex file.
    ERROR: The file specified could not be found.
    ERROR: command exited with status 51: nrfjprog --program C:/PROJECTCODE/ncs/nrf/applications/asset_tracker/build/zephyr/merged.hex -f NRF91 --snr 960072328 --sectorerase

    Traceback (most recent call last):
      File "C:\PROJECTCODE\ncs\.west\west\src\west\main.py", line 580, in main
        args.handler(args, unknown)
      File "C:\PROJECTCODE\ncs\.west\west\src\west\main.py", line 332, in ext_command_handler
        command.run(*west_parser.parse_known_args(argv))
      File "C:\PROJECTCODE\ncs\.west\west\src\west\commands\command.py", line 90, in run
        self.do_run(args, unknown)
      File "c:\projectcode\ncs\zephyr\scripts\west_commands\flash.py", line 32, in do_run
        'ZEPHYR_BOARD_FLASH_RUNNER')
      File "C:\PROJECTCODE\ncs\zephyr\scripts/west_commands\run_common.py", line 228, in do_run_common
        runner.run(command_name)
      File "C:\PROJECTCODE\ncs\zephyr\scripts/west_commands\runners\core.py", line 407, in run
        self.do_run(command, **kwargs)
      File "C:\PROJECTCODE\ncs\zephyr\scripts/west_commands\runners\nrfjprog.py", line 128, in do_run
        self.check_call(cmd)
      File "C:\PROJECTCODE\ncs\zephyr\scripts/west_commands\runners\core.py", line 466, in check_call
        subprocess.check_call(cmd)
      File "c:\python37\lib\subprocess.py", line 347, in check_call
        raise CalledProcessError(retcode, cmd)
    subprocess.CalledProcessError: Command '['nrfjprog', '--program', 'C:/PROJECTCODE/ncs/nrf/applications/asset_tracker/build/zephyr/merged.hex', '-f', 'NRF91', '--snr', '960072328', '--sectorerase']' returned non-zero exit status 51.

Related