|
|||||||||||
Technical Support Support Resources
Product Information |
GENERAL: Making Binary Files from Hex FilesInformation in this article applies to:
QUESTIONI need to create a BINARY file from the HEX file created by the object-HEX converter program. Where can I find a utility that does that? ANSWERYou may want to consider using the free srec_cat.exe utility which is available as Windows EXE file from https://sourceforge.net/projects/srecord/files/srecord-win32. It is part of the SRecord project hosted on sourceforge.net. With this utility, you can load one or multiple HEX files, cut out specific address areas, move them to a new address and store them to a BINARY file. You can invoke srec_cat.exe from a Windows command prompt or Make tool:
You can also invoke this tool after each project build/rebuild by specifying its invocation in the µVision dialog Options for Target - User - After Build/Rebuild. In this example, the HEX file which is generated by a µVision project build/rebuild is converted to a binary file in the same folder. Please see the description of µVision key sequences for more details. If many parameters are needed, it may be easier to use a command file. When using a command file for srec_cat.exe, be sure to double the '@' character, or µVision might interpret it as a key-sequence.
For a full description of all srec_cat.exe parameters, refer to the SRecord Reference Manual. Here are some options which are useful with Keil tools:
Example:If you want to convert a HEX file (HexFile.hex) which contains max. 32K of code (address range 0x010000-0x017FFF) to a BINARY file (BinaryFile.bin) of exactly 32K where all gaps are filled with 0xFF, you can use the following srec_cat.exe command file:
Invocation of srec_cat.exe with command file:
MORE INFORMATION
SEE ALSO
Last Reviewed: Thursday, February 25, 2021 | ||||||||||
|
Arm’s Privacy Policy has been updated. By continuing to use our site, you consent to Arm’s Privacy Policy. Please review our Privacy Policy to learn more about our collection, use and transfers
of your data.