Using Processor Expert .cmd file values like F_StackAddr in C code

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

Using Processor Expert .cmd file values like F_StackAddr in C code

Jump to solution
1,397 Views
dynapb
Contributor IV

Hi All,

Is there an easy way to use the Processor Expert generated .cmd command file values like F_StackAddr in my C code.

Does something need to be included in the C file?

I tried just using F_StackAddr or _StackAddr or StackAddr but no luck.

Thanks,

Pete

0 Kudos
1 Solution
1,154 Views
dynapb
Contributor IV

The values in the command file are pointers.

In order to use the value, ie get the addres of the Stack, you need to take the adddress of the value as follows:

 

extern uint16_t _StackAddr;     //NOTE remove the F in F_StackAddr.

uint16_t *StackAddress;

 

StackAddress = &_StackAddr;

 

Pete

View solution in original post

0 Kudos
4 Replies
1,154 Views
CrasyCat
Specialist III

Hello

 

- Which CPU are you targeting (HC08, HC12, Coldfire, ..)
- Which version of CodeWarrior are you using?

 

CrasyCat

0 Kudos
1,154 Views
dynapb
Contributor IV

Hi CrasyCat,

I use CW V7.3 for 56800/E and am using a DSP56F8367 DSC.

Pete

0 Kudos
1,154 Views
dynapb
Contributor IV

I figured it out.  It is described in the Targeting MC56F83xx manual.

 

I just needed to declare it in my C file like:

 

extern unsigned int _StackAddr;     //NOTE remove the F in F_StackAddr.

0 Kudos
1,155 Views
dynapb
Contributor IV

The values in the command file are pointers.

In order to use the value, ie get the addres of the Stack, you need to take the adddress of the value as follows:

 

extern uint16_t _StackAddr;     //NOTE remove the F in F_StackAddr.

uint16_t *StackAddress;

 

StackAddress = &_StackAddr;

 

Pete

0 Kudos