Page 1 of 4

Subaru ROM patching for logging

PostPosted: Wed Nov 04, 2009 12:52 pm
by cboles
I'm starting another thread here for some work I am doing on creating patches for Subaru ROMs to improve logging speed and adding functionality. I already have some of the patches finished, but I am adding new patching functionality to EcuFlash so that people will be able to patch their ROMs safely without chance of error. Here are some of the patches I am working on:

--complete--
* RAM parameters for CAN ECUs
* multibyte reads from a single request (CAN ECUs)

--in progress--
* multibyte reads from a single request (K-line ECUs)

The completed patches are now part of EcuFlash that you can download here:

http://forums.openecu.org/viewtopic.php?f=57&t=4319

Using patches is pretty simple from a user perspective. If you have a ROM loaded that EcuFlash has supported patches for, you will see a "Patches" category listed in the ROM metadata window with available patches within it. Each patch has a checkbox showing if it is currently active or not. Simply check or uncheck the ones you want and reflash your ECU to get started using them.

Re: Subaru ROM patching for logging

PostPosted: Wed Nov 04, 2009 11:47 pm
by ladams00
Out of curiosity, Colby:

Would a logging/comms speed patch like the ones you're developing collide with other patches out there like TinyWRX's Launch Control + Flat Foot Shifting?

Re: Subaru ROM patching for logging

PostPosted: Thu Nov 05, 2009 10:08 am
by cboles
ladams00 wrote:Out of curiosity, Colby:

Would a logging/comms speed patch like the ones you're developing collide with other patches out there like TinyWRX's Launch Control + Flat Foot Shifting?


Yes - it is a smart patching system, much like a linker for a compiler. It finds safe places to put code and doesn't overwrite any code that is already there. It also is not specific to a particular ROM, i.e. it identifies the relevant code in your ROM before patching it. The intial versions of these patches will be closed, but I hope to come up with a scripting language for patching that uses my patching API so that others can contribute patches as well.

Re: Subaru ROM patching for logging

PostPosted: Sun Nov 08, 2009 11:47 am
by cboles
New beta of EcuFlash is up now at the top of this thread that patches Subaru CAN ROMs for better logging. Stay tuned for more!

Re: Subaru ROM patching for logging

PostPosted: Sun Nov 08, 2009 4:51 pm
by mdedwar
cboles wrote:New beta of EcuFlash is up now at the top of this thread that patches Subaru CAN ROMs for better logging. Stay tuned for more!

Hi Colby,
Is this supposed to work with all Subaru CAN ROMS? I tried it with mine (A8DK100M ecu id 4E52584007) but could not see an extra patch tab.

Cheers,
Matt.

Re: Subaru ROM patching for logging

PostPosted: Sun Nov 08, 2009 7:21 pm
by cboles
mdedwar wrote:
cboles wrote:New beta of EcuFlash is up now at the top of this thread that patches Subaru CAN ROMs for better logging. Stay tuned for more!

Hi Colby,
Is this supposed to work with all Subaru CAN ROMS? I tried it with mine (A8DK100M ecu id 4E52584007) but could not see an extra patch tab.

Cheers,
Matt.


I don't have your particular ROM, I do have A8DK100L though, which should be close, and it doesn't show up as patchable either. Are you actually able to log via CAN with this ROM version?

Re: Subaru ROM patching for logging

PostPosted: Sun Nov 08, 2009 9:29 pm
by mdedwar
cboles wrote:
mdedwar wrote:
cboles wrote:New beta of EcuFlash is up now at the top of this thread that patches Subaru CAN ROMs for better logging. Stay tuned for more!

Hi Colby,
Is this supposed to work with all Subaru CAN ROMS? I tried it with mine (A8DK100M ecu id 4E52584007) but could not see an extra patch tab.

Cheers,
Matt.


I don't have your particular ROM, I do have A8DK100L though, which should be close, and it doesn't show up as patchable either. Are you actually able to log via CAN with this ROM version?


This was the first forester to come out with the canbus in Australia. CAN logging works fine.

