MPC5674; moving variables from different source files to one section

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

MPC5674; moving variables from different source files to one section

429 Views
sumanththallam
Contributor I

Hello,

 

i am trying to move the variables declared in different source files to one section.

 

x1.c contains static UINT8 y;

x2.c contains static UINT8 u;

 

i want to move the variables y,u to a new section without modifying the x1.c and x2.c .

 

can any one suggest on how to achieve it.

 

i have created a section tryme and trying to use __declspec as follows.

 

temp.c

line 1: #pragma section data_type ".tryme" ".tryme"
line 2: __declspec(section ".tryme") extern UINT8 y;

line 3: __declspec(section ".tryme") extern UINT8 u;

 

i am getting compiler error as "parse error  near '".tryme"'v " at the lines 2,3

 

can any onse suggest the approach is correct.

 

thanks in advance.

 

Thanks & Regards,

Sumanth

Tags (1)
0 Kudos
1 Reply

268 Views
CrasyCat
Specialist III

Hello

 

    This is working fine for me on CodeWarrior for MPC55xx V2.x.

    Note that the __declspec needs to be specified in the variable definition as well (declaration is not enough).

 

   I would recommend you to submit a service request for that.

Click here to submit a service request.

Make sure to attach a reproducible project and installed product information to the service request.
To generate the required information:
- Start CodeWarrior
- Open the project
- Select "Help" -> "Pack and Go" and follow instructions on the screen.

Attach the generated .zip file to the SR.

 

CrasyCat

0 Kudos