Segment Swap utility

They go by many names, P01, P59, VPW, '0411 etc. Also covering E38 and newer here.
User avatar
joukoy
Posts: 392
Joined: Tue Dec 17, 2019 3:27 am
cars: --
Contact:

Re: Segment Swap utility

Post by joukoy »

kur4o wrote:Absolutely brilliant.

Sorry for pushing you so hard.

I fixed some errors in the autoconfig file and added some more rules. Now works every time.
I am still having trouble to load and edit the file. When it is loaded, nothing can be seen or edited. Is it the way it should be or am I missing something.
I manually edited it, which works fine so far.

Here is the good file. You can include it with the exe.
The attachment autodetect.rar is no longer available
More updates to follow with some better and complete config files and rules.

ps

Is it possible to add some rules to identify where the eeprom data is stored. It will be really helpful for the extra info field, like vin, serial and srvice numbers.
This is how it SHOULD work:
Click "Setup autodetect", then select XML-file from dropdown (see attachment) and edit rules for selected XML-file.
If not, please inform where is the problem (is dropdown empty?) so I can fix it.

You can have multiple extra-info fields. For example you know VIN is in address 1500 or 2500, you can add:
VIN1:1500:17:text,VIN2:2500:17:text
Of course it will print both, but probably you can see which one is correct.

Maybe segment should have optional search functionality?
For example:
Checkword: a5a0
Checkword locations:4088,6088
Extra info: PN:CW-84:4:int, Serial:CW-80:12:text,VIN:CW-67:17:text

Is this enough for Eeprom data?

Edit: +,- instead of <,>
Attachments
Autodetect.jpg
Autodetect.jpg (21.28 KiB) Viewed 3834 times
User avatar
joukoy
Posts: 392
Joined: Tue Dec 17, 2019 3:27 am
cars: --
Contact:

Re: Segment Swap utility

Post by joukoy »

joukoy wrote: Maybe segment should have optional search functionality?
For example:
Checkword: a5a0
Checkword locations:4088,6088
Extra info: PN:CW-84:4:int, Serial:CW-80:12:text,VIN:CW-67:17:text

Is this enough for Eeprom data?

Edit: +,- instead of <,>
Implemented in 0.8.6
kur4o
Posts: 950
Joined: Sun Apr 10, 2016 9:20 pm

Re: Segment Swap utility

Post by kur4o »

That will work awesome, but only for eeprom data with single eeporm data version across bins range. I even tested it and worked great.

We are in big trouble if the bins have 2 different types of eepprom data like the early and late OS ls1 pcm.
And it gets much worse on e38 and later pcm where there are multiple versions of eeprom data and multiple checksum word locations.
I am still thinking how one config can take all the different cases.


A remedy might be to use different strategy to specify the start address of the eeprom segments.
Defining the start address, 4000,6000 or c000,e000 or ....
Then checking some locations for FFFFs and set the start address[4000 or 6000] where there isn`t FFFFs.

Now when we know the start address can use the check word to specify some data.
For example we specify checkword a5a0.
Vin:CW@88:+a:17:text[ if checkword matches location 88 from start of segment; take vin at #a from start of segment][If checkword doesn`t match at 88 skip the field]
Than we can specify different settings for vin Vin:CW@88:+a:17:text,Vin:CW@3e0:+46:17:text,Vin:CW@db0:+68:17:text
Adding some exceptions like CHskip, will skip the checkword check and load the field from start of segment + the offset specified
Vin:CWskip:+a:17:text
User avatar
joukoy
Posts: 392
Joined: Tue Dec 17, 2019 3:27 am
cars: --
Contact:

Re: Segment Swap utility

Post by joukoy »

kur4o wrote:That will work awesome, but only for eeprom data with single eeporm data version across bins range. I even tested it and worked great.

We are in big trouble if the bins have 2 different types of eepprom data like the early and late OS ls1 pcm.
And it gets much worse on e38 and later pcm where there are multiple versions of eeprom data and multiple checksum word locations.
I am still thinking how one config can take all the different cases.


A remedy might be to use different strategy to specify the start address of the eeprom segments.
Defining the start address, 4000,6000 or c000,e000 or ....
Then checking some locations for FFFFs and set the start address[4000 or 6000] where there isn`t FFFFs.

Now when we know the start address can use the check word to specify some data.
For example we specify checkword a5a0.
Vin:CW@88:+a:17:text[ if checkword matches location 88 from start of segment; take vin at #a from start of segment][If checkword doesn`t match at 88 skip the field]
Than we can specify different settings for vin Vin:CW@88:+a:17:text,Vin:CW@3e0:+46:17:text,Vin:CW@db0:+68:17:text
Adding some exceptions like CHskip, will skip the checkword check and load the field from start of segment + the offset specified
Vin:CWskip:+a:17:text
Workaround with current version:
Detect different eeprom versions as different bins and create xml files for each of them.
xml files can be copies, just eeprom segment differs.
kur4o
Posts: 950
Joined: Sun Apr 10, 2016 9:20 pm

Re: Segment Swap utility

Post by kur4o »