Here is a link to the base ROM http://www.romraider.com/forum/download/file.php?id=5659

Re: Subaru ROM patching for logging

PostPosted: Tue Nov 10, 2009 8:04 am
by cboles
I'll take a look at that ROM. There must be something different in the parameter read code...

mdedwar wrote:This was the first forester to come out with the canbus in Australia. CAN logging works fine.

Here is a link to the base ROM http://www.romraider.com/forum/download/file.php?id=5659

Re: Subaru ROM patching for logging

PostPosted: Thu Nov 12, 2009 7:26 am
by Mart
Hi Colby,

I am a bit confused.

so far with this patch, is there or will be any speed gains for READ MEMORY COMMAND with K-LINE?

Such as:

USDM 06 STI
ECUID: 4312594006
ROMID: A2ZJE11J
PARAM: LOAD
Address: FF4F58

thanx

Mart

Re: Subaru ROM patching for logging

PostPosted: Thu Nov 12, 2009 5:01 pm
by Merp
Great!

Please post some details of the patching method, I'm working on some upgrades to launch control patches as well as speed density stuff. It sounds like this integration would make things much easier for the user. Would it be possible to have a separate definition enabled with a patch? eg speed density maps, and compensations?

Re: Subaru ROM patching for logging

PostPosted: Thu Nov 12, 2009 5:46 pm
by cboles
No. It is a patch for CAN. I'm working on other patches for K-line (that will work in the same way).

Mart wrote:Hi Colby,

I am a bit confused.

so far with this patch, is there or will be any speed gains for READ MEMORY COMMAND with K-LINE?

Such as:

USDM 06 STI
ECUID: 4312594006
ROMID: A2ZJE11J
PARAM: LOAD
Address: FF4F58

thanx

Mart

Re: Subaru ROM patching for logging

PostPosted: Thu Nov 12, 2009 5:55 pm
by cboles
No details to post yet - my current patching is coded in C++ inside of EcuFlash. The plan is to host a scripting engine with EcuFlash patching API functions. Basically the script author would have to implement methods that would query the current patch state of a ROM (or if it is patchable at all), and method to do the patching. EcuFlash will help make that easy by providing functions to read binary or text encoded hex patch and mask data, functions to find all instances of masked patterns, functions to replace patterns, functions to find free memory areas to place extra code, etc.

In the case of my CAN patch, this is pretty trivial as the patch is the same size as the original code, and designed to be position independent, so it is just a search-and-replace operation. For more advanced patches with extra code, there is some search-and-replace along with placing new code in free ROM space, and updating function addresses in the inserted code.

Merp wrote:Great!

Please post some details of the patching method, I'm working on some upgrades to launch control patches as well as speed density stuff. It sounds like this integration would make things much easier for the user. Would it be possible to have a separate definition enabled with a patch? eg speed density maps, and compensations?

Re: Subaru ROM patching for logging

PostPosted: Thu Nov 12, 2009 5:59 pm
by cboles
Yes - that sounds like a good idea. The definition XMLs for those might actually be provided by the patching module because where those maps are placed might only be known by the patch itself.

Merp wrote:Would it be possible to have a separate definition enabled with a patch? eg speed density maps, and compensations?

Re: Subaru ROM patching for logging

PostPosted: Thu Nov 12, 2009 6:09 pm
by Merp
Awesome, sounds pretty robust, and should make porting existing patches to different roms much easier. Keep us posted.

Also, its OT, but what is the likelyhood of a linux build of ECUflash in the future?

Re: Subaru ROM patching for logging

PostPosted: Sun Nov 22, 2009 6:51 pm
by Digitalfiend
What sort of speed improvements are we talking about here? Would it be realistic to get 5-6 samples per second with 6-8 parameters?

I assume this patch will obviously not work with any of Cobb's maps, right? I'm using an AccessTUNER Race right now on my '08 STI and use my Tactrix 2.0 cable to log, but if the speed improvements are significant, I might consider porting everything to ECUFlash/RomRaider and going from there. I find the current resolution of 300-450ms for 6-8 parameters a bit too coarse for my liking.