Is the code for the MS2 portable to the MC9S12XDP512 ??

Discuss MegaSquirt, VEMS and other non-free hardware and software here.
Post Reply
davebmw
LQFP144 - On Top Of The Game
Posts: 331
Joined: Sun Jul 13, 2008 2:58 pm
Location: South Wales, UK

Is the code for the MS2 portable to the MC9S12XDP512 ??

Post by davebmw »

Only reason I ask is because I have learned a fair amount from the MS2 Extra code and would like to use it with Free Ems.

I'm not talking about ripping of any of the B&G code here, just some of the things I have been looking to improve/customize in the MS2 for my own purposes and obviously to benefit the community here.
93'BMW 325is M50B25TU, Rebuilt 06/06, JE10.5:1, polish&port. Scorpion BB, K&N CAI, TEJ21 WBO2, '07 M3 Evo 18" 225F, 255R, EBC Kevlar, Bilstien Sprint, Polyflex. Head rebuild Oct'08, OEM+FSE FPR, MS2v3.0_DJB Custom, Extra 2.0.1
User avatar
Fred
Moderator
Posts: 15431
Joined: Tue Jan 15, 2008 2:31 pm
Location: Home sweet home!
Contact:

Re: Is the code for the MS2 portable to the MC9S12XDP512 ??

Post by Fred »

Technically, yes it is, James and Ken have already ported the entire thing to the XEP100. However, B&G do not permit/want you to run their code on any other processor, so you won't morally be able to use it on FreeEMS, possibly not legally either, but you are here in the UK, so that won't bother you. If you do port it over, please don't post it here. I can't afford the trouble that it could cause and additionally, that code is fairly badly written in terms of readability and maintainability so IMO there isn't much point.

As for making changes and mods to it. If you gut their code out and develop your code separately from it and then paste it in, you can dual license it. IE, you can meet their "you must share back on msefi" requirement, and you can GPL it for use in FreeEMS. Abe is doing that with his PID code as he feels the PID code in MS2E is not correct or effective.

I hope that helps.

Fred.
DIYEFI.org - where Open Source means Open Source, and Free means Freedom
FreeEMS.org - the open source engine management system
FreeEMS dev diary and its comments thread and my turbo truck!
n00bs, do NOT PM or email tech questions! Use the forum!
The ever growing list of FreeEMS success stories!
davebmw
LQFP144 - On Top Of The Game
Posts: 331
Joined: Sun Jul 13, 2008 2:58 pm
Location: South Wales, UK

Re: Is the code for the MS2 portable to the MC9S12XDP512 ??

Post by davebmw »

Fred wrote:Technically, yes it is, James and Ken have already ported the entire thing to the XEP100. However, B&G do not permit/want you to run their code on any other processor, so you won't morally be able to use it on FreeEMS, possibly not legally either, but you are here in the UK, so that won't bother you. If you do port it over, please don't post it here. I can't afford the trouble that it could cause and additionally, that code is fairly badly written in terms of readability and maintainability so IMO there isn't much point.

As for making changes and mods to it. If you gut their code out and develop your code separately from it and then paste it in, you can dual license it. IE, you can meet their "you must share back on msefi" requirement, and you can GPL it for use in FreeEMS. Abe is doing that with his PID code as he feels the PID code in MS2E is not correct or effective.

I hope that helps.

Fred.
Yes it helps confirm what i have been told today, I have had one of the programming guys at work analyzing the source code for about 2 weeks now and he has come up with loads of areas where he thinks it is really messy and has suggested scrapping whole swathes of code because they are seriously untidy. But in its defense he did say it has all the hall marks of an experimental piece of software that has been built on and probably would be tidied up before final release.
I am not looking to do a simple rip off but a full clean modular build tailored to the XDP512, all i wanted to be sure of is that what I have learned about C programming could be ported not the actual content.

Finally I Now have a copy of code warrior for the S12X series and will be ordering the MCU this week hopefully through work so it may well be free!!
93'BMW 325is M50B25TU, Rebuilt 06/06, JE10.5:1, polish&port. Scorpion BB, K&N CAI, TEJ21 WBO2, '07 M3 Evo 18" 225F, 255R, EBC Kevlar, Bilstien Sprint, Polyflex. Head rebuild Oct'08, OEM+FSE FPR, MS2v3.0_DJB Custom, Extra 2.0.1
User avatar
Fred
Moderator
Posts: 15431
Joined: Tue Jan 15, 2008 2:31 pm
Location: Home sweet home!
Contact:

Re: Is the code for the MS2 portable to the MC9S12XDP512 ??

Post by Fred »

