I have a value say 0xAABBCCDD that I want to add to a hex file at a known address. I have not found an srec_cat option to do this yet, is this possible?
It is possible by combination of srec_cat commands.
Let in.hex be input file, out.hex be output file, 0x64 is the address to place 4-byte value so that the value will occupy addresses from 0x64 to 0x67 (0x68 is the first address after the value).
It is possible by combination of
srec_catcommands. Letin.hexbe input file,out.hexbe output file,0x64is the address to place 4-byte value so that the value will occupy addresses from0x64to0x67(0x68is the first address after the value).Step by step:
read input file
in.hex, format Intel hexapply filter Exclude—remove (if any) data in range
64(including) —0x68(excluding)GENerate content for address range
0x64(including) —0x68(excluding)the content is Little Endian CONSTant
0xAABBCCDDwith width4bytes.write Out result data.
p.s. See srec_cat and srec_input (for filter description)