Problem with Linker after changing Memory model to Banked.

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

Problem with Linker after changing Memory model to Banked.

跳至解决方案
3,502 次查看
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 解答
1,465 次查看
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 回复数
1,465 次查看
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 项奖励
回复
1,466 次查看
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

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