Best way to stop volatile data being optimised out if variable unreferenced in code?

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 
已解决

Best way to stop volatile data being optimised out if variable unreferenced in code?

跳至解决方案
1,499 次查看
CarlFST60L
Senior Contributor II


Hi,

(Using CW 7.1.2, 52259EVB + MQX)

What is the best way to stop (volatile) data being optimised out if unreferenced in the code?

 

More info; We have thousands of variables in a single file which is linked to the external NVM (MRAM). As we do software updates, some of these variables are no longer referenced, therefore optimised out. This puts the rest of our variables at different address's for these versions making software updates impossible. Basically, if the MAP still had the varibles that were not referenced, the software would address the correct locations. Manually mapping hte address is not an option.

I had a look through the help files and was unable to find a 'simple' solution.

 

Thanks,

Carl

标签 (1)
标记 (1)
0 项奖励
回复
1 解答
820 次查看
CrasyCat
Specialist III

Hello

 

Please check your ColdFire_Build_Tools_Reference.pdf manual.

 

There is a pragma force_active as well as linker directives FORCE_ACTIVE, KEEP_SECTION or FORCEFILES that can help you achieve what you are looking for.

 

CrasyCat

在原帖中查看解决方案

0 项奖励
回复
1 回复
821 次查看
CrasyCat
Specialist III

Hello

 

Please check your ColdFire_Build_Tools_Reference.pdf manual.

 

There is a pragma force_active as well as linker directives FORCE_ACTIVE, KEEP_SECTION or FORCEFILES that can help you achieve what you are looking for.

 

CrasyCat

0 项奖励
回复