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

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

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

Jump to solution
1,493 Views
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

Labels (1)
0 Kudos
Reply
1 Solution
814 Views
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

View solution in original post

0 Kudos
Reply
1 Reply
815 Views
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 Kudos
Reply