Define a value in particular address in RAM but it needs to be in the .bss list

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

Define a value in particular address in RAM but it needs to be in the .bss list

1,535 次查看
JimMcP
Contributor I
I need to define a value in RAM. This value is uninitialized and needs to be in the .bss list  (battery backed up). Using  the following syntax it is alway intialized,,,


// LCF file

   bootSec  (RWX) : ORIGIN = 0x20007FF0,  LENGTH = 0x00000008
.........

   .myData :
   {
      *(.myData)
   } > bootSec

// main.c  file

#pragma push
#pragma define_section myData ".myData" far_absolute RW
#pragma pop
__declspec(myData) long flash_process;

///////////////////////

I need it to be defined in the .bss list  at the particular ram location 0x20007FF0

Thank you in advance..

 

标签 (1)
0 项奖励
1 回复

374 次查看
CrasyCat
Specialist III
Hello
 
Variables defined in .bss section are initialized with 0 at startup.
If you want to define persistent variables with CodeWarrior for MPC, look at FAQ 27500.
 
You can find it at following URL:
 
CrasyCat
0 项奖励