01
什么是Bootloader
02
劃分Flash區(qū)間
03
修改中斷向量表
__root?const?long?reintvec[]@".intvec"=?
{
0x82008080,0x82008404,0x82008408,0x8200840c,?
0x82008410,0x82008414,0x82008418,0x8200841c,?
0x82008420,0x82008424,0x82008428,0x8200842c,?
0x82008430,0x82008434,0x82008438,0x8200843c,?
0x82008440,0x82008444,0x82008448,0x8200844c,?
0x82008450,0x82008454,0x82008458,0x8200845c,?
0x82008460,0x82008464,0x82008468,0x8200846c,?
0x82008470,0x82008474,0x82008478,0x8200847c,?
};
__root?const?long?reintvec[]@".intvec"=
{???
0x82008080,0x82009404,0x82009408,0x8200940c,?
0x82009010,0x82009014,0x82009018,0x8200901c,
0x82009020,0x82009024,0x82009028,0x8200902c,
0x82009030,0x82009034,0x82009038,0x8200903c,
0x82009040,0x82009044,0x82009048,0x8200904c,
0x82009050,0x82009054,0x82009058,0x8200905c,
0x82009060,0x82009064,0x82009068,0x8200906c,
0x82009070,0x82009074,0x82009078,0x8200907c,
};
04
修改ICF文件
define?region?NearFuncCode?=?[from?0x8000?to?0x8FFF];
define?block?INTVEC?with?size?=?0x80?{?ro?section?.intvec?};
place at start of NearFuncCode { block INTVEC };
05
跳轉命令
asm("LDW X, SP ");
asm("LD??A,??$FF");
asm("LD??XL,?A??");
asm("LDW?SP,?X??");
asm("JPF?$9000");
sm("LDW X, SP ");
asm("LD??A,??$FF");
asm("LD??XL,?A??");
asm("LDW?SP,?X??");
asm("JPF?$8000");
06
編寫交互代碼
-END-
來源 | 玩轉嵌入式
作者 | 劉小舒
|?整理文章為傳播相關技術,版權歸原作者所有?|
|?如有侵權,請聯(lián)系刪除?|
【1】嵌入式研發(fā)10多年,工程師悟出這些道理
【2】當談起嵌入式工程師,究竟在談些什么
【3】嵌入式工程師出路之我見:就業(yè),技術,行業(yè)...
【4】為什么嵌入式工程師會對8位MCU有誤解?
【5】嵌入式工程師結合經(jīng)歷聊硬件工程師和軟件工程師哪個更有前途?
免責聲明:本文內(nèi)容由21ic獲得授權后發(fā)布,版權歸原作者所有,本平臺僅提供信息存儲服務。文章僅代表作者個人觀點,不代表本平臺立場,如有問題,請聯(lián)系我們,謝謝!