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

[SOLVED] nrfjprog.exe "ERROR: Two arguments were provided that cannot be combined."

nrfjprog is reporting known errors while I'm trying to burn the pca10028 dual_bank_ble_s110 bootloader to the nRF51-DK.

    ".\_build\nrf51422_xxac.axf" - 0 Error(s), 0 Warning(s).
Build Time Elapsed:  00:00:06
nrfjprog.exe --reset --program "C:\Development\nRF51_SDK_8.0.0_5fc2c3a\examples\dfu\bootloader\pca10028\dual_bank_ble_s110\arm5_no_packs\_build\nrf51422_xxac.HEX"
ERROR: Two arguments were provided that cannot be combined. Use --help to read
ERROR: about the valid argument combinations.

Here is the full build output: nrfjprog_error.txt

So far, I've seen two proposed solutions which haven't worked for me.

  1. This question proposed splitting the --program and --reset arguments into two commands. However, Chuan-Zheng Lee correctly points out that

...because the configuration dialog admits only one command, splitting the command as suggested above can't be used as a workaround.

I'm using Keil as well and there doesn't seem to be an option to provide more than one command. image description

  1. The second proposed solution recommended using the bootloader from the 8.0 SDK. So I downloaded nRF51_SDK_8.0.0_5fc2c3a.zip and nRF51_SDK_8.1.0_b6ed55f.zip and tried both. Each produced the exact same error messages. This leads me to think I'm again missing something critical. Has there been a resolution to this which I've missed? Thanks! :)
Parents
  • Hi,

    First some background on why we use nrjprog with the bootloader examples; the "target driver"(JLINK) (true for nRF51) doesn't support writing to the UICR registers as opposed to nrfjprog which is needed to set the UICR.BOOTLOADERADDR register( MBR Reset behavior).

    Earlier nrfjprog supported both --reset and --program arguments to be passed in the same instance, but this had to be removed in the latest versions. The reset argument was therefore removed in the SDK 9.0.0. and 10.0.0 release. Thus, requiring a manual reset to start execution after programming.

    1). Unfortunately, I don't see a way to automatically reset the device after programming. But there are some options:

    • Reset the board after programming by pressing the reset button on the kit.
    • Create a reset command in Keil: In the file menu, select tools -> customize Tools menu. Here you can create a new command that resets the chip using nrfjfprog. Useful if there's no reset pin on the board.

    image description

    • You only need to set the UICR register the first time, it will only be cleared if you do a complete chip erase. So you can use the "target driver" on subsequent uploads. One advantage with this is that the target driver doesn't require the flash to be erased beforehand.

    image description

    The second proposed solution recommended using the bootloader from the 8.0 SDK. So I downloaded nRF51_SDK_8.0.0_5fc2c3a.zip and nRF51_SDK_8.1.0_b6ed55f.zip and tried both.

    What I meant to say is that the we generally recommend to use the latest SDK when possible, which at the moment is v.10.0.0. Bootloader in releases prior to SDK 8.0.0 did not implement the Service changed characteristic mentioned in the thread i linked to.

Reply
  • Hi,

    First some background on why we use nrjprog with the bootloader examples; the "target driver"(JLINK) (true for nRF51) doesn't support writing to the UICR registers as opposed to nrfjprog which is needed to set the UICR.BOOTLOADERADDR register( MBR Reset behavior).

    Earlier nrfjprog supported both --reset and --program arguments to be passed in the same instance, but this had to be removed in the latest versions. The reset argument was therefore removed in the SDK 9.0.0. and 10.0.0 release. Thus, requiring a manual reset to start execution after programming.

    1). Unfortunately, I don't see a way to automatically reset the device after programming. But there are some options:

    • Reset the board after programming by pressing the reset button on the kit.
    • Create a reset command in Keil: In the file menu, select tools -> customize Tools menu. Here you can create a new command that resets the chip using nrfjfprog. Useful if there's no reset pin on the board.

    image description

    • You only need to set the UICR register the first time, it will only be cleared if you do a complete chip erase. So you can use the "target driver" on subsequent uploads. One advantage with this is that the target driver doesn't require the flash to be erased beforehand.

    image description

    The second proposed solution recommended using the bootloader from the 8.0 SDK. So I downloaded nRF51_SDK_8.0.0_5fc2c3a.zip and nRF51_SDK_8.1.0_b6ed55f.zip and tried both.

    What I meant to say is that the we generally recommend to use the latest SDK when possible, which at the moment is v.10.0.0. Bootloader in releases prior to SDK 8.0.0 did not implement the Service changed characteristic mentioned in the thread i linked to.

Children
Related