我希望如此!让我们在GLD文件上一步一步地尝试……引导加载程序GLD/**内存区域*/内存{数据(A)!XOR=0x1000,长度=0x8000重置:原点=0x0,长度=0x4IVT:原点=0x4,长度=0x1FC程序(XR):原点=0x200,长度=0x21fc/*只减少了PROG大小*/ISRCONTRON: ORACE=0x23 FC,长度=0x4/*控制区域到ISR的跳转表*/.. }…0;γ-CODEL长度=0x2200;γ-IVTXBASE=0x4;γ-IsRealObjixBase= 0x23 FC;APP GLD/**内存区域*/内存{DATA(A)!XORE=0x1000,长度=0x8000重置:原点=0x800,长度=0x4/*改变位置*/IVT:原点=0x2404,长度=0x1fc/*改变位置*/程序(XR):原点=0x2600,长度=0x2200/*改变位置和大小(仅用于测试)*/…}…关于*/yoCayl长度=0x2200;/*更改大小(仅用于测试)*/y-iVtxBase= 0x2404;/*更改位置*/这个“ISRCORMIT”区域是否足够?使用这样的东西不会减少我的MCU寿命(在闪存中写入太多)?正常地编码(即,空x属性)((α-BythTyp*(α-SaveSe*(AcCa,AcAcL)),NoAutoPSV))T1中断(空隙)?好的,但是如何在APP IVT中存储这些地址呢?像这样在Bootloader GLD中(我在论坛中找到一篇文章——抱歉作者,我忘了复制链接):/***中断向量表***这个表已经从原来的内容修改到跳转到.ApdioTysIVT Goto表。用一个程序员来代替一个Bootloader的程序,它会像引导加载程序一样工作,导致相同的中断等待时间。*/IVT.I.IttBase:{Load(绝对(Apple,AppIVItBASE)+0x00);溶质(γ-AppIVItBaseBase+0x00 c);/*α-AddiSerSerR*/Lon(绝对(α-AppIVItBaseBASE)+0x010);/*Ayth-StAccess错误*/……} & IVTor就像他的在一个应用程序GLD(也从论坛复制,再次对不起作者):***关闭内存部分**JSReaveDeTrAP0= 0x0C02;JySimulaseReals= 0x0C06;JAdAdSerSRRoR=0x0C0a;JyStActReals= 0x0C0e;……再次,如何做到这一点?在一个应用程序GLDL/**中断向量表*/jyIVT.JivtBase:{短(0x05);/*Bootloader超时在秒*/短(0x00);/*yaseReaveDeRAP0*/Lead(定义)(?绝对值(α-ReaveDeTrAP0):绝对值(α-Debug中断);短(0x04);短((定义的)绝对值(α-RealvEdTrAP0):绝对(α-Debug中断)& gt;& gt;16)& 0x7f;短(0);/*α振荡子失败* /短(定义(α,振荡器失效))绝对值(γ振荡子失败):绝对(α,默认中断);短(0x04);短路((定义为振荡振荡器)?绝对值(γ振荡子):绝对(α,默认中断)& gt;& gt;16)& 0x7f;短(0);…} & JT IVT在Bootloader GLD/***图中用于中断向量表*/Cuths{/**。本节定义了一个存在于用户空间中的中断重映射表。每一行代表**表中的条目。每个条目都包含一个“Goto OyDebug中断”或“GTO to SyEnter中断”**,这取决于在用户代码中是否定义了用于中断的中断处理程序。真正的IVT表**在每个中断向量条目中都有一个固定的跳到这个表中的一个条目。* /应用程序IVT.AppIVItBase: {短(绝对(重置));短(0x04);短(绝对(α-Read)& gt;& gt;16)& 0x7f);短(0);短(定义(α,保留,rTRAP0))绝对值(α-RealvEdTrAP0):绝对值(α-Debug中断);短(0x04);短(定义)(绝对(α-RealvEdTrAP0)& gt;& gt;16)& 0x7f:(绝对(α-Debug中断)& gt;and 16;);0x7f);短(0);短(定义(α,振荡,失效))绝对值(γ振荡子失败):绝对(α,默认中断);短(0x04);短路(定义(振荡)?(绝对(So SurvivaRebug)& gt;& gt;16)& 0x7f:(绝对(α-Debug中断)& gt;and 16;);0x7f);短(0);短(定义)(?绝对(α-AdxRelsRor):绝对(α-Debug中断);短(0x04);短(定义)?(绝对(α-AddiSRESRR)& gt;& gt;16)& 0x7f:(绝对(α-Debug中断)& gt;and 16;);0x7f);短(0);……DeFultTyValth.=;短(绝对(α-Debug中断));短(0x04);短((绝对(α-Debug中断)& gt;and 16;);0x7f);短(0);}我希望我没有写给许多虚拟的东西!谢谢!
以上来自于百度翻译
以下为原文
I hope so! Let´s try step-by-step...
Something like this on my GLD files?
BootLoader GLD
/*
** Memory Regions
*/
MEMORY
{
data (a!xr) : ORIGIN = 0x1000, LENGTH = 0x8000
reset : ORIGIN = 0x0, LENGTH = 0x4
ivt : ORIGIN = 0x4, LENGTH = 0x1FC
program (xr) : ORIGIN = 0x200, LENGTH = 0x21FC /* Only reduced the prog size */
isrcontrol : ORIGIN = 0x23FC, LENGTH = 0x4 /* Control area to isr´s jump table */
....
}
...
__CODE_BASE = 0x200;
__CODE_LENGTH = 0x2200;
__IVT_BASE = 0x4;
__ISRCONTROL_BASE = 0x23FC;
App GLD
/*
** Memory Regions
*/
MEMORY
{
data (a!xr) : ORIGIN = 0x1000, LENGTH = 0x8000
reset : ORIGIN = 0x2400, LENGTH = 0x4 /* Change location */
ivt : ORIGIN = 0x2404, LENGTH = 0x1FC /* Change location */
program (xr) : ORIGIN = 0x2600, LENGTH = 0x2200 /* Change location and size (for tests only)*/
...
}
...
__CODE_BASE = 0x2400; /* Change location */
__CODE_LENGTH = 0x2200; /* Change size (for tests only) */
__IVT_BASE = 0x2404; /* Change location */
This "isrcontrol" area is enough? Using something like this won´t reduce my MCU lifetime (too many writes in a flash memory)?
Coded normally (i.e. void __attribute__((__interrupt__(__save__(ACCAH,ACCAL)),no_auto_psv)) _T1Interrupt(void) )?
OK, but how to store this addresses in APP IVT? Like this in a bootloader GLD(I found it in an article here in forum - sorry authors, I forgot to copy the link):
/*
** Interrupt Vector Table
**
** This table has been modified from the original content to jump to the .application_ivt goto table.
** This is done so that when this linker file is used to program a device using a programmer instead
** of the bootloader, it will work just like the bootloader resulting in identical interrupt latency.
*/
.ivt __IVT_BASE :
{
LONG(ABSOLUTE(__APP_IVT_BASE) + 0x004); /* __ReservedTrap0 */
LONG(ABSOLUTE(__APP_IVT_BASE) + 0x008); /* __OscillatorFail */
LONG(ABSOLUTE(__APP_IVT_BASE) + 0x00C); /* __AddressError */
LONG(ABSOLUTE(__APP_IVT_BASE) + 0x010); /* __StackError */
.....
.....
} >ivt
Or like his in an APP GLD (also copied from the forum, again sorry authors):
*** Close the Memory section ***
J_ReservedTrap0 = 0x0C02;
J_OscillatorFail = 0x0C06;
J_AddressError = 0x0C0A;
J_StackError = 0x0C0E;
....
....
Again, how to do it?
In an APP GLD
/*
** Interrupt Vector Tables
*/
.j_ivt __JIVT_BASE :
{
SHORT(0x05); /* Bootloader timeout in sec */
SHORT(0x00);
/* __ReservedTrap0 */
SHORT(DEFINED(__ReservedTrap0) ? ABSOLUTE(__ReservedTrap0) :
ABSOLUTE(__DefaultInterrupt));
SHORT(0x04);
SHORT(((DEFINED(__ReservedTrap0) ? ABSOLUTE(__ReservedTrap0) :
ABSOLUTE(__DefaultInterrupt)) >> 16) & 0x7F);
SHORT(0);
/* __OscillatorFail */
SHORT(DEFINED(__OscillatorFail) ? ABSOLUTE(__OscillatorFail) :
ABSOLUTE(__DefaultInterrupt));
SHORT(0x04);
SHORT(((DEFINED(__OscillatorFail) ? ABSOLUTE(__OscillatorFail) :
ABSOLUTE(__DefaultInterrupt)) >> 16) & 0x7F);
SHORT(0);
...
...
} >j_ivt
In bootloader GLD
/*
** Section Map for Interrupt Vector Tables
*/
SECTIONS
{
/*
** This section defines a interrupt remap table that exists in the user space. Each line represents
** an entry in the table. Each entry contains either a "goto __DefaultInterrupt" or "goto __CertainInterrupt"
** depending on if the interrupt handler for __CertainInterrupt is defined in the user code. The real IVT table
** has a fixed jump at each of the interrupt vector entries to an entry in this table.
*/
.application_ivt __APP_IVT_BASE :
{
SHORT(ABSOLUTE(__reset)); SHORT(0x04); SHORT((ABSOLUTE(__reset) >> 16) & 0x7F); SHORT(0);
SHORT(DEFINED(__ReservedTrap0) ? ABSOLUTE(__ReservedTrap0) : ABSOLUTE(__DefaultInterrupt)); SHORT(0x04); SHORT(DEFINED(__ReservedTrap0) ? (ABSOLUTE(__ReservedTrap0) >> 16) & 0x7F : (ABSOLUTE(__DefaultInterrupt) >> 16) & 0x7F); SHORT(0);
SHORT(DEFINED(__OscillatorFail) ? ABSOLUTE(__OscillatorFail) : ABSOLUTE(__DefaultInterrupt)); SHORT(0x04); SHORT(DEFINED(__OscillatorFail) ? (ABSOLUTE(__OscillatorFail) >> 16) & 0x7F : (ABSOLUTE(__DefaultInterrupt) >> 16) & 0x7F); SHORT(0);
SHORT(DEFINED(__AddressError) ? ABSOLUTE(__AddressError) : ABSOLUTE(__DefaultInterrupt)); SHORT(0x04); SHORT(DEFINED(__AddressError) ? (ABSOLUTE(__AddressError) >> 16) & 0x7F : (ABSOLUTE(__DefaultInterrupt) >> 16) & 0x7F); SHORT(0);
....
....
DEFAULT_VECTOR = .;
SHORT(ABSOLUTE(__DefaultInterrupt)); SHORT(0x04); SHORT((ABSOLUTE(__DefaultInterrupt) >> 16) & 0x7F); SHORT(0);
}
I hope I didn´t write to many dummy things!
Thanks!