Page 2 of 8

Re: MS2 development/coding for dummies

Posted: Mon Jan 30, 2012 3:04 am
by Jobro
Note the error trying to compile MS2e2.1.0E

make[1]: c:/usr/bin/m6811-elf-gcc: Command not found

No problem compiling MS2e3.xxx
No problem compiling ms3

inspect ms2e311 makefile.ms2

Code: Select all

#PROGPREF=$(BINDIR)/m6811-elf-
PROGPREF=$(BINDIR)/m9s12x-elf-
inspect ms2e210 makefile.ms2

Code: Select all

PROGPREF=$(BINDIR)/m6811-elf-

Where do I get m6811-elf tools or whatever they are?

Re: MS2 development/coding for dummies

Posted: Mon Jan 30, 2012 5:02 am
by jsmcortina
Recently we've named the build tools with the m9s12x- prefix instead of m6811- So you'll need to edit that one line in the Makefile to match the filenames of the build tools you have installed.
Why would you want to build 2.1.0 though? It is obsolete.

James

Re: MS2 development/coding for dummies

Posted: Mon Jan 30, 2012 3:36 pm
by Jobro
jsmcortina wrote:Recently we've named the build tools with the m9s12x- prefix instead of m6811- So you'll need to edit that one line in the Makefile to match the filenames of the build tools you have installed.
Why would you want to build 2.1.0 though? It is obsolete.

James
I tried editing the line in the makefile.ms2. I get a different error if I do that. I will post a screen dump of the error after work.

I want to have a look at 2.1.0E because it is what I use. I am totally familiar with the operation of megatune, what all the settings do, where everything is etc. The setup as is is rock solid. I can run 121mph down the quarter mile all night long. I have extensively tested this firmware. No exaggeration when I say 40 1/4 mile passes, mostly in the 12 second band.

Tuning is not a small task when we are talking about a Wankel rotary 9.4:1 compression motor using 20psi boost. Lets not foget 12A rotor housings got scarce in 2006 and this engine is one of the last properly rebuilt ones. Value to me = priceless.

Re: MS2 development/coding for dummies

Posted: Tue Jan 31, 2012 2:14 am
by Jobro
The attached png screen dump shows what error I get if I comment out the line referring to m6811-elf and include the line referring to m9s12x-elf

Code: Select all

#PROGPREF=$(BINDIR)/m6811-elf-
PROGPREF=$(BINDIR)/m9s12x-elf-
I would really like to get this compiling if you guys can help. Next week I should have some time to flash the recompiled default source into my car. Then I can start looking at how things are done. Obviously there is no point me doing this if I can't build the .s19.

Re: MS2 development/coding for dummies

Posted: Thu Feb 02, 2012 7:55 am
by Jobro
OK well I worked out the problem trying to compile ms2e2xx code using the current release build tools.

I can compile any of the current firmwares now .s19s for ms2e2xx ms2e3xx and ms3.

Are these meaningless warnings or something significant? I'm quite interested in putting this firmware into my car.

Code: Select all

ms2_extra_main.o(.rodata+0x5414): reference to a banked address [3c:a400] in the normal address space at 5414
ms2_extra_main.o(.rodata+0x5416): reference to a banked address [3c:a400] in the normal address space at 5416
ms2_extra_main.o(.rodata+0x541a): reference to a banked address [3c:ac00] in the normal address space at 541a
ms2_extra_main.o(.rodata+0x541c): reference to a banked address [3c:ac00] in the normal address space at 541c
ms2_extra_main.o(.rodata+0x5420): reference to a banked address [3c:b400] in the normal address space at 5420
ms2_extra_main.o(.rodata+0x5422): reference to a banked address [3c:b400] in the normal address space at 5422
ms2_extra_main.o(.rodata+0x5426): reference to a banked address [3c:b800] in the normal address space at 5426
ms2_extra_main.o(.rodata+0x5428): reference to a banked address [3c:b800] in the normal address space at 5428

Re: MS2 development/coding for dummies

Posted: Thu Feb 02, 2012 8:30 am
by racingmini_mtl
You can ignore those warnings.

Jean

Re: MS2 development/coding for dummies

Posted: Thu Feb 02, 2012 2:25 pm
by Jobro
racingmini_mtl wrote:You can ignore those warnings.

Jean
Thanks!

Re: MS2 development/coding for dummies

Posted: Thu Feb 02, 2012 4:47 pm
by jsmcortina
Jobro wrote:OK well I worked out the problem trying to compile ms2e2xx code using the current release build tools.
What did you do?

James

Re: MS2 development/coding for dummies

