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

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

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

ソリューションへジャンプ
2,180件の閲覧回数
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,937件の閲覧回数
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,937件の閲覧回数
CrasyCat
Specialist III

Hello

 

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

 

CrasyCat

0 件の賞賛
返信
1,937件の閲覧回数
dynapb
Contributor IV

Hi CrasyCat,

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

Pete

0 件の賞賛
返信
1,937件の閲覧回数
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,938件の閲覧回数
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 件の賞賛
返信