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

The size of the file has increased dramatically when I run mergehex.

Hi, Everyone

My development environment is PCA10028, SoftDevice 130, SDK12.3.0

The size of the file has increased dramatically when I run mergehex.

1. nrfutil settings generate --family NRF51 --application nrf51422_xxac_csc.hex --application-version 1 --bootloader-ver
sion 1 --bl-settings-version 1 setting.hex

Generated Bootloader DFU settings .hex file and stored it in: setting.hex

Bootloader DFU Settings:
* File: setting.hex
* Family: nRF51
* Start Address: 0x0003FC00
* CRC: 0x46BD3CC3
* Settings Version: 0x00000001 (1)
* App Version: 0x00000001 (1)
* Bootloader Version: 0x00000001 (1)
* Bank Layout: 0x00000000
* Current Bank: 0x00000000
* Application Size: 0x00007A18 (31256 bytes)
* Application CRC: 0xC23EB9AF
* Bank0 Bank Code: 0x00000001

2. C:\Users\Administrator\Desktop\Safty_Ulsan>mergehex -m nrf51422_xxac_csc.hex setting.hex -o my.hex
Parsing input hex files.
Merging files.
Storing merged file.

3. C:\Users\Administrator\Desktop\Safty_Ulsan>nrfutil pkg generate --hw-version 51
--application-version 0xff --application my.hex --sd-req 0x87 --key-file private
.key app_dfu_package.zip
Zip created at app_dfu_package.zip

4. nrf51422_xxac_csc.hex -> 86Kbytes

    setting.hex -> 1Kbytes

   app_dfu_package.zip -> 137KBytes

I do not know why this file gets bigger.

Regards

Alex

Parents
  • Hi,

    I think there are some misunderstandings here.

    You should not provide the bootloader settings page through a DFU update.

    For an application update you should only provide the original application .hex file.

    Similarly, for SoftDevice and bootloader updates, you should provide only the SoftDevice and bootloader hex files.

    The bootloader keeps track of the currently installed application by doing some book-keeping in the bootloader settings page during the DFU process. That means if you do DFU you just leave it to the bootloader to do all the book-keeping, and you do not need to worry about bootloader settings page generation.

    If you program an application directly (using a programmer) the bootloader will not do any book-keeping, and so the bootloader will be unaware of the presence of the application. That is when you need to do the book-keeping manually through the bootloader settings page hex file that you also program directly to the device.

    If you try to do a DFU update with the merged application + bootloader settings file then you should expect an error during the DFU process. (If an update including the bootloader settings page were to succeed it would overwrite almost everything in flash, including the bootloader. The reason your zip file is so large is that it contains a binary file from the start of the application until the end of the entire flash.)

    Regards,
    Terje

Reply
  • Hi,

    I think there are some misunderstandings here.

    You should not provide the bootloader settings page through a DFU update.

    For an application update you should only provide the original application .hex file.

    Similarly, for SoftDevice and bootloader updates, you should provide only the SoftDevice and bootloader hex files.

    The bootloader keeps track of the currently installed application by doing some book-keeping in the bootloader settings page during the DFU process. That means if you do DFU you just leave it to the bootloader to do all the book-keeping, and you do not need to worry about bootloader settings page generation.

    If you program an application directly (using a programmer) the bootloader will not do any book-keeping, and so the bootloader will be unaware of the presence of the application. That is when you need to do the book-keeping manually through the bootloader settings page hex file that you also program directly to the device.

    If you try to do a DFU update with the merged application + bootloader settings file then you should expect an error during the DFU process. (If an update including the bootloader settings page were to succeed it would overwrite almost everything in flash, including the bootloader. The reason your zip file is so large is that it contains a binary file from the start of the application until the end of the entire flash.)

    Regards,
    Terje

Children
No Data
Related