keil如何设置overlay,避免局部变量覆盖.新手求助!!!
keil用变量覆盖的方法,分配局部变量.
我用SMALL RTOS51 写任务时,它会把我任务的局部变量分配到同一个内存中,程序就错了
在OVERLAY里边设置,可以分配在不同的空间,可是我不懂怎么设置!
有4个任务,LED0到LED3
为了防止keil使局部变量覆盖,设置overlay仿照例子,我填入的内容是main~LED1,main~LED2,main~LED3
程序是实时运行起来了,但是不知道上面填入的内容是什么意思.
英文有点差,下面是关于overlay的介绍
Removing Call References Between Segments
OVERLAY (sfname-caller ~ sfname-callee)
OVERLAY (sfname-caller ~ (sfname-callee, sfname-callee))
This form of the OVERLAY directive specifies that references from sfname-caller to sfname-callee are to be removed from overlay analysis.
Function references are automatically added to overlay analysis when you reference one function inside another (typically, these references are function calls). If you reference the address of a function (without calling the function), the linker considers this to be a reference between the two functions and it is included in overlay analysis. You may remove this reference manually using this form of the OVERLAY directive.
Referring to the following overlay map:
SEGMENT DATA_GROUP
+--> CALLED SEGMENT START LENGTH
----------------------------------------------
?PR?_FUNC?DMAIN ----- -----
+--> ?PR?_FUNC_A?DMAIN
+--> ?PR?_FUNC_B?DMAIN
You may remove the references from ?PR?_FUNC?DMAIN to ?PR?_FUNC_A?DMAIN and ?PR?_FUNC_B?DMAIN with the following OVERLAY command:
OVERLAY(?PR?_FUNC?DMAIN ~ (?PR?_FUNC_A?DMAIN,?PR?_FUNC_B?DMAIN))
我用SMALL RTOS51 写任务时,它会把我任务的局部变量分配到同一个内存中,程序就错了
在OVERLAY里边设置,可以分配在不同的空间,可是我不懂怎么设置!
有4个任务,LED0到LED3
为了防止keil使局部变量覆盖,设置overlay仿照例子,我填入的内容是main~LED1,main~LED2,main~LED3
程序是实时运行起来了,但是不知道上面填入的内容是什么意思.
英文有点差,下面是关于overlay的介绍
Removing Call References Between Segments
OVERLAY (sfname-caller ~ sfname-callee)
OVERLAY (sfname-caller ~ (sfname-callee, sfname-callee))
This form of the OVERLAY directive specifies that references from sfname-caller to sfname-callee are to be removed from overlay analysis.
Function references are automatically added to overlay analysis when you reference one function inside another (typically, these references are function calls). If you reference the address of a function (without calling the function), the linker considers this to be a reference between the two functions and it is included in overlay analysis. You may remove this reference manually using this form of the OVERLAY directive.
Referring to the following overlay map:
SEGMENT DATA_GROUP
+--> CALLED SEGMENT START LENGTH
----------------------------------------------
?PR?_FUNC?DMAIN ----- -----
+--> ?PR?_FUNC_A?DMAIN
+--> ?PR?_FUNC_B?DMAIN
You may remove the references from ?PR?_FUNC?DMAIN to ?PR?_FUNC_A?DMAIN and ?PR?_FUNC_B?DMAIN with the following OVERLAY command:
OVERLAY(?PR?_FUNC?DMAIN ~ (?PR?_FUNC_A?DMAIN,?PR?_FUNC_B?DMAIN))
...全文
相关推荐
keil头文件路径设置
总结了keil中常见的几种头文件添加的方法。
keil中的警告及错误分析解决.pdf
嵌入式中keil程序设计常见错误和警告,总共十三个。
KEIL警告: MULTIPLE CALL TO SEGMENT
今天来说说*** WARNING L15: MULTIPLE CALL TO SEGMENT这个问题!
keil软件编译常见错误解释总结和中文翻译
keil软件编译常见错误解释总结和中文翻译,包括错误编号和解释
keil调试中的错误总结
keil调试中的错误总结 (1)提示无M51文件 编译时候提示: F:\...\XX.M51 File has been changed outside the editor, reload ? ------ 解决方法: 重新生成项目,产生STARTUP.A51即可。 (2)L15重复调用 ***WARNING L15: MULTIPLE CALL TO SEGMENT SEGMENT: ?PR?SPI_RECEIVE_WORD?D_SPI CALLER1: ?PR?VSYNC_INTERRUPT?MAIN CALLER2: ?C_C51STARTUP 该警告表示连接器发现有一个函数可能会被主函数和一个中断服务程序(或者调用中断服务程序的函数)同时调用,或者同时被多个中断服务程序调用。


单片机/工控
