Yet Another Hex to bin converter
It can handle the extended Intel hex format in segmented and linear address
modes. Records need not be sorted and there can be gaps between records.
Some hex files are produced by compilers. They generate objects files for each
module in a project, and when the linker generates the final hex file, the
object files are stored within the hex files, but modules can appear not
necessary in order of address.
How does it work?
It allocates a one meg buffer and just place the converted bytes in its
buffer. At the end, the buffer is written to disk. Using a buffer eliminates
the need to sort records.
1. Compiling on Linux
make
then
make install
This will install the program to /usr/local/bin.
2. Using hex2bin
hex2bin example.hex
hex2bin will generate a binary file example.bin starting at the
lowest address in the hex file.
3. Notes
If the lowest address isn't 0000,
ex: 0100: (the first record begins with :nn010000xxx )
there will be problems when using the binary file to program a EPROM
since the first byte supposed to be at 0100 is stored in the binary file
at 0000.
you can specify a starting address on the command line:
hex2bin -s 0000 start_at_0100.hex
This start address is not the same thing as the start address record in
the hex file. The start address record is used to specify the starting
address for execution of the binary code.
The bytes will be stored in the binary file with a padding from 0000
to the lowest address minus 1 (00FF in this case). Padding bytes are all FF
so an EPROM programmer can skip these bytes when programming.
EPROM, EEPROM and Flash memories contain all FF when erased.
This program does minimal error checking since many hex files are
generated by known good assemblers.
When the source file name is
for-example.test.hex
the binary created will have the name
for-example.bin
the ".test" part will be dropped.
4. Checksum
By default, it ignores checksum errors, so that someone can change
by hand some bytes allowing quick and dirty changes.
If you want checksum error reporting, specify the option -c.
hex2bin -c example.hex
If there is a checksum error somewhere, the program will continue the
conversion anyway.
The example file example.hex contains some records with checksum errors.
5. Motorola S files
mot2bin example.s19
Options for mot2bin are the same as hex2bin. Executing the program
without argument will display available options.
This program will handle S19 files generated for Motorola micropro-
cessors. Since I use this program for an EPROM programmer, I will
rarely need to have more than 1 Meg, I limited the source program for
24 bits or 16 bits address records.
32 bits records are now supported, but obviously I can't allocate all
the memory for the binary target. What I did is simply assume that the
binary file will occupy less than 1 Meg
6. Compiling on DOS
I didn't check this, but it should be relatively easy. The only problem
may be to allocate a 1 Meg memory block. On recent DOS c compilers
this should not be a problem anymore.
7. Goodies
Description of the file formats is included.
Added examples files for extended addressing.
8. Error messages
"Data record skipped at ..."
This means that the records are falling outside my 1M buffer. You may
try to increase the buffer size to 2M or 4M. There is a define at the
beginning of the file.
9. History
See ChangeLog
10. To do
Maybe do a library for accessing files, I often need this.
Change the code for putting an extension.
Add an option for changing the buffer size for other than 1 Meg.
Formatting and programming with GNU standards.
Finally, if you have any idea about hex tools that I could do, or anything
that may improve my programs,
send me an email at
jpellet@ieee.org
没有合适的资源?快使用搜索试试~ 我知道了~
HEX2BIN,讲HEX格式文件转换为BIN文件
共25个文件
bin:6个
hex:6个
exe:3个
4星 · 超过85%的资源 需积分: 19 92 下载量 35 浏览量
2009-04-08
10:58:50
上传
评论
收藏 153KB RAR 举报
温馨提示
该工具讲HEX格式文件转换为BIN文件,主要应用于单片机或者嵌入式系统的下载文件转换方面。
资源推荐
资源详情
资源评论
收起资源包目录
hex2bin.rar (25个子文件)
hex2bin
man
cat1
hex2bin.1.txt 3KB
bin
PrnCtlr.bin 15KB
mot2bin.exe 8KB
main.bin 2KB
PrnCtlt.bin 14KB
MachCtl.hex 22KB
Main.hex 6KB
PrnCtl.hex 39KB
prnctl.bin 15KB
hexbin.exe 13KB
MachCtl.bin 8KB
Bootload_m.bin 1KB
BootLoad_m.hex 3KB
PrnCtlt.hex 37KB
hex2bin.exe 8KB
PrnCtlr.hex 39KB
contrib
hex2bin-1.02
COPYING 18KB
HEX2BIN-1.0.2.LSM 1KB
readme.txt 4KB
hex2bin-1.02-GnuWin32.README 720B
CHANGELOG 306B
hex2bin-1.02-bin.zip 19KB
manifest
hex2bin-1.02-bin.mft 363B
hex2bin-1.02-bin.ver 79B
hex2bin-1.02-doc.zip 36KB
共 25 条
- 1
资源评论
- zhanwuchao2011-11-03用不了,不知是不是我不会用
- 水玥镜明2011-11-02转换出来的文件不对劲,300+M的HEX文件转换后只剩1MB了。
- paladinling2013-07-21一样也不能用啊
- jiekouliiiuuu2012-04-11可以转换,但转换完了,文件内容好像不一样了
- geniusly2012-11-29楼下太夸张了吧,300M变成1M?HEX转BIN不可能这么小的,肯定是你自己程序环境的问题
yeahspyme
- 粉丝: 7
- 资源: 3
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功