Notices
Series I Engine Tuning Forum EMS (Flash Tuning, Interceptor, Piggy Back, Stand Alone)

DIY Tuning Exploration

Thread Tools
 
Search this Thread
 
Rate Thread
 
Old 10-12-2022, 02:16 PM
  #1  
Registered
Thread Starter
 
pls_pressY4pie's Avatar
 
Join Date: Nov 2020
Location: Denver CO
Posts: 31
Received 6 Likes on 4 Posts
DIY Tuning Exploration

I've been working on a little project lately that has lead me down a path of requiring to tweak the RX8 ECU tune. I was pretty upset to find out that there are no options for doing this without giving someone $250. in my particular case, i am planning on swapping to a 6 port from my existing 4 port engine, this means swapping to a new ECU which means i'd be giving mazdaedit no less than $500 to set the idle speed in my tune 250 RPM higher which is absolutely absurd. Anyway, that's how i'm justifying it.

so i read this getting started post from gooflophaze and am picking up where he left off. After a bit of research and a couple days of coding, i've managed to dump out the ROM from one of my ECUs. As i understand, a few people have managed to accomplish this task. I'm not here to put anyone in particular on blast, but i'm a pretty big open source enthusiast, and was pretty upset to find that despite a few people having roms, there wasn't any open source (or even functioning) projects out there that could do this seemingly simple task yet. I took it upon myself to build it. I posted over on RomRaider, you can find an exe there or on my GitHub.

I would love to know if anyone else is interested in this sort of project. I have a wealth of information that i'd love to share and get something together that allows people to DIY their own tunes.
Attached Files
File Type: zip
rx8-ecu-dump-0.1.0.zip (28.0 KB, 23 views)
The following users liked this post:
wcs (10-13-2022)
Old 10-14-2022, 07:04 AM
  #2  
Registered
 
ciprianrx8's Avatar
 
Join Date: Apr 2020
Location: Romania, Europe
Posts: 217
Received 101 Likes on 71 Posts
Having ditched already some good $$$$ into mazdaedit, i'd say it is hardly worth its money but it is a neccesary evil. By the time you map out all the maps in all the calibrations, then gasoline might have already ran out...

If you really want to improve upon existing software, then feel free to search for new maps such as AFR enrichment during cold startup.

Last edited by ciprianrx8; 10-14-2022 at 07:18 AM.
Old 10-15-2022, 05:15 PM
  #3  
Registered
Thread Starter
 
pls_pressY4pie's Avatar
 
Join Date: Nov 2020
Location: Denver CO
Posts: 31
Received 6 Likes on 4 Posts
finding the tables is not something i find particularly interesting or difficult, just a thing that must be done. I combed thru some of my rom dumps and pretty quickly spotted a bunch of tables in there. I haven't spent much time on that at all yet because it's meaningless if you can't upload the rom back to the ECU. Which i've finally managed to accomplish. The code is still in need of much cleanup, but the protocol is pretty easy to understand once you take a peek at it.

After the key exchange, the TLDR of the upload process is as follows:

7E0#04 B1 00 B2 00000000 enter bootloader mode
7E8#03 F1 00 B2 00000000 ack from ECU
7E0#
100934000040000034 request download
7E0#
2107 F8 0000000000 size=0x07f800 (522240)
7E0#1 401 36 <data> transfer data(0x36) framesize=0x401




so the trick here, is that there is some internal checks for the size of the payload, and it does a check when the SBL uploads and fails if the bootloader isn't compatible. I'm still searching for that but i don't think it's an unsurmountable. just need to spend smore time on it
Old 10-15-2022, 05:32 PM
  #4  
wcs
no agenda
iTrader: (2)
 
wcs's Avatar
 
Join Date: Feb 2005
Location: Ontario
Posts: 5,210
Received 65 Likes on 56 Posts
Originally Posted by ciprianrx8
Having ditched already some good $$$$ into mazdaedit, i'd say it is hardly worth its money but it is a neccesary evil. By the time you map out all the maps in all the calibrations, then gasoline might have already ran out...

