新聞中心

EEPW首頁 > 嵌入式系統(tǒng) > 設(shè)計應(yīng)用 > KEIL-BANK分頁(H00,H01 ... H0x)

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

作者: 時間:2016-12-01 來源:網(wǎng)絡(luò) 收藏
C51而言,生成的HEX文件是有體積限制的,如果ROM過大,那么就要用到分頁技術(shù)將HEX分成幾個文件
具體做法簡單點(diǎn)來說,如下:

===================================================================
1.找到L51_BANK.A51文件加到工程中
2.找到STARTUP.A51文件最后 EXTRN CODE (?B_SWITCH0) CALL ?B_SWITCH0 ; init bank mechanism to code bank 0 原來是注釋掉的,恢復(fù)有效
3.剩下的就是設(shè)置了,看下圖







=================================================

更啰嗦的做法見第二個參考鏈接

======================================
再貼一個合成腳本:

在KEIL的OPTION的USER頁下,最后一欄:RUN AFTER BUILD中加入編譯完成后要調(diào)用的動作: 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將新的分頁文件復(fù)制到指定地址
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文件


關(guān)鍵詞: KEIL-BANKC51HEX文

評論


相關(guān)推薦

技術(shù)專區(qū)

關(guān)閉