# Separating Unique Parameters from Firmware Binaries | Interrupt

**URL:** <https://community.memfault.com/t/separating-unique-parameters-from-firmware-binaries-interrupt/275>\
**Category:** Blog\
**Created:** [October 7, 2020, 4:18am UTC](https://community.memfault.com/t/separating-unique-parameters-from-firmware-binaries-interrupt/275 "2020-10-07T04:18:11Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![discobot](https://yyz2.discourse-cdn.com/flex030/user_avatar/community.memfault.com/discobot/32/1_2.png) [@discobot](https://community.memfault.com/u/discobot)\
**Post date:** [October 7, 2020, 4:18am UTC](https://community.memfault.com/t/separating-unique-parameters-from-firmware-binaries-interrupt/275/1 "2020-10-07T04:18:11Z")

</div>

When writing firmware for embedded systems, the firmware is usually meant to run on many identical devices. These devices often have their own serial number, public and private keys, or some other unique parameters. These parameters need to be provisioned per device, either by generating unique firmware binaries or by writing the values to the device’s persistent storage, like external flash or the EEPROM.

* * *
This is a companion discussion topic for the original entry at [https://interrupt.memfault.com/blog/separating-unique-parameters](https://interrupt.memfault.com/blog/separating-unique-parameters)

---

<div class="post-metadata">

**Author:** ![Karlz](https://avatars.discourse-cdn.com/v4/letter/k/eada6e/32.png) [@Karlz](https://community.memfault.com/u/Karlz)\
**Post date:** [October 16, 2020, 8:06am UTC](https://community.memfault.com/t/separating-unique-parameters-from-firmware-binaries-interrupt/275/2 "2020-10-16T08:06:34Z")

</div>

Thanks, Amund of Interrupt. This came in the most appropriate time. Hope you wouldn’t mind me sharing this in Nordic DevZone.

> **[Any sample for embedding binary or text file to be available as variable in...](https://devzone.nordicsemi.com/f/nordic-q-a/57396/any-sample-for-embedding-binary-or-text-file-to-be-available-as-variable-in-the-code)**

Kind regards

---

<div class="post-metadata">

**Author:** ![discobot](https://yyz2.discourse-cdn.com/flex030/user_avatar/community.memfault.com/discobot/32/1_2.png) [@discobot](https://community.memfault.com/u/discobot)\
**Post date:** [October 16, 2020, 8:06am UTC](https://community.memfault.com/t/separating-unique-parameters-from-firmware-binaries-interrupt/275/3 "2020-10-16T08:06:35Z")

</div>



---

<div class="post-metadata">

**Author:** ![francois](https://avatars.discourse-cdn.com/v4/letter/f/77aa72/32.png) [@francois](https://community.memfault.com/u/francois)\
**Post date:** [October 16, 2020, 5:33pm UTC](https://community.memfault.com/t/separating-unique-parameters-from-firmware-binaries-interrupt/275/4 "2020-10-16T17:33:52Z")

</div>

Thanks for sharing @Karlz! Note that another option for embedded a binary is to translate it into a header file. This is super easy with `xxd -i` . Check it out: [https://unix.stackexchange.com/a/176112](https://unix.stackexchange.com/a/176112).

---

<div class="post-metadata">

**Author:** ![Rajah](https://avatars.discourse-cdn.com/v4/letter/r/e9a140/32.png) [@Rajah](https://community.memfault.com/u/Rajah)\
**Post date:** [October 18, 2020, 1:19am UTC](https://community.memfault.com/t/separating-unique-parameters-from-firmware-binaries-interrupt/275/5 "2020-10-18T01:19:20Z")

</div>

Hi Amund, this could not have come at a better time. I am trying to solve the exact same problem on my LoRaWAN devices as we are getting ready to scale. Lots of good input that I can put to use. We deploy our own private LoRaWAN network.

---

<div class="post-metadata">

**Author:** ![amundas](https://avatars.discourse-cdn.com/v4/letter/a/35a633/32.png) [@amundas](https://community.memfault.com/u/amundas)\
**Post date:** [October 26, 2020, 7:19am UTC](https://community.memfault.com/t/separating-unique-parameters-from-firmware-binaries-interrupt/275/6 "2020-10-26T07:19:40Z")

</div>

I’m happy to hear that you found this post useful!

---

<div class="post-metadata">

**Author:** ![stevenlin](https://avatars.discourse-cdn.com/v4/letter/s/e5b9ba/32.png) [@stevenlin](https://community.memfault.com/u/stevenlin)\
**Post date:** [October 30, 2020, 3:29am UTC](https://community.memfault.com/t/separating-unique-parameters-from-firmware-binaries-interrupt/275/7 "2020-10-30T03:29:51Z")

</div>

hi all ,  
could be merger(mergehex.exe tool )

Unique Parameter(A.hex) and App (B.hex)

i try to merger (A and B, mergehex -m A.hex B.hex -o C.hex)  
ERROR: The hex files cannot be merged since there are conflicts

it seem write other program(python) to rebuild .like " Secure firmware updates with code signing"  
or other ?

---

<div class="post-metadata">

**Author:** ![francois](https://avatars.discourse-cdn.com/v4/letter/f/77aa72/32.png) [@francois](https://community.memfault.com/u/francois)\
**Post date:** [October 30, 2020, 3:42am UTC](https://community.memfault.com/t/separating-unique-parameters-from-firmware-binaries-interrupt/275/8 "2020-10-30T03:42:00Z")

</div>

@stevenlin - Welcome to Interrupt! It sounds like your two files (A.hex and B.hex) have some overlapping regions. Make sure the addresses are distinct and they should merge fine.

---

<div class="post-metadata">

**Author:** ![stevenlin](https://avatars.discourse-cdn.com/v4/letter/s/e5b9ba/32.png) [@stevenlin](https://community.memfault.com/u/stevenlin)\
**Post date:** [October 30, 2020, 5:33am UTC](https://community.memfault.com/t/separating-unique-parameters-from-firmware-binaries-interrupt/275/9 "2020-10-30T05:33:34Z")

</div>

hi francois  
in platform (nordic nrf52840,sdk 15.3)  
i add the section(image\_hdr) ,so it will be overlapping.  
to use mergerhex to merger,not use nrfjprog (loadfile to change the [Unique Parameters)

nrf\_common.ld  
ENTRY(Reset\_Handler)

SECTIONS  
{  
.text :  
{  
KEEP(_(.isr\_vector))  
KEEP (_(.image\_hdr))  
_(.text_)  
…  
}  
}

---

<div class="post-metadata">

**Author:** ![francois](https://avatars.discourse-cdn.com/v4/letter/f/77aa72/32.png) [@francois](https://community.memfault.com/u/francois)\
**Post date:** [October 31, 2020, 12:45am UTC](https://community.memfault.com/t/separating-unique-parameters-from-firmware-binaries-interrupt/275/10 "2020-10-31T00:45:09Z")

</div>

@stevenlin upon digging some more, sounds like `mergehex` does not support this kid of operation. Instead, you might want to use this very good Python tool: [https://python-intelhex.readthedocs.io/en/latest/part2-6.html](https://python-intelhex.readthedocs.io/en/latest/part2-6.html)

---

<div class="post-metadata">

**Author:** ![stevenlin](https://avatars.discourse-cdn.com/v4/letter/s/e5b9ba/32.png) [@stevenlin](https://community.memfault.com/u/stevenlin)\
**Post date:** [November 1, 2020, 3:05pm UTC](https://community.memfault.com/t/separating-unique-parameters-from-firmware-binaries-interrupt/275/11 "2020-11-01T15:05:28Z")

</div>

hi francols,  
very thank you for your tool.  
i will try it .
