Problem compiling V2.890 using CodeWarrior

A forum for discussing the creation, modification, and loading of embedded code for B&G MS-I/MS-II.
Forum rules
Read the manual to see if your question is answered there before posting. Many users will not reply if the answer is already available in the manual.

If your question is about troubleshooting, configuration, or tuning, you MUST include your processor type (MS-I or MS-II) and code version in your post. If your question is about PCB assembly or modifications, you must also include the main board version number (1.01, 2.2 or 3.0).

If you have questions about MS1/Extra or MS2/Extra code configuration or tuning, please post them at www.msextra.com Such questions posted here will be moved to: a temporary MSextra sub-forum, where they will be removed after 7 days

The full forum rules are here: Forum Rules, be sure to read them all regularly.
Post Reply
MotoDan
MegaSquirt Newbie
Posts: 6
Joined: Wed Apr 27, 2011 6:07 pm

Problem compiling V2.890 using CodeWarrior

Post by MotoDan »

I'm just getting started with trying to build MS-II V2.890 using CodeWarrior V5.9.0 and am getting the following error:

Error : C12087: Not a valid operand
main_v2.890.c line 2371
Error : C10000: Nothing more expected

Here's the section of code that contains the error:

Code: Select all

tmp2 = inpram.tpsmax - inpram.tps0;
   asm {
 			    ldy  tmp1
 			    ldd  #1000
 			    EMULS
 			    ldx  tmp2  <--- ERROR (line 2371)
 			    EDIVS
 			    sty tmp1
   }
I've made sure I have the correct supporting files: hcs12def.h, maffactor.inc, and flash.h. My CW is an evaluation version, but I don't think I'm exceeding the code limit (yet).

Any help would be appreciated.
Dan
grippo
Site Admin
Posts: 286
Joined: Mon Feb 16, 2004 6:55 pm

Re: Problem compiling V2.890 using CodeWarrior

Post by grippo »

You are probably using a newer version of CW than the original code. The newer versions don't like variables named tmpn (don't ask me why), so all the tmpn variables need to be replaced with tmpxn.
MotoDan
MegaSquirt Newbie
Posts: 6
Joined: Wed Apr 27, 2011 6:07 pm

Re: Problem compiling V2.890 using CodeWarrior

Post by MotoDan »

Thanks for the reply Al. My compiler errors went away once I renamed all of the tmpx vars. Might be a good idea to change them in the current source code. FYI - my CodeWarrior version is 5.9.0.

I think I'm almost there, but am now getting a linker error:

Link Error : L1822: Symbol SpSub in file main_v2.890.c.o is undefined.

When I commented out this external reference the error just moved to the next external reference. I'm wondering if I'm exceeding the code limits of CW which I believe might be 32K?
grippo
Site Admin
Posts: 286
Joined: Mon Feb 16, 2004 6:55 pm

Re: Problem compiling V2.890 using CodeWarrior

Post by grippo »

I don't think you are exceeding the limit, I think you need the Flash.asm file attached. You should also put it in the CW project directory.
You do not have the required permissions to view the files attached to this post.
MotoDan
MegaSquirt Newbie
Posts: 6
Joined: Wed Apr 27, 2011 6:07 pm

Re: Problem compiling V2.890 using CodeWarrior

Post by MotoDan »

I checked my CW project and I already have flash.asm and flash.h in my sources folder. Not quite sure why CW can't locate the four external functions (reboot,monitor,SpSub, and NoOp). Maybe I should be working with a later version of MS code? I could not find the source files for v2.900 and above. All I could find were the S19 hex files.
MotoDan
MegaSquirt Newbie
Posts: 6
Joined: Wed Apr 27, 2011 6:07 pm

Re: Problem compiling V2.890 using CodeWarrior

Post by MotoDan »

Al,

I went ahead and replaced my flash.asm and flash.h files with the ones you attached and got a little farther down the linking process. The error I'm getting now is:

Link Error : L1102: Out of allocation space in segment ROM_C000 at address 0xF48E
Link Error : Link failed

Could this be due to the 32K limitation that my version of CW has?
grippo
Site Admin
Posts: 286
Joined: Mon Feb 16, 2004 6:55 pm

Re: Problem compiling V2.890 using CodeWarrior

Post by grippo »

It might be - I know the code + data is well over 32K, but I don't know how CW figures out the limit, whether it code only or code + data. If you need to cut code, the first place I would try is get rid of CAN.
Post Reply