If you really want to improve upon existing software, then feel free to search for new maps such as AFR enrichment during cold startup.
booo hoooo
The following users liked this post:
pls_pressY4pie (10-15-2022)
Old 10-16-2022, 12:31 PM
  #5  
Registered
Thread Starter
 
pls_pressY4pie's Avatar
 
Join Date: Nov 2020
Location: Denver CO
Posts: 31
Received 6 Likes on 4 Posts
I'm still working on the ability to write a rom back into flash. it works on one of my ECUs, but it seems to be keyed to the calid somehow. i have to go trolling thru the SBL to see what kinda stuff it uses in the original rom and see if i can hack it out. feels easy, just running low on time for now.

in the meantime, i've implemented the ability to dump out the contents of RAM from the device. This is handy for.. .well i don't remember why i wanted this at this point, but it was fun to build anyway. Here's an example dump of RAM. It's got some interesting stuff in there, VIN, CALID etc.
One thing this does allow is for creating a live logger of the ECU. this should be much faster than OBD2 logging. I might play more around with this idea in the future. For now it's back to getting the ROM to upload.
Attached Files
Old 11-16-2022, 05:40 AM
  #6  
Registered
 
ciprianrx8's Avatar
 
Join Date: Apr 2020
Location: Romania, Europe
Posts: 217
Received 101 Likes on 71 Posts
I might toss my $0.02 that will come in useful later on in your project if you ever get to uploading a ROM file.
Here is how (some) data is represented inside the ROM, as I've found them and had to approximate or guess at times:

uint8 to afr (from Open loop fuel tables)
-0,000000220948560*[x]*[x]*[x] + 0,000160007839136*[x]*[x] - 0,055199890084811*[x] + 14,687952883191700

afr to uint8
-0,2936*[x]*[x]*[x] + 12,861*[x]*[x] - 207,36*[x] + 1201,2

uint8 to timing
[x]/2-50

timing to uint8
[x]*2+100

uint8 to timing retard(such as knock tables)
([x]-128)/2

timing retard to uint8
([x]*2)+128

uint 8 to closed loop load limit
[x]*0,3922

closed loop load limit to uint 8
[x]/0,3922

uint8 to tps
[x]/2

tps to uint8
[x]*2

uint16 to afr(cold start correction like)
(([x]-10000)*0,0001)*14,7

afr to uint16
(([x]/14,7)/0,0001)+10000

uint16 to torque(from desired engine torque table)
([x]-32766)/128

torque to uint16
[x]*128+32766

Where [x] is a value of 1, 2 or 4 bytes(8/16/32 bit int/int/float). As far as I know at this point, there are no signed values used.
Table axis are USUALLY floats.... but uint16 at times too ! The order is columns axis, rows axis, then data(collumn -> row).
To determine what representation to use, look for the start of the next table and see how many bytes you need to cover. Though at times this fails as no meaningful data is found at all, just some axis floats.
Tables are of different sizes, numbers and locations depending on calibration variant, market, year and powertrain variant. Thus, every calibration variant requires remapping, from at least 20% to 100%(nothing fits from another calib).

Some of the most interesting maps I found(but didn't validate any does what I guess they do)


Anyone wants to chime in and point out what these might do ?

Last edited by ciprianrx8; 11-16-2022 at 09:16 AM.
Related Topics
Thread
Thread Starter
Forum
Replies
Last Post
Drayux
New Member Forum
7
05-28-2019 01:56 AM
motoxluke
Series I Tech Garage
2
02-27-2012 09:57 PM
Superfan
Series I Tech Garage
120
09-06-2011 12:30 PM
bren5279
Series I Engine Tuning Forum
7
10-06-2010 08:28 AM
alex zhuk
Series I Engine Tuning Forum
67
08-12-2010 12:39 PM



You have already rated this thread Rating: Thread Rating: 0 votes,  average.

Quick Reply: DIY Tuning Exploration



All times are GMT -5. The time now is 03:44 AM.