

Many debuggers and programmers can work directly with the ELF file format. elf file ( Executable and Linkable Format). The output of the linker stage of a build process is typically to generate a. There are various file formats around, with the Intel Hex (ihex) format being among the most widely used. I think that one is more important for us.The primary purpose of the ihex file in the embedded space is to create a file that is used to program/reprogram a target system. We are actually working on signing our firmware with some header bytes after compile that allows the device to verify the author is us and will not load anyone elses binaries. Sorry I can’t really help you with that one yet. If you loose connection temporarily or have a corrupt package you can request the stream to restart back at that position… We stream frames to the device as fast as possible and don’t acknowledge all frames.Īnd then when the file is on the storage device we double check the overall file CRC and compare that with the desired CRC.Īs for security this is where we have not done anything and this is mainly because it is over USB, perhaps a different kettle of fish when you want to stream over ble or wifi but definitely worth consideration. I am also sending file position per frame. Should I encrypt/decrypt each line to check fo the checksum? With bin, my (maybe wrong) understanding is that I can encrypt the file, have checksum on the encrypted file and only decrypt if the checksum is one more benefit over ihex with doing binary framing is that you can now send more data per frame and we are putting a CRC checksum on each of these frames. With the ihex, I’m also wondering about encrypted firmware update. If it’s correct I can do the update, if not, I just boot the regular application and let the user know it did not work.

In this case, I will need to start again from the beginning, so I’d say that having a global checksum is better. This is easy with USB but a lot less easy with BLE or Wifi where I can lose the connection. That being said, checking each line is fine if I’m able to send them again until I get the right checksum. Yes, we are using the the ihex checksum to check for integrity.

#Ihex vs hex full
The quicker way is to transfer the binary, packing and crc checking on the fly with custom framing.Īnyway this is my experience and would like to hear what others think as I am no way an expert, this is just what worked for us and with a few tests ended up being fastest way to load binaries with full error checking and file validation. In conclusion the simplest way is to convert everything to an ASCII representation of bytes such as hex, pack it into ASCII frames and send it (I.e ihex) however it means transfering a larger file. Some things to consider… Transfering binary files may conflict with any ASCII characters transfered with it such as command or control characters and may require consideration around binary framing and escapping, also packet integrity with checksum or CRC. For every byte of binary it is represented by two bytes of ASCII. The positive however if you compare the size of an ihex and a binary the binary is alot smaller. Transfering a raw binary will mean you need to handle this your own way if you care about getting each byte correctly. So it allows a convienent way of transfering a file and manage to some extent the integrity of each line. You will notice the benefit of ihex files is that each line contains a checksum value and has a start frame of : I think. We are doing something similar with our product… Upload the binary via USB into storage, we are putting it on an SD card then rebooting and picking it up on the bootloader during the boot sequence. Any advice, warning or resources that might help us in the future regarding the whole process would be greatly appreciated! hex?Īs I said, we have been working on that for very little time, so we might be missing the big picture.

#Ihex vs hex update
