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 Children
  • 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

  • I am using nrfjprog only to flash my chip. And also i am using .hex file for programming.

    .bin is only used for creating signature separately.

    Writing UICR with nrfjprog
    
    > nrfjprog --memwr 0x10001014 --val <bl_start>
    
    > nrfjprog --memwr 0x10001018 --val <mbr_param_page>

    But this process will be manually right. First need to build the code then remove the UICR content from the .hex file. 

    creating .bin based on that hex file and then i need to create the signature on that bin. 

    Is it possible to avoid this much manually intervention..?

    Regards

    Rohit Saini

  • And i have one more doubt.

    LIke i am erasing the flash then loading softdevice code. and then my Blinky application code which started from 0x27000 location in flash.

    nrfjprog.exe --family NRF52 --eraseall

    nrfjprog --program s140_nrf52_7.2.0_softdevice.hex  --family NRF52 

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

    once it reset the LED start Blinking. 

    That means its jumping to the 0x27000 memory location. But my question is how he knows that this location it need to jump.

    Because when i did same for the open bootloader code. I created the hex file and i deleted the uicr Address register from hex file and then performed below steps.

    nrfjprog.exe --family NRF52 --eraseall

    nrfjprog --program s140_nrf52_7.2.0_softdevice.hex  --family NRF52 

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

    But in this case its not jumping to my bootloader code. why is that so. why in blibky application its jumping from mbr to its location(0x27000) but for open bootloader code its not jumping to its loaction(0xBE000)....?

    How it knows in case of blink application code and not in Bootloader code...?

    Regards

    Rohit Saini

Related