RomRaider Logo

RomRaider

Open Source ECU Tools
 FAQ •  Register •  Login 

RomRaider

Documentation

Community

Developers

It is currently Sat Feb 21, 2026 5:40 pm

All times are UTC





Post new topic Reply to topic  [ 28 posts ]  Go to page Previous  1, 2
Author Message
 Post subject: Re: The Unofficial MerpMod Patching Guide
PostPosted: Fri Jan 29, 2021 4:30 am 
Offline
Newbie
User avatar

Joined: Tue Jan 24, 2017 1:28 am
Posts: 88
Location: Coffs, AUS
I was going to build a patch for A8DH202X to make sure it all works, but apologies, it doesn't look like the tables have been defined for this patch. Only what Aijii has listed on his thread.
I spent last night going through and pulling them out for you. You'll want to go through each of the new ones to make sure they're correct.

Hillbilly wrote:
1. You say point sharptune to the Romraider defs, do you mean specifically Subarudefs>Romraider or do you mean just Subaru defs?


Sorry, yes the directory that holds both RomRaider and ECUFlash folders. So point to the parent directory "SubaruDefs". I'll clarify that in the instructions.

Hillbilly wrote:
1a. I seem to have a sharptune issue where no matter what I do, it's pulling the embedded defs from the .sharptune setting directory and not from my imtryingtobrickmyecu directory, thoughts here?


It should still use the directory specified even though the console doesn't say that it is

Hillbilly wrote:
2. My folder structure to get everything working looks a bit different than yours, my first build attempt in HEW created a bunch of errors from files missing so I placed things where it looked like debugger said they were missing from. Did you have to do the same?
Code:
-imtryingtobrickmyecu
  -Merpmod
      -Testrom
         -added patched.bin [I used an unmodified A8DH202X.bin and renamed it patched.bin]
  -Subarudefs
  -SubaruRoms
      -OEM
         -A8DH202X.bin
  -Sharptune.exe
  -merpmod.hws
 


Even if it can see the file and remove the error, I'm not sure how that would work as sharptune would want to remove the patch from "patched.bin" during the test rom phase, but being a renamed unmodified ROM there's no patch to remove.

I'm going through the process again and updating as I get it all working again. But here are the headers for your ROM in the meantime (AijMod headers)


Attachments:
File comment: AijMod Headers for A8DH202X
A8DH202X_h.txt [6.39 KiB]
Downloaded 173 times


Last edited by Puddles on Fri Jan 29, 2021 6:48 am, edited 1 time in total.
Top
 Profile  
 
 Post subject: Re: The Unofficial MerpMod Patching Guide
PostPosted: Fri Jan 29, 2021 6:46 am 
Offline
Newbie
User avatar

Joined: Tue Jan 24, 2017 1:28 am
Posts: 88
Location: Coffs, AUS
Ok, so for AijMod I was getting a build error that MOD_IDENTIFIER was undefined causing Identifier.c and Metadata.c not to compile.

There is a line in EcuHacks that needs to be un-commented (I've compared this to every other version of MerpMod and this line doesn't seem to be commented anywhere else). Even if it's not being used, it fixes the error in the meantime.

Code:
//#define MOD_IDENTIFIER CONCAT_THREE(   CONCAT(  STRI(ECU_CALIBRATION_ID)  ,  STRI(.MeRpMoD.)  )   ,   CONCAT( MOD_CONFIG_ID , STRI(.v) )   ,   STRI(MOD_DATE)    )


I'm not entirely sure of the reasoning, I haven't bothered looking through all the changes. Potentially the Modded ID is being set elsewhere in this version (Potentially the reason behind the MOD_IDENTIFIER string in the headers for previously completed ROMs), or it could just be another way to make sure you check everything before building.
Someone with a bit more involvement could potentially provide some more insight.

However, I have successfully built an AijMod version of A8DH202X using the headers I provided earlier and tables are showing correctly in EcuFlash using the generated definitions.


Top
 Profile  
 
 Post subject: Re: The Unofficial MerpMod Patching Guide
PostPosted: Fri Jan 29, 2021 8:52 pm 
Offline
Newbie

