keil如何设置overlay,避免局部变量覆盖.新手求助!!!

iamlbccc iamlbccc 墨衍会员 · AI 创作全网分发 墨衍智能分发 通过墨衍一键同步至各平台 可同步平台 CSDN微信公众号微博知乎掘金百家号博客园抖音小红书 你的文章也可以这样分发 墨衍会员 ¥399起/年,写一次发全网 我也要 + 加入社区
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))
...全文

相关推荐

评论 4
收藏 已收藏
分享
返回顶部
iamlbccc
单片机/工控 27,522 成员 28,796 内容