微波EDA网,见证研发工程师的成长!
首页 > 硬件设计 > 嵌入式设计 > KEIL-BANK分页(H00,H01 ... H0x)

KEIL-BANK分页(H00,H01 ... H0x)

时间:12-01 来源:互联网 点击:
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 hexsparrow.H00
del hexsparrow.H01
del hexsparrow.H02
del hexsparrow.H03
del hexsparrow.H04
del hexsparrow.H05
del hexsparrow.H06
del hexsparrow.H07
del hexsparrow.H08先删除原来的分页文件
@echo off
copy outputsparrow.H00 hexsparrow.H00
copy outputsparrow.H01 hexsparrow.H01
copy outputsparrow.H02 hexsparrow.H02
copy outputsparrow.H03 hexsparrow.H03
copy outputsparrow.H04 hexsparrow.H04
copy outputsparrow.H05 hexsparrow.H05
copy outputsparrow.H06 hexsparrow.H06
copy outputsparrow.H07 hexsparrow.H07将新的分页文件复制到指定地址
HEX2BIN /Q /L524288 hexsparrow.H00 hexRTD2668.BIN
HEX2BIN /Q /O65536 /M hexsparrow.H01 hexRTD2668.BIN
HEX2BIN /Q /O131072 /M hexsparrow.H02 hexRTD2668.BIN
HEX2BIN /Q /O196608 /M hexsparrow.H03 hexRTD2668.BIN
HEX2BIN /Q /O262144 /M hexsparrow.H04 hexRTD2668.BIN
HEX2BIN /Q /O327680 /M hexsparrow.H05 hexRTD2668.BIN
HEX2BIN /Q /O393216 /M hexsparrow.H06 hexRTD2668.BIN
HEX2BIN /Q /O458752 /M hexsparrow.H07 hexRTD2668.BIN

用HEX2BIN将HEX分页合成一个BIN文件

Copyright © 2017-2020 微波EDA网 版权所有

网站地图

Top