Joined: Wed Jan 06, 2016 3:27 am
Posts: 64
Puddles wrote:
Ok, so for AijMod I was getting a build error that MOD_IDENTIFIER was undefined causing Identifier.c and Metadata.c not to compile.

There is a line in EcuHacks that needs to be un-commented (I've compared this to every other version of MerpMod and this line doesn't seem to be commented anywhere else). Even if it's not being used, it fixes the error in the meantime.

Code:
//#define MOD_IDENTIFIER CONCAT_THREE(   CONCAT(  STRI(ECU_CALIBRATION_ID)  ,  STRI(.MeRpMoD.)  )   ,   CONCAT( MOD_CONFIG_ID , STRI(.v) )   ,   STRI(MOD_DATE)    )


I'm not entirely sure of the reasoning, I haven't bothered looking through all the changes. Potentially the Modded ID is being set elsewhere in this version (Potentially the reason behind the MOD_IDENTIFIER string in the headers for previously completed ROMs), or it could just be another way to make sure you check everything before building.
Someone with a bit more involvement could potentially provide some more insight.

However, I have successfully built an AijMod version of A8DH202X using the headers I provided earlier and tables are showing correctly in EcuFlash using the generated definitions.


It's due to a different/older version of SharpTune being used in aijmod 1.4 repository (where the MOD_IDENTIFIER string was being generated by SharpTune, so it needed to be commented out in the HEW build process).

FYI... aijii and I are currently working on getting dynamic RAM tuning and ej_rey's CANbus hacks implemented... In doing so, we plan on drastically cleaning up the repository, and possibly leaving tested working patches available online (so people don't need to get the whole dev environment and build).... no guarantees on when it's ready, but we're making pretty steady progress, albeit a bit slow trying to fit it in between regular daily life... I've already completely re-organized the repository to make it a simple "clone, open, and build" with no other intervention required for an already defined patch.

We'll need testers for live-tuning in a bit once I've gotten a non-developer front-end in a usable state. At the moment, the latest changes are already set up for my (A2UI001L) and aijii's (AZ1G202G I believe?) ECUs. I'll need to port to other CALIDs when we get to needing testers. As such, I'll need to port our latest build to whatever ECUIDs the testers are using... if you're interested in testing live tuning eventually, post up the CALIDs for your ECUs in the live-tuning thread so I can start porting the latest aijmod: viewtopic.php?f=37&t=14144


Top
 Profile  
 
 Post subject: Re: The Unofficial MerpMod Patching Guide
PostPosted: Fri Jan 29, 2021 10:07 pm 
Offline
Newbie
User avatar

Joined: Tue Jan 24, 2017 1:28 am
Posts: 88
Location: Coffs, AUS
solidxsnake wrote:
It's due to a different/older version of SharpTune being used in aijmod 1.4 repository (where the MOD_IDENTIFIER string was being generated by SharpTune, so it needed to be commented out in the HEW build process).


Is there an alternate version of sharptune that's recommended for AijMod then? I'm using the latest build from Merps repo.
I like using Aijii's version as it has the features I like but also being Australian, I like to support local development.

solidxsnake wrote:
FYI... aijii and I are currently working on getting dynamic RAM tuning and ej_rey's CANbus hacks implemented... In doing so, we plan on drastically cleaning up the repository, and possibly leaving tested working patches available online (so people don't need to get the whole dev environment and build).... no guarantees on when it's ready, but we're making pretty steady progress, albeit a bit slow trying to fit it in between regular daily life... I've already completely re-organized the repository to make it a simple "clone, open, and build" with no other intervention required for an already defined patch.

We'll need testers for live-tuning in a bit once I've gotten a non-developer front-end in a usable state. At the moment, the latest changes are already set up for my (A2UI001L) and aijii's (AZ1G202G I believe?) ECUs. I'll need to port to other CALIDs when we get to needing testers. As such, I'll need to port our latest build to whatever ECUIDs the testers are using... if you're interested in testing live tuning eventually, post up the CALIDs for your ECUs in the live-tuning thread so I can start porting the latest aijmod: viewtopic.php?f=37&t=14144


