9 years, 5 months ago.

Size of hex files

If I compiling a simple blinky code for my RedBearLab nRF51822 and download it from the Online-Compiler, the *.hex files size is about more than 250kB. Why this need so much space? Or the MBED HDK don't flash the whole file to the target chip?

1 Answer

9 years, 5 months ago.

I guess there are a couple of things to note about the hex files for the nRF51822 parts:

  1. If you open the .hex file in your favorite text editor you will notice that it is text and not binary. Each byte of your program's image is represented by 2 hex digits. This means that your actual binary is at maximum half the size of your .hex, so 125kB in your case. The actual binary size is even smaller since there is additional overhead per line of hex data.
  2. Unless you are using the Firmware Over The Air method of updating your device, the SoftDevice is always merged into the final hex image. So even if your program was just a few kB on its own, the SoftDevice will add an additional 84 or so kB to the final image.

I hope that helps,

Adam

that makes sense. do you happen to know how one would convert this hex to the format required by the OTA DFU loader for NRF?

posted by seth piezas 20 Dec 2014

I haven't used the FOTA feature but you can check out the following links:
https://developer.mbed.org/forum/team-63-Bluetooth-Low-Energy-community/topic/5169/
http://developer.mbed.org/platforms/Nordic-nRF51822-FOTA/

posted by Adam Green 21 Dec 2014