Home/Support/Support Forum/Embedding version information in the ME 9210 image.bin header
Welcome to Digi Forum, where you can ask questions and receive answers from other members of the community.

Embedding version information in the ME 9210 image.bin header

0 votes
Is there a place in the compile process that I could add some version information into the header of the ME9210 image.bin file in plain text.?
When the image.bin is created I would like to embed a short plaintext string in the header portion of the file that could be read with a text editor ( it is fine that the rest of the file will be gibberish) or a small utility that I will create.

This is for the inevitable case where someone has an SD card and the only thing on it is image.bin. They will have no way to tell which version it is.
asked Nov 2, 2020 in Embedded Devices by Nevis Automation New to the Community (4 points)

Please log in or register to answer this question.

1 Answer

0 votes
image.bin: image.elf
@echo 'Building target: $@'
arm-elf-objcopy -Obinary image.elf image.uncompressed
$(NETOSDIR)/bin/imagehdr BOOT $(PROJPLATFORMDIR)/customize.ldr $(PROJPLATFORMDIR)/bsp_sys.h image.uncompressed image.bin connectme9210
$(NETOSDIR)/bin/checksize $(PROJPLATFORMDIR)/customize.ldr image.bin APP_MAX_SIZE_IN_FLASH
$(NETOSDIR)/bin/backupimage $(PROJPLATFORMDIR)/customize.ldr image.bin
@echo 'Finished building: $@'

So the third line is the one that adds image header. If you can figure out how to inject your own header without breaking anything else you will have what you want.

source code for imagehdr utility is here:
E:\Netos75\src\utilities\imagehdr\
you might be able tochange and recompile it to do what you want on top of what it already does.
answered Nov 2, 2020 by LeonidM Veteran of the Digi Community (4,010 points)
...