Flashing .bin file using nrfjprog command line

Hi,

I am using nordic52840 dk board.

And i want to flash a bin file using nrfjprog command line.

For Hex file i am using below command

nrfjprog --reset --program blinky_pca10056.hex --family NRF52

But what changes requires to flash .bin instead of .hex file.

Regards

Parents
  • Hello,

    Why do you need to program the .bin file?

    nrfjprog only accept .hex files. Perhaps you can look into converting the .bin file to a .hex file first?

    https://devzone.nordicsemi.com/f/nordic-q-a/28074/tools-to-convert-binary-data-file-to-hex-compatible-with-nrfjprog

    Best regards,

    Edvin

  • Hi, 

    Thanks for reply. but i can see on the help command that it support for .bin format as well.

    I attached that image below

  • Hehe I actually checked this before I answered, but I guess I have an older version installed than you. This is what mine said:

    Fullscreen
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    --program <hex_file> [--sectorerase | --chiperase | --sectoranduicrerase |
    --recover] [--qspisectorerase | --qspichiperase]
    Programs the specified image_file into the device.
    If the target area to program is not erased, the
    --program operation will fail unless an erase
    option is given. Valid erase operations for
    the internal flash memory are --recover,
    --sectorerase, --sectoranduicrerase and
    --chiperase. If --chiperase is given, all the
    available user non-volatile memory, including
    UICR, will be erased before programming. If
    --recover is given, all the available user
    non-volatile memory, including UICR, will
    be erased before programming, even if the
    device is readback protected.
    If --sectorerase is given, only the targeted
    non-volatile memory pages excluding UICR will
    be erased. If --sectoranduicrerase is given,
    only the targeted non-volatile memory pages
    including UICR will be erased. Note that the
    --sectoranduicrerase and --sectorerase
    XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

    (I am currently using version 10.12.1)

    If it says that .bin files are supported, then I guess you can just replace the .hex file with the bin file in your nrfjprog command:

    nrfjprog --reset --program blinky_pca10056.hex --family NRF52

    Did you test?

  • Yes i tried it. but didn't work for me as well.

    I have the new version of nrfjprog.

    And in the previous answer you mentioned the link to convert bin to hex file.

    arm-none-eabi-objcopy -I binary -O ihex filename.bin filename.hex
    by using this command.

    So my question is where i need to run this command "arm-none-eabi-objcopy"...?
    or Do i need to install something for this.

    because i simply try it to run in command line only where i used to run nrfjprog commands.

    Correct me if the way i am doing is not correct!

    Regards
    Rohit Saini


  • Hmm. I also see that it doesn't work using v 10.15.2 external. I'll look into this internally.

    But what compiler do you use if it doesn't provide a .hex file?

    arm-none-eabi is part of GCC (not nrfjprog). If you have it installed on your computer, you will probably find it in:
    C:\Program files (x86)\GNU Tools ARM Embedded\<version>\bin\arm-none-eabi-objcopy.exe

    Make sure to add the path, wich in my case is "C:\Program Files (x86)\GNU Tools ARM Embedded\9 2019-q4-major\" to path:

    Best regards,

    Edvin

  • Using ICC ARM only. and its creating .hex file as well.

    ANd i can also create .bin as well. But the issue is sometime there is the difference between the .hex and .bin. Thats y i want to load the .bin file from nrfjprog.

    But anyway i am able to flash .bin with J-flash lite tool.

    And thanks for "arm-none-eabi-objcopy" command. 

    Rregards

    Rohit Saini

Reply
  • Using ICC ARM only. and its creating .hex file as well.

    ANd i can also create .bin as well. But the issue is sometime there is the difference between the .hex and .bin. Thats y i want to load the .bin file from nrfjprog.

    But anyway i am able to flash .bin with J-flash lite tool.

    And thanks for "arm-none-eabi-objcopy" command. 

    Rregards

    Rohit Saini

Children
No Data