That`s another way to do it.

I managed to look at the autodetect file. I was loading it first as an xml. Stupid.
Now the drop down menu is shown and looks pretty good.

I forget to report a bug with the 0.8.6 version. If the checkword is not at either location[a bad eeprom area] I got an error: non-negative number required.
User avatar
joukoy
Posts: 392
Joined: Tue Dec 17, 2019 3:27 am
cars: --
Contact:

Re: Segment Swap utility

Post by joukoy »

0.8.7

Segment search functionality:
Enter possible segment locations, for example: 4000-6000,6000-8000
Then checkword, for example: FFFFFFFFFFFFFFF (can be 1,2,4, or 8 bytes)
And select if it need to be/not to be in segment
And location (starting from segment start) where checkword need to be (or is not allowed)

Checkword functionality expanded:
You can supply several checkwords + locations AND data location IF checkword is found.

For example:
A5A0:88:0,A5A0:56:0
Search for "A5A0" from #88 and #56. If found => "CW" points to segment start + 0
Works with PN, VER, Number and extra.
Works with searched segment


See attachment
Attachments
P01-P59.xml
(5.6 KiB) Downloaded 194 times
kur4o
Posts: 950
Joined: Sun Apr 10, 2016 9:20 pm

Re: Segment Swap utility

Post by kur4o »

Another great update.

Somehow I got lost with the config or the things I am trying to do are not right.

I will give you some examples of the e38 eeprom data.

Code: Select all

FF FF FF FF FF 50 FF 
48 57 30 [eeprom version +7]
F0 FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF 20 20 FF FF 00 C0 47 73 20 20 FF FF 
00 C0 87 60 [pcm p/n +28]
38 36 59 50 4D 54 4B 31 38 30 31 37 58 50 36 47 [trace code +2c]
A5 A5
00 FF D9 40 00 FF 
41 42 41 45 41 45 41 47 41 45 [cal version numbers +44]
FF FF 00 C0 A4 DD 00 C0 60 09 00 C0 60 0F 00 C0 60 06 00 C0 60 02 00 C0 87 61 41 42 FF FF FF FF FF FF FF 00 00 FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF 20 19 07 20 FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF 32 30 39 32 35 31 32 34 31 00 FF FF 42 4C 35 37 35 30 30 31 
32 43 4E 44 4C 32 33 46 33 38 36 32 38 34 33 33 38 [vin at +b8]
01 FF FF FF FF 00 FF 00 51 FF FF 00 C0 87 61 FF FF FF FF FF FF FF FF FF FF FF FF 00 C0 A4 DD 00 C0 60 09 00 C0 60 0F 00 C0 60 06 00 C0 60 02 FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF 24 45 94 81 A6 12 C5 9E 38 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 FF FF FF DA A5 FF FF FF FF FF FF 21 2B CB 9B 32 70 FE F7 0A 56 D9 5D F7 38 D6 A3 FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF 61 7F FF FF E1 C3 FF FF 47 83 FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF E6 37 FF FF 
A5 A0 [checkword +1be]

Code: Select all

FF FF FF FF FF FF FF 
48 57 31 [eeprom version +7]
F0 FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF 20 20 FF FF 00 C0 47 73 20 20 FF FF 
00 C0 B4 11 [pcm p/n +28]
38 36 59 52 54 5A 4B 31 38 32 31 33 4C 45 32 59 [trace code +2c]
A5 A5 00 00 
41 42 41 42 41 42 41 42 41 42  [cal version numbers +44]
FF FF 05 7F 68 A0 05 7F 68 A2 05 7F 68 9D 05 7F 68 A6 05 7F 68 AE 00 C0 B3 FE 41 41 FF FF FF FF FF FF FF 00 00 FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF 20 08 08 13 FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF 50 43 4F 31 53 54 4E 23 36 34 FF FF 39 31 31 
32 34 32 39 31 32 47 31 57 54 35 37 4B 38 39 31 31 [vin at +b4]
32 34 32 39 31 01 00 00 00 00 00 FF 00 51 FF FF 00 C0 B3 FE 00 C0 B3 F6 FF FF FF FF FF FF FF FF 05 7F 68 A0 05 7F 68 A2 05 7F 68 9D 05 7F 68 A6 05 7F 68 AE 00 C0 B1 51 00 C0 B1 50 00 C0 B1 54 00 C0 B1 4B 00 C0 B1 43 FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF AB B1 F4 2D FB B0 44 B8 9C 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 FF FF FF BB 28 FF FF FF FF FF FF 4D BC 2D BD 9E 1E 6F 0E 15 BB 28 2A F2 99 BA D0 FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF 
75 A3 FF FF EF A9 FF FF 33 5F FF FF FF FF FF FF 
32 47 31 57 54 35 37 4B 38 39 31 31 32 34 32 39 31 [vin at +1b0]
FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF E2 9A FF FF 
A5 A0 [checkword +1da]
As you can see the vin and version move to different locations with the checkword locations. I am not sure if this can be configured, unless we specify a checkwords[cw1:a5a0,cw2:a5a5], and each extra field data chunk to check for match for checkword location
vin:cw1@1da:#b4:17:text,vin:cw1@1be:#b8:17:text and so on.

It will be nice to add more check fields for the search for function.


If it gets too complicated it may be good to abandon the eeprom area and focus on the patch side.
User avatar
joukoy
Posts: 392
Joined: Tue Dec 17, 2019 3:27 am
cars: --
Contact:

Re: Segment Swap utility

Post by joukoy »

So, only VIN is moving, other things stay?
In this case I need to implement multiple checkwords (CW1, CW2...)
Maybe tomorrow...
kur4o
Posts: 950
Joined: Sun Apr 10, 2016 9:20 pm

Re: Segment Swap utility

Post by kur4o »

As far as I found only trace code and pcm p/n stays, all other data moves.

I think I found some new checkword implemented that seems constant in all bins a5a5 at +3c. I may use it for eeprom data segment identification.

I also found some bins that have valid data in both eeprom segments. :wall:
User avatar
joukoy
Posts: 392
Joined: Tue Dec 17, 2019 3:27 am
cars: --
Contact:

Re: Segment Swap utility

Post by joukoy »

0.8.8

Now you can create multiple checkwords and name them as you want - but they will always begin "CW"
Extrainfo-editor improved
Small fixes.
Post Reply