Problem with Linker after changing Memory model to Banked.

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

Problem with Linker after changing Memory model to Banked.

Jump to solution
2,721 Views
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
Labels (1)
Tags (1)
0 Kudos
Reply
1 Solution
684 Views
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

View solution in original post

0 Kudos
Reply
4 Replies
684 Views
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 Kudos
Reply
685 Views
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

685 Views
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 Kudos
Reply
685 Views
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 Kudos
Reply