首页 > 代码库 > CC2530 Hex文件解析
CC2530 Hex文件解析
参考:
http://blog.csdn.net/lanmanck/article/details/5099354
http://www.cnblogs.com/starspace/archive/2009/01/15/1376280.html
http://techlife.blog.51cto.com/212583/95624
Intel hex文件格式说明文档:Hexfrmt.pdf
Near模式
部分Hex文件如下:
:020000040000FA
:100000000206C1020803FFFFFFFFFF02080BFFFF0C
:10001000FFFFFF020813FFFFFFFFFF02081BFFFFA8
…
:1007E000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF19
:1007F000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF09
:04000005000006C130
:00000001FF
格式
:llaaaatt[dd…]cc
aaaa:大端存放
关键行解析
:020000040000FA
指定扩展线性地址0x0000,后面的数据在此地址上依次存放。
:04000005000006C130
指定程序运行起始地址,0x06C1是程序main函数起始地址。
:00000001FF
Hex文件结束。
Bank模式
部分oad.xcl文件如下:
// CODE
//
-D_CODE_START=0x0800
-D_CODE_END=0x7FFF // Last address for ROOT bank.
//Uncomment when implementing OAD NV by dividing internal flash in half.
-P(CODE)BANKED_CODE=_CODE_START-_CODE_END,0x18000-0x1FFFF,0x28000-0x2FFFF,
0x38000-0x3E7FF,0x48000-0x4FFFF
部分Hex文件如下:
:020000040000FA
:100800000212670209CEFFFFFFFFFFFFFFFFFFFF9E
:10081000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFE8…
…
:107FE000E50A2410F582E50B3400F583E022FFFF5B
:107FF000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF91
:020000040001F9
:10800000AF1AAB15F120972637264B1E471F932436
:10801000A11CC803C00100000273800000000A0414
:108020000F01000001A78001A78048656C6C6F20DC
…
:10FFE00020D3E5D98E828F83F0A3AE82AF8315082C
:10FFF000E50870EE80D6FFFFFFFFFFFFFFFFFFFF6A
:020000040002F8
:108000008882898312839A22129FD5F9EA229004EA
:1080100009129FD5FB12193522E0F508E4F509F5A0
:108020000AF50B227401F0900A9DE0640F22740996
…
:10FFE0007F08020D959004D3E0F8A3E0F97AE87B4E
:10FFF0000322FFFFFFFFFFFFFFFFFFFFFFFFFFFFEA
:020000040003F7
:1080000074F7120B7BE9900534F090051C7402F0B4
:1080100090051474FEF0A304F01216F5121E6912F6
:108020001F7D7AA67B10121BC9121E639010A5E05B
…
:10E7E000E8A2E050107C197D007A017B0090063C85
:10E7F000E0F9121E03D083D082021020FFFFFFFF3A
:020000040004F6
:10800000C082C0839029367C957D0A743C120F7A19
:1080100012231FE9900AAEF012231FE9900AA2F082
…
:10FFE000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF21
:10FFF000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF11
:04000005000012677E
:00000001FF
关键行解析
:020000040000FA
:100800000212670209CEFFFFFFFFFFFFFFFFFFFF9E
按照xcl文件定义的,从地址0x0800开始存放,结束于0x7FFF。
:020000040001F9
:10800000AF1AAB15F120972637264B1E471F932436
扩展线性地址记录,设定起始地址为(0x0001 << 16),也就是0x10000。接下来的数据存放地址为0x18000。
Bank只是逻辑上的存储概念,物理上仍是连续存储的。地址0x18000映射到物理地址0x8000。
CC2530 Hex文件解析