This sounds great, I'll be interested in seeing it's progress and potentially being a part of it if needed.


Top
 Profile  
 
 Post subject: Re: The Unofficial MerpMod Patching Guide
PostPosted: Fri Jan 29, 2021 10:17 pm 
Offline
Newbie

Joined: Wed Jan 06, 2016 3:27 am
Posts: 64
Puddles wrote:
Is there an alternate version of sharptune that's recommended for AijMod then? I'm using the latest build from Merps repo.
I like using Aijii's version as it has the features I like but also being Australian, I like to support local development.


Not really. I modified and built SharpTune from source. In particular, I removed all of the pop-up "please donate" dialogs and got rid of a lot of the warning/error messages and built-in definition/patches to make HEW builds much faster. I did the same thing you did and just re-introduced the the MOD_IDENTIFIER macro being done in the code... easier than re-building SharpTune and is consistent with MerpMod that way.


Top
 Profile  
 
 Post subject: Re: The Unofficial MerpMod Patching Guide
PostPosted: Fri Jan 29, 2021 10:35 pm 
Offline
Newbie
User avatar

Joined: Tue Jan 24, 2017 1:28 am
Posts: 88
Location: Coffs, AUS
solidxsnake wrote:
Not really. I modified and built SharpTune from source... removed all of the pop-up "please donate" dialogs... I did the same thing you did and just re-introduced the the MOD_IDENTIFIER macro being done in the code... easier than re-building SharpTune and is consistent with MerpMod that way.


Ok cool, I might look into that myself. Thanks for the info!


Top
 Profile  
 
 Post subject: Re: The Unofficial MerpMod Patching Guide
PostPosted: Sat Jan 30, 2021 1:21 am 
Offline
Newbie
User avatar

Joined: Tue Jan 26, 2021 2:05 am
Posts: 9
Puddles wrote:
Ok, so for AijMod I was getting a build error that MOD_IDENTIFIER was undefined causing Identifier.c and Metadata.c not to compile.

There is a line in EcuHacks that needs to be un-commented

Code:
//#define MOD_IDENTIFIER CONCAT_THREE(   CONCAT(  STRI(ECU_CALIBRATION_ID)  ,  STRI(.MeRpMoD.)  )   ,   CONCAT( MOD_CONFIG_ID , STRI(.v) )   ,   STRI(MOD_DATE)    )



Thanks a ton! This, plus your .h file plus a couple other tweaks did the trick, and I can open the rom in Ecuflash with everything seemingly correct. I understand now why individuals are not posting patches/patched roms all willy nilly, they can be risky and I'd feel terrible if someone used my half-assed non-verified experiment and had issues.

For anyone following along (or my future self if I get confused) I was able to build the Aijmod 1.4 version of Merpmod switch patch and patch my A8dh202X rom by... following Puddles instructions (gasp) and also:
- Creating/finding the .map file for my CAL id. Mine was in the regular merpmod repo on git, Aijmod doesn't include .map files.
- Pointing romraider and ecuflash to the Aijmod defs BEFORE trying to build. I don't know if it matters (if it does it is not clear) but I was under the assumption pointing EcuFlash and RR to the Aijmod defs was only necessary when trying to open or log a patched rom. It could be that the def creation process relies on ecuflash and RR being pointed to the correct "mod" defs.

I'm editing my prior post to prevent confusion, my folder structure mirrors the instructions below

From the Aijmod 1.4 thread https://www.romraider.com/forum/viewtopic.php?f=37&t=13460:
Quote:
Multiple steps are needed, but when you get it right, you should be able to build all in HEW, it will compile all the code, baseline and apply the patch to the base ROM and validate it and then use sharptune to generate definitions in romraider (logger and ecu editor) and ECUflash.

The folder structure is important. You need a folder containing:

The Merpmod folder, as cloned from git
The subarudefs-Merpmod_dev folder, as cloned from git
A SubaruRoms folder, within this make a subfolder called OEM, and then in there goes all the stock ROMs you're trying to patch. Name the stock roms AZ1G202G.bin, for example (or whatever your CAL ID is).

