Create merged.bin file

Hi all,

Actually I'm building with vscode my firmware for a custom board build with an nRF9151 non secure. After building I got a merged.hex file, this is the file upload when I'm flashing my board with vscode.

I'd like to know if I can convert merged.hex in merged.bin, I've try to add CONFIG_BUILD_OUTUT_BIN in my prj.conf but I only got zephyr.bin.

What is the difference between merged.hex and zephyr.bin? Why if I flash zephyr.bin my firmware does'nt work?

Because my idea is to use AWS FOTA to update my firmware and in nrf aws fota sample, they used app_update.bin, so I have to use binary file ?

EDIT: I'm looking for an aws fota example with nRF915, I only found aws_iot example with FOTA evt also, but nothing about prj.conf needed variables etc. I've followed this link https://docs.nordicsemi.com/bundle/ncs-latest/page/nrf/libraries/networking/aws_fota.html but I'd like to know if there is a tutorial about aws_fota and prj.conf nedded variable

Parents
  • Hi Simon,

    I'd like to know if I can convert merged.hex in merged.bin

    I think this might be possible (not sure). I just looked around and came across this ticket which might help: https://devzone.nordicsemi.com/f/nordic-q-a/110591/merged-binary-bin-of-softdevice-application-bricking-devices-differs-from-the-merged-hex-when-flashed?utm_source=chatgpt.com 

    What is the difference between merged.hex and zephyr.bin?

    merged.hex contains all firmware images merged: bootloader (if any), softdevice, app (Zephyr), etc. and is used for flashing the whole device (e.g. with nrfjprog or west flash).

    zephyr.bin is only the Zephyr application binary,i.e.  a raw binary of just the application image, not merged with other required images (like TF-M) and is generated when CONFIG_BUILD_OUTPUT_BIN=y is in prj.conf.

    Why if I flash zephyr.bin my firmware does'nt work?

    Since you are working with the AWS FOTA application, it uses the MCUboot to verify and apply updates and the zephyr.bin doesn't include necessary parts like the MCUboot bootloader or secure partitions.

    So basically for the 91 series, the device expects both the application and TF-M to be present. But only the applicaton is being provided with the zephyr.bin file.

    Because my idea is to use AWS FOTA to update my firmware and in nrf aws fota sample, they used app_update.bin, so I have to use binary file ?

    Yes, your file must be in binary format. The merged.hex is for direct programming, not for FOTA.

    I don't think we have any detailed step-by-step tutorial for what you are asking for, but yes, the AWS_FOTA and the AWS_IOT can form the reference point for your case.

    Regards,

    Priyanka

  • merged.hex contains all firmware images merged: bootloader (if any), softdevice, app (Zephyr), etc. and is used for flashing the whole device (e.g. with nrfjprog or west flash).

    zephyr.bin is only the Zephyr application binary,i.e.  a raw binary of just the application image, not merged with other required images (like TF-M) and is generated when CONFIG_BUILD_OUTPUT_BIN=y is in prj.conf.

    Ok thanks for detials.

    Yes, your file must be in binary format. The merged.hex is for direct programming, not for FOTA.

    Ok so just a question after the first flash, (do with merged.hex) if I only push zephyr.bin for FOTA update it will be working or not ?
    If I understand well, the first flash (use merged.hex) will put all necessary application in my board, so after that zephyr.bin will be sufficent to update my firmware with FOTA ?

    I don't think we have any detailed step-by-step tutorial for what you are asking for, but yes, the AWS_FOTA and the AWS_IOT can form the reference point for your case.

    Ok thanks, so I think I've find all necessary project configration nedded:

    #FOTA
    CONFIG_DOWNLOAD_CLIENT=y
    CONFIG_DFU_TARGET=y
    CONFIG_FOTA_DOWNLOAD=y
    CONFIG_AWS_FOTA=y
    CONFIG_AWS_FOTA_PAYLOAD_SIZE=1350

Reply
  • merged.hex contains all firmware images merged: bootloader (if any), softdevice, app (Zephyr), etc. and is used for flashing the whole device (e.g. with nrfjprog or west flash).

    zephyr.bin is only the Zephyr application binary,i.e.  a raw binary of just the application image, not merged with other required images (like TF-M) and is generated when CONFIG_BUILD_OUTPUT_BIN=y is in prj.conf.

    Ok thanks for detials.

    Yes, your file must be in binary format. The merged.hex is for direct programming, not for FOTA.

    Ok so just a question after the first flash, (do with merged.hex) if I only push zephyr.bin for FOTA update it will be working or not ?
    If I understand well, the first flash (use merged.hex) will put all necessary application in my board, so after that zephyr.bin will be sufficent to update my firmware with FOTA ?

    I don't think we have any detailed step-by-step tutorial for what you are asking for, but yes, the AWS_FOTA and the AWS_IOT can form the reference point for your case.

    Ok thanks, so I think I've find all necessary project configration nedded:

    #FOTA
    CONFIG_DOWNLOAD_CLIENT=y
    CONFIG_DFU_TARGET=y
    CONFIG_FOTA_DOWNLOAD=y
    CONFIG_AWS_FOTA=y
    CONFIG_AWS_FOTA_PAYLOAD_SIZE=1350

Children
  • simon884 said:
    Ok so just a question after the first flash, (do with merged.hex) if I only push zephyr.bin for FOTA update it will be working or not ?
    If I understand well, the first flash (use merged.hex) will put all necessary application in my board, so after that zephyr.bin will be sufficent to update my firmware with FOTA ?

    That's right. As long as the bootloader and partitions remain unchanged this should be fine.

    -Priyanka

Related