KEIL-BANK分页(H00,H01 ... H0x)
对C51而言,生成的HEX文件是有体积限制的,如果ROM过大,那么就要用到分页技术将HEX分成几个文件
具体做法简单点来说,如下:
===================================================================
1.找到L51_BANK.A51文件加到工程中
2.找到STARTUP.A51文件最后 EXTRN CODE (?B_SWITCH0) CALL ?B_SWITCH0 ; init bank mechanism to code bank 0 原来是注释掉的,恢复有效
3.剩下的就是设置了,看下图
=================================================
更啰嗦的做法见第二个参考链接
======================================
再贴一个合成脚本:
在KEIL的OPTION的USER页下,最后一栏:RUN AFTER BUILD中加入编译完成后要调用的动作: Merge256K_4M.bat
然后看这个bat的代码:
del hex\sparrow.H00
del hex\sparrow.H01
del hex\sparrow.H02
del hex\sparrow.H03
del hex\sparrow.H04
del hex\sparrow.H05
del hex\sparrow.H06
del hex\sparrow.H07
del hex\sparrow.H08 先删除原来的分页文件
@echo off
copy output\sparrow.H00 hex\sparrow.H00
copy output\sparrow.H01 hex\sparrow.H01
copy output\sparrow.H02 hex\sparrow.H02
copy output\sparrow.H03 hex\sparrow.H03
copy output\sparrow.H04 hex\sparrow.H04
copy output\sparrow.H05 hex\sparrow.H05
copy output\sparrow.H06 hex\sparrow.H06
copy output\sparrow.H07 hex\sparrow.H07 将新的分页文件复制到指定地址
HEX2BIN /Q /L524288 hex\sparrow.H00 hex\RTD2668.BIN
HEX2BIN /Q /O65536 /M hex\sparrow.H01 hex\RTD2668.BIN
HEX2BIN /Q /O131072 /M hex\sparrow.H02 hex\RTD2668.BIN
HEX2BIN /Q /O196608 /M hex\sparrow.H03 hex\RTD2668.BIN
HEX2BIN /Q /O262144 /M hex\sparrow.H04 hex\RTD2668.BIN
HEX2BIN /Q /O327680 /M hex\sparrow.H05 hex\RTD2668.BIN
HEX2BIN /Q /O393216 /M hex\sparrow.H06 hex\RTD2668.BIN
HEX2BIN /Q /O458752 /M hex\sparrow.H07 hex\RTD2668.BIN
用HEX2BIN将HEX分页合成一个BIN文件
本站仅提供存储服务,所有内容均由用户发布,如发现有害或侵权内容,请
点击举报。