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

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

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

跳至解决方案
1,631 次查看
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 项奖励
回复
1 解答
1,388 次查看
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 项奖励
回复
4 回复数
1,388 次查看
CrasyCat
Specialist III

Hello

 

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

 

CrasyCat

0 项奖励
回复
1,388 次查看
dynapb
Contributor IV

Hi CrasyCat,

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

Pete

0 项奖励
回复
1,388 次查看
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 项奖励
回复
1,389 次查看
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 项奖励
回复