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!

  • 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

  • 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

  • Thank you for your critical suggestions. Upon checking, I found that the merged_domains.hex file was not generated, leading me to suspect an issue with the Zephyr SDK. I resolved the problem by copying the entire Zephyr directory from my old PC and performing a complete replacement on the new PC.

    Best regards,

    Lingfeng

Related