Uninitialize the variable of different segemnts

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

Uninitialize the variable of different segemnts

1,016 次查看
ambarishhundeka
Contributor III

Hi,

I need to locate the variables in different segments of the memory (ROM or RAM ) without initialization (not initialization to 0 at the start up time). 

 

in IAR IDE , we can use no_init syntax to the variables. 

 

ex: 

#pragma segment = "ABC"  

__no_init int varaible1; 

__no_init int varaible2; 

 

I just to know what is the syntax for gcc compiler to for not to initialize the variable. 

below code is to locate the variable to paricular segment but it is initialized to 0. 

__attribute__((section(".ABC"))) int varaible1; 

 

Kindly help me in this. 

 

Regards, 

Ambarish

标签 (3)
1 回复

879 次查看
martin_kovar
NXP Employee
NXP Employee

Hello,

I have already sent you the answer in the thread below. Please do not duplicate threads. Thank you for understanding.

https://community.nxp.com/thread/466714 

Regards,

Martin