Modifying code

This is a forum for discussing the development and testing of alpha MS2/Extra code. Documentation
(Runs on MS2 and Microsquirt)

Moderators: jsmcortina, muythaibxr

rb26dett
Master MS/Extra'er
Posts: 497
Joined: Tue May 24, 2005 11:34 pm
Location: Auckland New Zealand

Post by rb26dett »

you could always code it the dirty way in the mean time before this is resolved by duplicating the code...

just a thought.
ms2,v3,cop,innovate,mazda fe3/fe-dohc 2l 4cyl with stock 10:1 pistons,4 stock coils,4 stock ignitors,rx7 550cc injectors maxed@6600rpm&17psi,custom everything,holset he351cw turbo,44mm ext gate,nis gtr bovs,nis gtr intercooler,70mm lexus throttle,chinese fpr,10may v2 ms2e alpha code
jsmcortina
Site Admin
Posts: 39615
Joined: Mon May 03, 2004 1:34 am
Location: Birmingham, UK
Contact:

Post by jsmcortina »

Have you examined the assembly output to see what it is doing?

James
I can repair or upgrade Megasquirts in UK. http://www.jamesmurrayengineering.co.uk

My Success story: http://www.msextra.com/forums/viewtopic ... 04&t=34277
MSEXTRA documentation at: http://www.msextra.com/doc/index.html
New users, please read the "Forum Help Page".
Keithg
Super MS/Extra'er
Posts: 2413
Joined: Sun Mar 06, 2005 9:15 am
Location: Chicago, IL, USA
Contact:

Modifying code

Post by Keithg »

Not to waste your time, but I did not know we could do that... How do we see that code? I just tried to look at the *.o files and they are binary. Is there a way of seeing the ASM. I am compiling the code using the 'make.bat ' file with the installed ms2compiler.zip package. The only files created in the directory I am using are the *.o files and the *.s19 when I double click on make.bat.

KeithG

On 8/24/07, jsmcortina wrote:
Have you examined the assembly output to see what it is doing?

James


jsmcortina
Site Admin
Posts: 39615
Joined: Mon May 03, 2004 1:34 am
Location: Birmingham, UK
Contact:

Post by jsmcortina »

I checked the assembly output generated on my PC and it is doing what you asked it to do.

James
I can repair or upgrade Megasquirts in UK. http://www.jamesmurrayengineering.co.uk

My Success story: http://www.msextra.com/forums/viewtopic ... 04&t=34277
MSEXTRA documentation at: http://www.msextra.com/doc/index.html
New users, please read the "Forum Help Page".
rb26dett
Master MS/Extra'er
Posts: 497
Joined: Tue May 24, 2005 11:34 pm
Location: Auckland New Zealand

Post by rb26dett »

do a -S in there somewhere and it wont go past making the assembly code.

fred.

edit : those last 2 posts appeared in reverse order in my email...
ms2,v3,cop,innovate,mazda fe3/fe-dohc 2l 4cyl with stock 10:1 pistons,4 stock coils,4 stock ignitors,rx7 550cc injectors maxed@6600rpm&17psi,custom everything,holset he351cw turbo,44mm ext gate,nis gtr bovs,nis gtr intercooler,70mm lexus throttle,chinese fpr,10may v2 ms2e alpha code
jsmcortina
Site Admin
Posts: 39615
Joined: Mon May 03, 2004 1:34 am
Location: Birmingham, UK
Contact:

Post by jsmcortina »

Ah yes... without using cygwin the "objdump" command doesn't work (for some reason) so the assembler output isn't created.
See the difference between Makefile and Makefile.DOS

Here's a snippet from the ms2_extra.dmp with the original code:

Code: Select all

