CW10.0 pragma section begin

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

CW10.0 pragma section begin

2,178件の閲覧回数
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,552件の閲覧回数
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,552件の閲覧回数
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 件の賞賛
返信