NefMoto

Noob Zone => Noob Questions => Topic started by: MoparFreak69 on March 06, 2017, 07:09:48 PM



Title: Learning ME language
Post by: MoparFreak69 on March 06, 2017, 07:09:48 PM
In the interest brought on by the "mafless" topic, I have decided to attack the situation for myself through 2 different venues. One dealing with some sort of standalone MAP to MAF signal converter (could be hack/fail/waste of time/etc.) the other dealing with learning dissasembly and reassembly of the ME code.

The reason for this thread is to ask for information as to where to begin my quest for learning the coding as it relates specifically to the Bosch Motronic ME lineup as a beginning.

Firstly; what language is used in the Motronic?
Secondly; any suggested resources to begin discovering how the language works and how to properly manipulate it?

What I'm hoping for with this thread is to not only learn myself how to perform the advanced manipulation of the ECU and its coding, but also hopefully a respectful thread where others can offer input and suggestions based on my subsequent attempts.

What I do not want; code thrown at me saying 'just use this'. I don't learn that way and I'm not keen on just taking other's work without knowing what it takes to get to the same end point.

Any of the more experienced and knowledgeable members here want to offer any solid starting grounds?


Title: Re: Learning ME language
Post by: vwaudiguy on March 06, 2017, 08:40:07 PM
I think this is a great idea for a topic. I feel like lots of folks on here are interested in disassembly. It's a steep learning curve for sure. Stumbling around IDA isn't the most efficient way to go about it.


Title: Re: Learning ME language
Post by: nyet on March 06, 2017, 08:48:04 PM
The source code to ME7 is not available.

Likely it is a variant of C mixed with custom ASM library functions optimized for performance.

All you have are the binaries, which are in the native CPU/uC machine language (which isn't even ASM).

Depending on the target, even that varies.

in the case of ME7.1.x, the target cpu is the Infineon B59233-FA (aka SAK-C167CR-4RM) uC which uses the C166/C167 instruction set

https://en.wikipedia.org/wiki/C166_family
https://s4wiki.com/wiki/Bosch_ME7.1

The only real way to disassemble the binary is using IDA pro

http://nefariousmotorsports.com/forum/index.php?topic=2431.0title=

All of this assumes you know the difference between source code, ASM, and machine language.


Title: Re: Learning ME language
Post by: MoparFreak69 on March 06, 2017, 08:57:41 PM
Ok.
Just trying to process.

So at this point, without original source code we have no idea exactly what the language is saying? Any coding changes/modifications have only been successful using a decompiler to 'reverse engineer' the coding and apply any changes that are to be made?

I suppose since versions of the Motronic are still in current production, acquisition of the source code is a pipe dream.

Thank you for the information. At least I have a direction to head towards.



Title: Re: Learning ME language
Post by: nyet on March 06, 2017, 09:01:22 PM
Yes. All of the above, you have it right.


Title: Re: Learning ME language
Post by: TijnCU on March 07, 2017, 07:28:22 AM
When you found your way around IDA, and have a basic understanding about how the ecu works it is possible to learn a lot from a disassembled file combined with the Funktionsrahmen. You learn how to identify routines and variables. When you understand how these are used, you can write your own functions or edit existing functions. I have learned this from scratch in about 2 years time, and still I something mess things up when writing simple code changes (because the changed routine was not as simple as expected for example). In my opinion the only way to learn is to dive in, and if you are set on learning asm you will eventually succeed. But, as vwaudiguy said, it is a steep learning curve that can get you demotivated at times...
But I agree that the only good way to do a speed density file, is to write new code/adapt existing code. If you want to hack it, maybe you can get away with calibrating a load signal from a post throttle map sensor, but it will take a lot of testing for sure!


Title: Re: Learning ME language
Post by: MoparFreak69 on March 07, 2017, 01:05:22 PM
Awesome info! Thanks!
I'm definitely going to dip my feet in the water, so to speak.

Anyone get proficient enough to consider just rewriting everything and starting fresh?


Title: Re: Learning ME language
Post by: nyet on March 07, 2017, 04:03:28 PM
Anyone get proficient enough to consider just rewriting everything and starting fresh?

Unpossible, IMO.

Just the RTOS alone would be impossible to rewrite unless you already have a decade of OS design experience.


Title: Re: Learning ME language
Post by: Khendal on March 07, 2017, 04:15:21 PM
This is an interesting topic.
But first of all, the most important thing is to know how to disassemble ME7.x.
There are a lot of arguments, a lot of automated scripts, but there are limits ... automated scripts that work and do not work, some with faster times that do not finish the job, a bit 'for the old or new version of Ida .. ..
I think we need a basic tutorial, a guide from the point 0 to the last step with the precise way to set the different addresses of memory and the size of .... type of processor, eeprom and flash.
When we have a correct disassembled code we can start to understand and study the code and the language used.


Title: Re: Learning ME language
Post by: nyet on March 07, 2017, 04:23:57 PM
Anyone get proficient enough to consider just rewriting everything and starting fresh?

You mean like a standalone :P

This one is at least open source, but nobody has done anything like motronic yet

http://www.vems.us/



Title: Re: Learning ME language
Post by: MoparFreak69 on March 07, 2017, 05:38:52 PM
I was kinda drifting toward just writing entirely new scripting that will run on the stock ME hardware. Obviously I don't have the knowledge or skills at this time to even fathom that happening but it could be possible?


Title: Re: Learning ME language
Post by: nyet on March 07, 2017, 06:11:31 PM
I was kinda drifting toward just writing entirely new scripting that will run on the stock ME hardware.

I have no idea what you mean by "new scripting"


Title: Re: Learning ME language
Post by: TijnCU on March 08, 2017, 05:39:54 AM
I think we need a basic tutorial, a guide from the point 0 to the last step with the precise way to set the different addresses of memory and the size of .... type of processor, eeprom and flash.
When we have a correct disassembled code we can start to understand and study the code and the language used.
All this information is already on the forum. There is even a topic called "first disassemble - questions (http://nefariousmotorsports.com/forum/index.php?action=;topic=2851.0)"
The question you need to ask yourself is: Can you learn how to drive a car by reading about it on the internet?


Title: Re: Learning ME language
Post by: prj on March 08, 2017, 07:42:25 AM
You mean like a standalone :P

This one is at least open source, but nobody has done anything like motronic yet

http://www.vems.us/

How is it open source???


Title: Re: Learning ME language
Post by: MoparFreak69 on March 08, 2017, 10:02:52 AM
I have no idea what you mean by "new scripting"

Complete rewrite of the code to run on the ecu.


Title: Re: Learning ME language
Post by: TijnCU on March 08, 2017, 11:40:42 AM
Total waste of time, aside from the actual engine calibrations there are countless routines you would have to write to make it functional. There are standalone ecus that will do a much better job (live mapping) and it will cost you many thousands less. Even if you can do this programming yourseldf, time is money.


Title: Re: Learning ME language
Post by: nyet on March 08, 2017, 11:44:47 AM
How is it open source???

Misspost

meant to paste this

http://freeems.org/