davebmw wrote:But in its defense he did say it has all the hall marks of an experimental piece of software that has been built on and probably would be tidied up before final release.
The trouble with that is that you were looking at the final release! MS2 B&G code is stable and has been that way for a good while (year or more). MS2E which you should have been looking at has been at stable release level for around 6 months.
I am not looking to do a simple rip off but a full clean modular build tailored to the XDP512
That's exactly what I'm already doing, at 5000+ lines it's about 1/4 - 1/3 of the way there and being worked on by myself and others daily. Even if you mean "use their algorithms and put it into a clean structure" this will still be considered a rip off by them. If it still uses MegaTune thats a big indicator too. If you are intending an XDP from scratch without influence build, then you are duplicating my already-done efforts ;-) I assure you that it will take you significant time to get it right if you decide to do that.
all i wanted to be sure of is that what I have learned about C programming could be ported not the actual content.
I'm unsure of what you mean. If you learn about C it's applicable to Linux kernels and FreeEMS and everything in between. You don't port a language really. I'm sure this is just a misunderstanding though :-)
Finally I Now have a copy of code warrior for the S12X series
Only MS2 B&G code is compilable with that tool and you wouldn't want to use that code anyway. If you are looking to modify MS2Extra then you CAN'T use code warrior to compile it, ditto my code, nor may I add would you want to. The GCC environment required for both code bases is freely available and in many respects a better choice anyway. By the time we need to use any xgate functionality James will probably have finished his GCC port for that too. In the mean time there are working alternatives available from other sources, though they are not so easily merged with the main core C as would be possible using a single compiler it does ensure that you are very careful with your memory usage etc.

I'm not trying to squash your ideas, I'm just trying to clarify a few things and understand what your intent is. I hope you don't take offence to what I've written here.

Cheers,

Fred.
DIYEFI.org - where Open Source means Open Source, and Free means Freedom
FreeEMS.org - the open source engine management system
FreeEMS dev diary and its comments thread and my turbo truck!
n00bs, do NOT PM or email tech questions! Use the forum!
The ever growing list of FreeEMS success stories!
davebmw
LQFP144 - On Top Of The Game
Posts: 331
Joined: Sun Jul 13, 2008 2:58 pm
Location: South Wales, UK

Re: Is the code for the MS2 portable to the MC9S12XDP512 ??

Post by davebmw »

Fred wrote:
davebmw wrote:If you are intending an XDP from scratch without influence build, then you are duplicating my already-done efforts ;-) I assure you that it will take you significant time to get it right if you decide to do that. Good god no! i wouldn't know where to start, reverse engineering and tweaking is a far cry from what you are doing in a complete framework. I was just saying that building from fresh has to be better than building on or around existing code.
all i wanted to be sure of is that what I have learned about C programming could be ported not the actual content.
I'm unsure of what you mean. If you learn about C it's applicable to Linux kernels and FreeEMS and everything in between. You don't port a language really. I'm sure this is just a misunderstanding though :-) Yep i'm just a newbie at this, i'm much more comfortable with hardware than software. :oops:
Finally I Now have a copy of code warrior for the S12X series
Only MS2 B&G code is compilable with that tool and you wouldn't want to use that code anyway. If you are looking to modify MS2Extra then you CAN'T use code warrior to compile it, ditto my code, nor may I add would you want to. The GCC environment required for both code bases is freely available and in many respects a better choice anyway. By the time we need to use any xgate functionality James will probably have finished his GCC port for that too. In the mean time there are working alternatives available from other sources, though they are not so easily merged with the main core C as would be possible using a single compiler it does ensure that you are very careful with your memory usage etc. Oh nuts! it took ages to download ok scrap that i'll download GCC instead :lol:

I'm not trying to squash your ideas, I'm just trying to clarify a few things and understand what your intent is. I hope you don't take offence to what I've written here. hey i'm thicker skinned than that, I have to learn somehow any comments and help are uber welcome! 8-)
double cheers, Dave
93'BMW 325is M50B25TU, Rebuilt 06/06, JE10.5:1, polish&port. Scorpion BB, K&N CAI, TEJ21 WBO2, '07 M3 Evo 18" 225F, 255R, EBC Kevlar, Bilstien Sprint, Polyflex. Head rebuild Oct'08, OEM+FSE FPR, MS2v3.0_DJB Custom, Extra 2.0.1
User avatar
Fred
Moderator
Posts: 15431
Joined: Tue Jan 15, 2008 2:31 pm
Location: Home sweet home!
Contact:

Re: Is the code for the MS2 portable to the MC9S12XDP512 ??

Post by Fred »

hey i'm thicker skinned than that, I have to learn somehow any comments and help are uber welcome! 8-)
Awesome, because you'll need it around me :-) I can be a bit rough round the edges according to some softer types.

Don't delete the code warrior setup just yet, it has some useful files in it. I downloaded the entire thing too (even though I'm on linux) but ended up deleting it because it is just HUGE and I needed the space. GCC is a tiny setup in comparison, no flash gui, just a good compiler and linker etc. Use your favourite editor to work on the code.

As for "from fresh", probably yes, but not necessarily. If the project has some direction and a design behind it that is consistent and thorough, sure, definitely better, but it could just go the same way really :-) I'm working hard to ensure that is not how it goes.

If you have any questions at all while digging through my code or even the ms code (if you dare) feel free to flick me a PM or email or msn or aim. I'm happy to help get you up and running asap.

Fred.
DIYEFI.org - where Open Source means Open Source, and Free means Freedom
FreeEMS.org - the open source engine management system
FreeEMS dev diary and its comments thread and my turbo truck!
n00bs, do NOT PM or email tech questions! Use the forum!
The ever growing list of FreeEMS success stories!
Post Reply