Beware that this post is related to an SDK in maintenance mode
More Info: Consider nRF Connect SDK for new designs
This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

.bin file of Secure bootloader is too much

Hi,

I am using nordic52840 development kit board. and I am using sdk17.1 for development.

I tried to create .bin for secure bootloader code inside DFU. but the file size is very large. for my case its around 261MB.

Can any one help me here that why i am getting this much size for binary.

For hex its only 141KB.

Regards

Rohit Saini

Parents Reply
  • So looks like I need to remove the content related to uicr register from hex file and then creating bin file from it.

    Now,

    So in this case do i also need to program UICR register separately or not....?

    And also to creating .bin from .hex which command need will be used....?

    Regards

    Rohit Saini  

Children
  • What's the purpose of generating this bin file, is it for DFU or for programming through the debug interface. You will need to write the UICR registers separately if it's for the latter.

    R_S said:
    And also to creating .bin from .hex which command need will be used....?

    I usually use objcopy or hex2bin (link)

    example with objcopy:

    arm-none-eabi-objcopy --input-target=ihex --output-target=binary <input>.hex <output>.bin
    

    Regards,

    Vidar

  • bin I am using for Signature creation. 

    But the size of that bin is very large.

    and to run "arm-none-eabi-objcopy" command. which place i need to run this..?

    Regards

    R_S

  • The nrfutil script does this already. I.e. strips away the UICR section from the hex, converts it to a bin, and computes the signature with your private key as input. Is there are reason you can't use nrfutil?

    R_S said:
    and to run "arm-none-eabi-objcopy" command. which place i need to run this..?

    It's from the command line. Objcopy is included in the GNU Arm Embedded Toolchain (link)

  • Actually i am using my won public key and certificate to create a signature on .bin directly. 

    And i did as you mentioned by removing the UICR register from hex and then created bin file from hex by using "arm-none-eabi-objcopy" command.

    Now i question. How many ways we can write the data into UICR register..?

    Or anything else we can change here, so that our code directly jump to the Bootloader address..?

    Can you help me here...

    Regards

    Rohit Saini

  • The UICR registers used by the bootloader are only meant to be written once when you first program the device. They cannot be included a DFU image.

    Now i question. How many ways we can write the data into UICR register..?

    What are you currently using for programming the chip? nrfjprog, jlink commander, or something else? Also, it is a must to use the .bin file for programming, or can you use the .hex?

    Writing UICR with nrfjprog

    > nrfjprog --memwr 0x10001014 --val <bl_start>

    > nrfjprog --memwr 0x10001018 --val <mbr_param_page>

    Regards,

    Vidar

Related