FATAL ERROR: command exited with status 1: /opt/SEGGER/JLink_V770e/JLinkExe -nogui 1 -if swd -speed 4000 -device nrf52 -CommanderScript /tmp/tmp9lqsoklajlink/runner.jlink -nogui 1

Hello, 

I am getting an error when I try to flash my device with j-link (see capture I attach) and this is some information I have:

-I can flash correctly with zephyr 3.2.0 vanila but now that I am working with NCS 2.2.0 I get this error.

-I can flash other devices with the same microcontroller (nrf52840) and NCS 2.2.0, so I just get this error in one of the devices I have.

I hope you can help me and I can provide you all information you need.

Best regards

  • Hi Naeem,

    no worries I hope your vacation were good, I have no problem when I try to flash a sample but I observed the proces when I use the comand west flash is not the same for a sample of nrf than for my application:

    This is for an nrf sample, seems that flash a ile called merge.hex

    This is for my aplication, I think just flashes zephyr.hex:

    Maybe I added my project incorrectly? This is the structure of my project (watchman):

    This is how I add watchman to the project, adding those lines in the file west.yml of nrf repository

  • Hi Ruben,

    Appreciate your patience.

    I would highly recommend you to use latest version of NCS (2.4.0) along with VS Code extension. It is very easy to get started with NCS. You have to install NCS Desktop which would allow you to get and update Nordic apps like Programmer, ToolChain Manager, Cellular Monitor, Power Profiler and many others.
    This might help in installing different tools 

    Once you have installed and successfully built samples (confirming everything is correct and in place), then build your project.

    There could be a lot of differences in projects and samples, and it really depends on what you are using and building for using zephyr that will generate different files.
    For example:
    zephyr.hex is generated for each image
    merged.hex is generated for each core (by combining all images [zephyr.hex] for a single core)
    merged_domain.hex is generated for all cored (by combining all merged.hex)
    Then the more complexity could be added depending upon:
    whether you are building for secure domain or non-secure domain
    whether you are using DFU / FOTA or not
    you can check about output files here for building firmware 

    Now as you have successfully complied the samples or other projects that are larger than 50% flash memory, the issue seems to be in the project itself. As you are using the bootloader, I suggest you to base your project on official / supported (Nordic / Zephyr) samples.

    For example, I see you have shared your folder structure. Below, I started with a sample project in NCS and then added mcuboot to it, and just sharing output of building with and without mcuboot

    1) Building peripheral uart in ncs 2.4.0

    2) Building the same sample with MCUboot:

    I have built both cases for the same build target (nrf52840). We can see the increase in flash usage and generation of different output files.

    For official MCUboot sample please refer to SMP Server, and for unofficial samples in NCS please have a look at this repo.

    BR, Naeem

Related