Problem with Linker after changing Memory model to Banked.

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

Problem with Linker after changing Memory model to Banked.

ソリューションへジャンプ
2,892件の閲覧回数
bhubert
Contributor I
Hello,

I'm currently using CodeWarrior 3.1 for HCS12 with MC9S12C128CFU16. I changed my memory model to Banked instead of Short and now I get the following Error.

ERROR: Different memory models are set in the linker setting....

Anyone know what I would need to do to correct this so I can use the Banked memory model? I don't see any settings that I should need to change in the Linker Properties.

Thanks
ラベル(1)
タグ(1)
0 件の賞賛
返信
1 解決策
855件の閲覧回数
CrasyCat
Specialist III

Hello

In fact you have to specify that pragma in front of both the implementation and prototype of the function.

Can you please try.

CrasyCat

元の投稿で解決策を見る

0 件の賞賛
返信
4 返答(返信)
855件の閲覧回数
bhubert
Contributor I
Actually I got that problem sovled now but I get this different Linker Error.

L1907: Fixup overflow in _vect, to gCan_TxIntHandler type 1, at offset 0x30

same error on all 4 CAN Ints...

anyone have any ideas on how to correct this problem?

Thanks
0 件の賞賛
返信
856件の閲覧回数
CrasyCat
Specialist III

Hello

The message is generated because the function gCan_TxIntHandler, which is an interrupt function is not allocated in non banked memory.

In Banked memory model all interrupt functions should be allocated in a __NEAR_SEG code Section.

Place following pragma prior to your interrupt function implementation:

#ifndef __SMALL__
#pragma CODE_SEG __NEAR_SEG NON_BANKED
#endif

 

Place following pragma after the function implementation

#ifndef __SMALL__
#pragma CODE_SEG DEFAULT

#endif

I hope this helps.

CrasyCat

856件の閲覧回数
bhubert
Contributor I
CrasyCat,

I thought that is what that problem is suppose to mean but in the .h file there is this:

#pragma CODE_SEG __NEAR_SEG NON_BANKED /* Interrupt section for this module. Placement will be in NON_BANKED area. */
__interrupt void gCan_TxIntHandler(void);

#pragma CODE_SEG DEFAULT /* Change code section to DEFAULT.

I thought this should take care of all of that. Any suggestions, it just doesn't seem to make sense to me.

Thanks
0 件の賞賛
返信
856件の閲覧回数
CrasyCat
Specialist III

Hello

In fact you have to specify that pragma in front of both the implementation and prototype of the function.

Can you please try.

CrasyCat

0 件の賞賛
返信