You need Sharptune in the Merpmod folder, and you need to run sharptune and tell it where your definitions repo is (the subarudefs folder).


Thanks again for the info Puddles and helping guys like me along. A staggering amount of time/work has been done on this development, really cool to see guys working towards live tuning now - that'll be aWeSoMe!

_________________
06 WRX Wagon
Was Merpmod SD/Flash Patch, thanks to this forum I'm now on Aijmod 1.4 switch/flex!
stock loc. GT3076R, TMIC, 3"tbe, GSC S2, ID1050x, 255Wally, Forged 2.5, Sti trans/dff


Top
 Profile  
 
 Post subject: Re: The Unofficial MerpMod Patching Guide
PostPosted: Sat Jan 30, 2021 1:38 am 
Offline
Newbie
User avatar

Joined: Tue Jan 26, 2021 2:05 am
Posts: 9
solidxsnake wrote:
In doing so, we plan on drastically cleaning up the repository, and possibly leaving tested working patches available online (so people don't need to get the whole dev environment and build).... no guarantees on when it's ready, but we're making pretty steady progress, albeit a bit slow trying to fit it in between regular daily life... I've already completely re-organized the repository to make it a simple "clone, open, and build" with no other intervention required for an already defined patch.


I think leaving tested-good patches available is a fantastic way to get more people involved/interested in the dev - sure you'll have the standard "spoon feed me" guy, but I'd bet there's a few more guys who don't know this exists that'd enjoy contributing. Gotta get yer feet wet somehow, and those bits of success getting it all to "work" is really rewarding.

_________________
06 WRX Wagon
Was Merpmod SD/Flash Patch, thanks to this forum I'm now on Aijmod 1.4 switch/flex!
stock loc. GT3076R, TMIC, 3"tbe, GSC S2, ID1050x, 255Wally, Forged 2.5, Sti trans/dff


Top
 Profile  
 
 Post subject: Re: The Unofficial MerpMod Patching Guide
PostPosted: Sat Jan 30, 2021 2:28 am 
Offline
Newbie
User avatar

Joined: Tue Jan 24, 2017 1:28 am
Posts: 88
Location: Coffs, AUS
Hillbilly wrote:
- Creating/finding the .map file for my CAL id. Mine was in the regular merpmod repo on git, Aijmod doesn't include .map files.


I don't think you necessarily need the map file if you've defined each param manually in the header already.
It will say it can't find the map file if you don't use one, but so long as you already have everything in the header then it should be fine to not have it.
I think a map is useful if you have already previously defined things in IDA and don't want to enter them all manually in HEW, but also doesn't necessarily mean all headers are accounted for if using a map file from another project.

Hillbilly wrote:
Pointing romraider and ecuflash to the Aijmod defs BEFORE trying to build. I don't know if it matters


Ah, yeah sorry. This is true - My instructions were typed out originally with a working directory already established so there are obviously a few things that need to be set first for anyone setting up out of the box... I'll update the steps!

Hillbilly wrote:
Thanks again for the info Puddles and helping guys like me along. A staggering amount of time/work has been done on this development, really cool to see guys working towards live tuning now - that'll be aWeSoMe!

No worries at all, I just do this stuff in my free time and have juuuust enough understanding to help others out where I can.
I used to be the same, knowing enough to download a repository, install everything but not finding enough (or clear enough) information about how to get it moving along.


Top
 Profile  
 
 Post subject: Re: The Unofficial MerpMod Patching Guide
PostPosted: Sun Jan 31, 2021 3:39 pm 
Offline
Newbie

Joined: Wed Jan 06, 2016 3:27 am
Posts: 64
Puddles wrote:
Hillbilly wrote:
- Creating/finding the .map file for my CAL id. Mine was in the regular merpmod repo on git, Aijmod doesn't include .map files.


I don't think you necessarily need the map file if you've defined each param manually in the header already.
It will say it can't find the map file if you don't use one, but so long as you already have everything in the header then it should be fine to not have it.
I think a map is useful if you have already previously defined things in IDA and don't want to enter them all manually in HEW, but also doesn't necessarily mean all headers are accounted for if using a map file from another project.

Hillbilly wrote:
Pointing romraider and ecuflash to the Aijmod defs BEFORE trying to build. I don't know if it matters


Ah, yeah sorry. This is true - My instructions were typed out originally with a working directory already established so there are obviously a few things that need to be set first for anyone setting up out of the box... I'll update the steps!

Hillbilly wrote:
Thanks again for the info Puddles and helping guys like me along. A staggering amount of time/work has been done on this development, really cool to see guys working towards live tuning now - that'll be aWeSoMe!

No worries at all, I just do this stuff in my free time and have juuuust enough understanding to help others out where I can.
I used to be the same, knowing enough to download a repository, install everything but not finding enough (or clear enough) information about how to get it moving along.


Yes, the .map file is only useful if you need to get working on a ROM that you don't already have a disassembly for. It's completely unused in the build process. As you said, all that needs to be made is the header file with the addresses defined for all of the identifiers needed for the patches selected in the main configuration header ("Switch.h", "Gratis.h" etc.)


Top
 Profile  
 
 Post subject: Re: The Unofficial MerpMod Patching Guide
PostPosted: Wed Feb 03, 2021 7:26 pm 
Offline
Newbie
User avatar

Joined: Tue Jan 26, 2021 2:05 am
Posts: 9
Just wanted to post back and say thanks again, got the switch/flex patch up and running on my A8dh202x. Little nervous flashing it initially but all went smooth and everything appears to be working which is awesome. The coolest part is programming mode, to test I used some different params for the map switching and blending (I've got my ethanol content sensor piped in through the rear 02) and just WOW the added functionality is so cool 8)

_________________
06 WRX Wagon
Was Merpmod SD/Flash Patch, thanks to this forum I'm now on Aijmod 1.4 switch/flex!
stock loc. GT3076R, TMIC, 3"tbe, GSC S2, ID1050x, 255Wally, Forged 2.5, Sti trans/dff


Top
 Profile  
 
 Post subject: Re: The Unofficial MerpMod Patching Guide
PostPosted: Thu Jul 29, 2021 11:11 pm 
Offline
Newbie

Joined: Fri Oct 02, 2020 12:00 am
Posts: 40
Good Afternoon!

First, thank you for all the hard work. I'm attempting to build a patch for AE5L500V from a 2013 STi. I used AE5K700V as a baseline to find all the addresses in IDA. I believe I found all the addresses except I don't know what to put for all the #DEFINE that have something similar to FFFF79A0 (which is i assume is in the RAM?) and the Ram and Rom holes. Just playing around i tried building a patch with the values from AE5K700V for all of those defines that have something similar to FFFF as an address, and I get errors, which i'm assuming have to do with these values. I'm attaching my .h file and the errors below. Any assistance is greatly appreciated. I'm trying to build a Gratis Testing. Thank you!

EDIT: I messed up and it didn't save some of the changes, which was the reason for it not working. All good now!


Top
 Profile  
 
 Post subject: Re: The Unofficial MerpMod Patching Guide
PostPosted: Mon Dec 12, 2022 8:56 am 
Offline
Newbie

Joined: Fri May 13, 2022 1:40 am
Posts: 3
hi, im getting two warnings.
C:\Users\rabid\Desktop\32 bit retry\MerpMod\MerpMod\PullRamHooks.c(17) : 123: warning: initialization from incompatible pointer type [enabled by default]
C:\Users\rabid\Desktop\32 bit retry\MerpMod\MerpMod\PullRamHooks.c(18) : 106: warning: initialization from incompatible pointer type [enabled by default]

not sure if thats an issue or not but i dont get a .patch file.
all i get is partial-patch.mot

im kinda stuck right now

this is for my 2008 sti MT

i included the output


Attachments:
File comment: output file
logs.txt [14.47 KiB]
Downloaded 52 times
Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 28 posts ]  Go to page Previous  1, 2

All times are UTC


Who is online

Users browsing this forum: No registered users and 6 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
Style based on FI Subsilver by phpBBservice.nl