CW10.0 pragma section begin

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

CW10.0 pragma section begin

2,119 Views
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

 

Labels (1)
0 Kudos
Reply
2 Replies

1,493 Views
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 Kudos
Reply

1,493 Views
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 Kudos
Reply