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

Command line program nRF5340 error

Hi  Nordic Tech Support,

      Our company is evaluating nRF5340 for future project. I have brought one nRF5340 DK, and I am following the online guide to build and program the DK board.

https://developer.nordicsemi.com/nRF_Connect_SDK/doc/1.5.0/nrf/ug_nrf5340.html

     'Programming the network sample from SES' works well on my side.

     'Programming from the command line' does not work. I always get error when I try to to flash the network core no matter I use the 'west' command or 'nrfjprog' directly. Could you support that? 

  • Looks like the snapshot does not show correctly. Below is the error pop up

    C:\ncs\v1.5.0\nrf\samples\bluetooth\peripheral_lbs\build_nrf5340dk_nrf5340_cpuapp\hci_rpmsg>west flash --erase
    -- west flash: rebuilding
    [0/1] cmd.exe /C "cd /D C:\ncs\v1.5.0\nrf\samples\bluetooth\peripheral_lbs\build_nrf5340dk_nrf5340_cpuapp\hci_rpmsg\zephyr\cmake\flash && C:\ncs\v1.5.0\toolchain\opt\bin\cmake.exe -E echo "

    -- west flash: using runner nrfjprog
    -- runners.nrfjprog: mass erase requested
    Using board 960113271
    -- runners.nrfjprog: Flashing file: C:\ncs\v1.5.0\nrf\samples\bluetooth\peripheral_lbs\build_nrf5340dk_nrf5340_cpuapp\hci_rpmsg\zephyr\merged_CPUNET.hex
    -- runners.nrfjprog: Generating CP_NETWORK hex file C:\ncs\v1.5.0\nrf\samples\bluetooth\peripheral_lbs\build_nrf5340dk_nrf5340_cpuapp\hci_rpmsg\zephyr\GENERATED_CP_NETWORK_merged_CPUNET.hex
    ERROR: An invalid argument was provided. Use --help for a list of valid
    ERROR: arguments.
    FATAL ERROR: command exited with status 11: nrfjprog --program 'C:\ncs\v1.5.0\nrf\samples\bluetooth\peripheral_lbs\build_nrf5340dk_nrf5340_cpuapp\hci_rpmsg\zephyr\GENERATED_CP_NETWORK_merged_CPUNET.hex' --chiperase -f NRF53 --coprocessor CP_NETWORK --snr 960113271

    C:\ncs\v1.5.0\nrf\samples\bluetooth\peripheral_lbs\build_nrf5340dk_nrf5340_cpuapp\hci_rpmsg>
    C:\ncs\v1.5.0\nrf\samples\bluetooth\peripheral_lbs\build_nrf5340dk_nrf5340_cpuapp\hci_rpmsg>
    C:\ncs\v1.5.0\nrf\samples\bluetooth\peripheral_lbs\build_nrf5340dk_nrf5340_cpuapp\hci_rpmsg>
    C:\ncs\v1.5.0\nrf\samples\bluetooth\peripheral_lbs\build_nrf5340dk_nrf5340_cpuapp\hci_rpmsg>west flash --erase
    -- west flash: rebuilding
    [0/1] cmd.exe /C "cd /D C:\ncs\v1.5.0\nrf\samples\bluetooth\peripheral_lbs\build_nrf5340dk_nrf5340_cpuapp\hci_rpmsg\zephyr\cmake\flash && C:\ncs\v1.5.0\toolchain\opt\bin\cmake.exe -E echo "

    -- west flash: using runner nrfjprog
    -- runners.nrfjprog: mass erase requested
    Using board 960113271
    -- runners.nrfjprog: Flashing file: C:\ncs\v1.5.0\nrf\samples\bluetooth\peripheral_lbs\build_nrf5340dk_nrf5340_cpuapp\hci_rpmsg\zephyr\merged_CPUNET.hex
    -- runners.nrfjprog: Generating CP_NETWORK hex file C:\ncs\v1.5.0\nrf\samples\bluetooth\peripheral_lbs\build_nrf5340dk_nrf5340_cpuapp\hci_rpmsg\zephyr\GENERATED_CP_NETWORK_merged_CPUNET.hex
    ERROR: An invalid argument was provided. Use --help for a list of valid
    ERROR: arguments.
    FATAL ERROR: command exited with status 11: nrfjprog --program 'C:\ncs\v1.5.0\nrf\samples\bluetooth\peripheral_lbs\build_nrf5340dk_nrf5340_cpuapp\hci_rpmsg\zephyr\GENERATED_CP_NETWORK_merged_CPUNET.hex' --chiperase -f NRF53 --coprocessor CP_NETWORK --snr 960113271

    C:\ncs\v1.5.0\nrf\samples\bluetooth\peripheral_lbs\build_nrf5340dk_nrf5340_cpuapp\hci_rpmsg>
    C:\ncs\v1.5.0\nrf\samples\bluetooth\peripheral_lbs\build_nrf5340dk_nrf5340_cpuapp\hci_rpmsg>
    C:\ncs\v1.5.0\nrf\samples\bluetooth\peripheral_lbs\build_nrf5340dk_nrf5340_cpuapp\hci_rpmsg>nrfjprog -f NRF53 --coprocessor CP_NETWORK --program zephyr/zephyr.hex --chiperase
    ERROR: An invalid argument was provided. Use --help for a list of valid
    ERROR: arguments.

    C:\ncs\v1.5.0\nrf\samples\bluetooth\peripheral_lbs\build_nrf5340dk_nrf5340_cpuapp\hci_rpmsg>

  • Hi,

    Did you install the toolchain manually or through the Toolchain Manager?

    Are you using the most recent version of the nRF Command Line Tools?

  • Thanks. I have found the root cause. The nrfjprog tool I used is not the latest one. 

Related