nRF5340DK: Application Only Runs Once After Flashing on New PC

I am developing using the nRF5340DK with Segger v5.68 and SDK within toolchain v1.9.1. My project works perfectly on my old PC, but after moving to a new PC with the exact same project configuration, I encountered the following issue:

  • After flashing and running the application via Segger, the program only executes once.
  • Subsequent resets (either via power cycling or pressing the reset button) do not restart the application.
  • When I copy the project back to my old PC, it works normally.

I have verified that the tools, project files, and dependencies are identical on both machines. Could this be related to driver configuration, toolchain setup, or hardware-specific behavior on the new PC? Any suggestions for troubleshooting would be greatly appreciated.

Environment Details:

  • Old PC (Working): Windows 10, Segger v5.68, SDK & toolchain v1.9.1.
  • New PC (Issue): Windows 11, Segger v5.68, SDK & toolchain v1.9.1.
  • Hardware: nRF5340DK (same board used on both PCs).

Steps Taken:

  1. Re-flashed the application multiple times via Segger.
  2. Verified J-Link drivers are installed and functioning on the new PC.
  3. Tried manual power resets and board reset buttons.
  4. Cross-checked project settings (build configurations, linker scripts).

Observations:

  • The application runs flawlessly on the first boot after flashing.
  • No errors are reported during flashing or compilation.

Could this be a firmware/hardware lock or a configuration conflict specific to the new environment?

Thank you for your help!

Parents
  • Hello Lingfeng,

    Thank you. Ok, it looks fine. Wanted to check the address ranges, but they look correct. 

    I realized now that you are using NCS, and not the nRF5 SDK (it was obvious, but I didn't notice that you were using the nRF5340). 

    The support for Segger Embedded Studio was pulled a long time ago. I really recommend that you check out VS Code. 

    That being said. Do you have the same version of JLink installed on both computers?

    Can you please try to use nrfjprog (nRF Command Line Tools) and the commands:

    nrfjprog --program <path to application core .hex file>.hex --verify --sectorerase

    What does that return?

    I believe you can see the path to the .hex file the first time you flash, if you expand the flash log in your screenshot.

    Best regards,

    Edvin

  • Thank you. I apologize for my late reply.

    This is the return:

    C:\nrf53_project\nfr5340_sdk_1.9.1_workbench>nrfjprog --program build_nrf5340dk_nrf5340_cpuapp\zephyr\zephyr.hex --verify --sectorerase
    [ #################### ]   3.879s | Erase file - Done erasing
    [ #################### ]   0.807s | Program file - Done programming
    [ #################### ]   0.808s | Verify file - Done verifying


    I checked the version of JLink, which is different. The old PC was using V7.58b while the new PC is using V7.94i. But after I reinstalled the JLink V7.58b on my new PC, the problem still remains.

    By the way, I tried to CLEAN THE SOLUTION and got an error report:

    I wonder if this could be a clue.

    Thanks for your advice and I will try to use VS Code.

    Best regards,

    Lingfeng

  • Lingfeng Wu said:
    I wonder if this could be a clue.

    Can you try to delete your build folder on the non-working PC? (I guess the build folder is the folder called build_nrf5340dk_nrf5340_cpuapp, and then set it up again, and see if the problem persists?

    Lingfeng Wu said:
    This is the return:

    When flashed via command line (nrfjprog), does it work to reset it? Or does it still only run unce after being flashed?

    Best regards,

    Edvin

  • Thank you for your reply.
    Can you try to delete your build folder on the non-working PC?

    I tried and the problem persists.

    When flashed via command line (nrfjprog), does it work to reset it?

    It cannot run even once. I checked the nRF Programmer, and it showed that the hex file flashed to memory.

    Best regards,

    Lingefeng

Reply Children
  • Did you flash the network image as well? You should see something like GENERATED_CP_APPLICATION_merged_domains.hex and GENERATED_CP_NETWORK_merged_domains.hex after flashing it once in SES, or using the command "west flash -d build_nrf5340dk_nrf5340_cpuapp".

    Can you compare the hex files from the old PC with the new one? If you build the exact same application on both computers. Do you end up with identical hex files (both app and network core)? You can compare them using a diff tool, such as meld. Or you can upload them here, and I can check for you. 

    Lingfeng Wu said:
    It cannot run even once.

    Can you try to enable some logging in your application? Do you see anything in the log? Or how do you determine that it "doesn't run"?

    BR,
    Edvin

Related