Posted: Fri Feb 03, 2012 5:21 am
by Jobro
jsmcortina wrote:
Jobro wrote:OK well I worked out the problem trying to compile ms2e2xx code using the current release build tools.
What did you do?

James
A shitload of googlefu which found a whole heap of dead links. Eventually I learned that what was doing was looking for a gcc aged around 3.xx version, precompiled to an exe installer package designed specifically to be used with cygwin. No way on this earth would I be able to compile the src myself.

Anyway the package that works is called

The GNU Development Toolchain for 68HC11/HC12. It was an exe file. I moved my megasquirt build tools c:\usr to c:\usr_back, and then installed that and it worked straight away.

Re: MS2 development/coding for dummies

Posted: Fri Feb 03, 2012 5:47 am
by jsmcortina
You are using the old compiler then. The version on the MSEXTRA site has a significantly faster 32bit divide.

James

Re: MS2 development/coding for dummies

Posted: Fri Feb 03, 2012 2:26 pm
by Jobro
The screen dump 6 posts up shows what happens when I try to use the newer tools with ms2e2.1.0E code. There is an error in line 448 of ign_isr.s "addressing mode not implemented yet".

You're welcome to tell me how to fix that :lol:

Re: MS2 development/coding for dummies

Posted: Sun Feb 05, 2012 8:33 am
by jsmcortina
Jobro wrote:The screen dump 6 posts up shows what happens when I try to use the newer tools with ms2e2.1.0E code. There is an error in line 448 of ign_isr.s "addressing mode not implemented yet".

You're welcome to tell me how to fix that :lol:
That's a bug in that old MS2/Extra code.

Code: Select all

   bset    #TFLG_ign, TIE; 	// set TIE
Arguments are reversed, should be:

Code: Select all

   bset    TIE, #TFLG_ign; 	// set TIE
James

Re: MS2 development/coding for dummies

Posted: Mon Feb 06, 2012 5:52 am
by Jobro
jsmcortina wrote:
Jobro wrote:The screen dump 6 posts up shows what happens when I try to use the newer tools with ms2e2.1.0E code. There is an error in line 448 of ign_isr.s "addressing mode not implemented yet".

You're welcome to tell me how to fix that :lol:
That's a bug in that old MS2/Extra code.

Code: Select all

   bset    #TFLG_ign, TIE; 	// set TIE
Arguments are reversed, should be:

Code: Select all

   bset    TIE, #TFLG_ign; 	// set TIE
James
Hey so why does it compile with no errors the older tools then?

Re: MS2 development/coding for dummies

Posted: Mon Feb 06, 2012 5:57 am
by Jobro
OK I reverted to the new code tools, edited the makefile.ms to point to the new tools and flipped that line in the ign ISR and yes it does also compile that way.

Will both the s19 files work?

What would happen if I loaded the .s19 file built from the older m6811 tools with that bug in the source code

Re: MS2 development/coding for dummies

Posted: Mon Feb 06, 2012 8:24 am
by racingmini_mtl
Jobro wrote:What would happen if I loaded the .s19 file built from the older m6811 tools with that bug in the source code
You'd have a larger, slower code with a bug.

Jean

Re: MS2 development/coding for dummies

Posted: Mon Feb 06, 2012 12:58 pm
by jsmcortina
Jobro wrote:Hey so why does it compile with no errors the older tools then?
Because there's a bug in the older tools.

James

Re: MS2 development/coding for dummies

Posted: Wed Feb 08, 2012 2:28 am
by Jobro
jsmcortina wrote:
Jobro wrote:Hey so why does it compile with no errors the older tools then?
Because there's a bug in the older tools.

James
Is the line intentionally written with the wrong order because the old tools had a bug?
What exactly happens haha?
Would the code I have in my car have that bug?
I'm going to post up concise dumps hoping one of you guys can confirm I'm not having any bad messages.

Re: MS2 development/coding for dummies

Posted: Wed Feb 08, 2012 4:03 am
by jsmcortina
No, it was just a bug in the code that the old build tools didn't highlight. Two wrong don't make a right.

Check the .dmp output to see what it actually disassembles back to. My guess is that it will end up setting the wrong bits in the wrong byte. The timer could behave unexpectedly as a result.

James

Re: MS2 development/coding for dummies

Posted: Tue Apr 17, 2012 7:50 pm
by gslender
James/Ken - can you sticky this so that new users who come into the development forum can easily find it... this is a good primer for getting started !

G

Re: MS2 development/coding for dummies

Posted: Sun May 13, 2012 2:57 am
by Jobro
Its been 3 months and I still haven't loaded the successfully compiled s19!

I really should go try now :P