000fc410 <LSM82>:
	    } else {
		if (outpc.tps > (int)flash5.pwmidle_tps_thresh) {
   fc410:	fc 39 c5    	ldd	39c5 <outpc>
   fc413:	bc 44 29    	cpd	4429 <flash5>
   fc416:	2f 2c       	ble	fc444 <LSM93>

000fc418 <LSM83>:
		    if (outpc.rpm > rpm_thresh) {
   fc418:	bd 39 b3    	cpy	39b3 <outpc>
   fc41b:	24 0d       	bcc	fc42a <LSM87>

000fc41d <LSM84>:
			DISABLE_INTERRUPTS;
   fc41d:	14 10       	sei

000fc41f <LSM85>:
			IACmotor_pos = flash5.pwmidle_closed_duty;
   fc41f:	f6 44 24    	ldab	4424 <flash5>
   fc422:	79 39 a4    	clr	39a4 <IACmotor_pos>
   fc425:	7b 39 a5    	stab	39a5 <IACmotor_pos>

000fc428 <LSM86>:
			ENABLE_INTERRUPTS;
   fc428:	10 ef       	cli

000fc42a <LSM87>:
		    }
		    if (IACmotor_reset == 0) {
James
I can repair or upgrade Megasquirts in UK. http://www.jamesmurrayengineering.co.uk

My Success story: http://www.msextra.com/forums/viewtopic ... 04&t=34277
MSEXTRA documentation at: http://www.msextra.com/doc/index.html
New users, please read the "Forum Help Page".
jsmcortina
Site Admin
Posts: 39615
Joined: Mon May 03, 2004 1:34 am
Location: Birmingham, UK
Contact:

Post by jsmcortina »

For debugging without BDM, use outpc.statusXXX in the code and display them in Megatune.
e.g. set outpc.status3 to zero normally and then set it to 1 if that section of code executes. That allows you to confirm what part of your code is malfunctioning. I think that you are unexpectedly executing some of the rest of the code due to that "OR" operation.

James
I can repair or upgrade Megasquirts in UK. http://www.jamesmurrayengineering.co.uk

My Success story: http://www.msextra.com/forums/viewtopic ... 04&t=34277
MSEXTRA documentation at: http://www.msextra.com/doc/index.html
New users, please read the "Forum Help Page".
pettaw
Helpful MS/Extra'er
Posts: 93
Joined: Fri Apr 29, 2005 6:56 am
Location: London, UK

Post by pettaw »

I tried compiling the code and I get a s.19 file that's smaller than the original, using the same source code. I'm using WindowsXP and the makefile.DOS. Will I need to use cygwin to make it compile correctly?
jsmcortina
Site Admin
Posts: 39615
Joined: Mon May 03, 2004 1:34 am
Location: Birmingham, UK
Contact:

Post by jsmcortina »

If I recall correctly, the "simplified gcc" package has a different release of the compiler (or different options) to the one Ken is using to build the code. I wouldn't be unduly worried about it.

James
I can repair or upgrade Megasquirts in UK. http://www.jamesmurrayengineering.co.uk

My Success story: http://www.msextra.com/forums/viewtopic ... 04&t=34277
MSEXTRA documentation at: http://www.msextra.com/doc/index.html
New users, please read the "Forum Help Page".
Keithg
Super MS/Extra'er
Posts: 2413
Joined: Sun Mar 06, 2005 9:15 am
Location: Chicago, IL, USA
Contact:

Post by Keithg »

It loads and works fine.

KeithG
Keithg
Super MS/Extra'er
Posts: 2413
Joined: Sun Mar 06, 2005 9:15 am
Location: Chicago, IL, USA
Contact:

Post by Keithg »

Ken/James,

I have been having troubles compiling the s19. Most every time I make an edit, it will load, but will generally lock up MT as I am cranking. I have noticed that when I use make.bat that the file size is off from the 'shipping' version by about 10k. I asked Shawn to compile it from Cygwin and he gets the same file size as the shipping version. I do not know if it is the compiler that is the problem, or the options set in the makefile.DOS, or what, but there seems to be a discrepancy. Is this something to worry about?

KeithG
Xtatic
Helpful MS/Extra'er
Posts: 108
Joined: Thu Oct 12, 2006 1:21 pm

Post by Xtatic »

Keith,

Depending on the nature of your edits, all kinds of undesirable things might be happening with the firmware.
Also, as James mentioned earlier, the difference in size of resulting binaries is of minor importance.

For others planning to modify the code while using cygwin, here is the link where i got my ported gcc compiler for the hcs12 cpu: (download the one for windows and put the stuff that's in /usr inside the zip, into the cygwin's /usr)

http://www.gnu.org/software/m68hc11/m68 ... nload.html

It had compiled the original code just fine (no errors) but i have not yet tested it running on the hardware.

Will update with progress.
btw, i plan to play around with the wheel decoder code
Keithg
Super MS/Extra'er
Posts: 2413
Joined: Sun Mar 06, 2005 9:15 am
Location: Chicago, IL, USA
Contact:

Post by Keithg »

All that I know is that, when I started using cygwin, all my problems went away.

KeithG
muythaibxr
Site Admin
Posts: 8230
Joined: Thu Oct 14, 2004 12:48 pm

Post by muythaibxr »

That's what we're using, so that makes sense.

Ken
mops
Master MS/Extra'er
Posts: 705
Joined: Sun Sep 25, 2005 5:13 pm
Location: Auckland, NZ
Contact:

Post by mops »

is it still possible to compile in codewarrior ? which version/addons do i need ?

I like my proper development UI with code highlighting, bracket tracking, line numbers, and definitely advanced debuggers and stuff. I just want to play around and 'get my feet wet' with ms2 programming....
BMW, 1985, E30, 325i, 2-door, 5spd. Lots of custom work. Turbo build in progress: http://www.e30tech.com/forum/showthread.php?t=55733
6040solder
Experienced MS/Extra'er
Posts: 307
Joined: Mon Oct 22, 2007 7:15 am
Location: Auckland, New Zealand

Post by 6040solder »

not as it stands because of the way inline asm is handled and possibly other things too.
I like my proper development UI with code highlighting, bracket tracking, line numbers, and definitely advanced debuggers and stuff.
try eclipse or similar, it supports gcc development.

EDIT: Here's a good read on dev tools, of a different kind:

http://tools.diyefi.org
http://forum.diyefi.org/viewtopic.php?f=41&t=547
http://forum.diyefi.org/viewtopic.php?f=41&t=1103
http://forum.diyefi.org/viewtopic.php?f=41&t=1683
http://forum.diyefi.org/viewtopic.php?f=41&t=1689
http://forum.diyefi.org/viewtopic.php?f=54&t=1381
Last edited by 6040solder on Sun Jul 29, 2012 7:48 pm, edited 2 times in total.
muythaibxr
Site Admin
Posts: 8230
Joined: Thu Oct 14, 2004 12:48 pm

Post by muythaibxr »

As 0640solder says, we don't support codewarrior, and have not since we went over the 32k limit that the free CW supports; that means pretty much since about 2 weeks after James and I started working on ms2/extra.

Ken
Xtatic
Helpful MS/Extra'er
Posts: 108
Joined: Thu Oct 12, 2006 1:21 pm

Post by Xtatic »

mops wrote:I like my proper development UI ....
vim/gvim, ctags, gdb, grep, and other command line tools can go a looong way. The trick is to get used to it.

i also used to be a "visual developer" and prefered clicking around.
jsmcortina
Site Admin
Posts: 39615
Joined: Mon May 03, 2004 1:34 am
Location: Birmingham, UK
Contact:

Post by jsmcortina »

We found and fixed a bug in the DOS Makefile that was breaking code compiled under DOS. The Makefile.DOS in the latest 20071104 beta should be working correctly.

James
I can repair or upgrade Megasquirts in UK. http://www.jamesmurrayengineering.co.uk

My Success story: http://www.msextra.com/forums/viewtopic ... 04&t=34277
MSEXTRA documentation at: http://www.msextra.com/doc/index.html
New users, please read the "Forum Help Page".
Post Reply