Infere bin size from hex file

Is there any way to determine binary size from hex file? We are using NRF-PROGRAMMER to flash firmware to device. Below is the screenshot of current firmware in said program.

Partitions (from bottom):

- MBR or Application : 0x0000000 - 0x0AFF (2816b)

- N/A : 0x000FF8 - 0x02514F (147800b)

- Application : 0x026000 - 0x04A157 (147800b)

- Application : 0x04A158 - 0x06F877 (153376b)

- Application : 0x071000 - 0x076AC3 (23236b)

-Application : 0x07E000 - 0x07E05B (92b)

- Application : 0x07F000 - 0x07F05B (92b)

We are using s132 and SDK 17.1.0. We generate merged hex file from app, boot loader and soft device.

Why does application seem to be split into 2 sections?

Is there any way to determine the size of the flash space that application will use from hex file? Is there any other way to get binary size?

  • Hi, 

    I think you could use arm-none-eabi-size to get the binary size. 

    >arm-none-eabi-size secure_bootloader_ble_s132_pca10040.hex
       text    data     bss     dec     hex filename
          0   23760       0   23760    5cd0 secure_bootloader_ble_s132_pca10040.hex

    Why does application seem to be split into 2 sections?

    Do you erase the board before programming? You can check the layout of the app without other images.

    Have a look at the Memory layout doc.  

    Regards,
    Amanda

Related