CW10.0 pragma section begin

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

CW10.0 pragma section begin

1,879 次查看
WHookway
Contributor III

Hello,

I am trying t o use the external RAM on the M52259EVL board.  I have defined a section as:

 

#pragma define_section extData ".extdata" ".extdatabss" far_absolute RW
#pragma section extData begin
unsigned char    myExtData = 5;
unsigned char    myExtData1;
unsigned char    myExtData2[10] = {1,2,3,4,5,6,7,8,9,0};
#pragma section extData end

 

Initialized variables are placed in .extdata as I would hope for.

myExtData1 is placed in bss and I have not been able to get it to .extdatabss.

 

If I try:

 

#pragma define_section extData ".extdata" ".extdatabss" far_absolute RW
#define    EXT_RAM        __declspec(extData)


EXT_RAM    unsigned char    myExtData = 5;
EXT_RAM    unsigned char    myExtData1;
EXT_RAM    unsigned char    myExtData2[10] = {1,2,3,4,5,6,7,8,9,0};

 

It works like a charm, any ideas?

 

Thanks,

Will

 

标签 (1)
标记 (1)
0 项奖励
回复
2 回复数

1,253 次查看
kecart
Contributor III

The only thing I see is that myExtData1 is the only variable that is not initialized in it's declaration.  Try

unsigned char myExtData1=0;

instead of

unsigned char myExtData1;

and see if that gives you the expected results.

0 项奖励
回复

1,253 次查看
CrasyCat
Specialist III

Hello

 

On my side I always use __declspec to place symbols into a user defined section,

 

If the pragma section begin ...pragma section end does not work as documented I would recommend you to

report a defect through our on-line support web page.

 

Click here to submit a service request.

Make sure to attach a reproducible project and installed product information to the service request.

CrasyCat

0 项奖励
回复