Segment Swap utility

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

Segment Swap utility

Post by joukoy »

Segment swap & patch utility for GM P01 & P59 bin-files is relative stable now:
https://github.com/joukoy/PCMBinBuilder
Still experimental software, use at your own risk.

Original Idea from:
http://www.gearhead-efi.com/Fuel-Inject ... ment-Swaps
It does the same, but automatically.


Now developing patching & checksum software, which can be configured for many different bin-files:
https://github.com/joukoy/UniversalPatcher
Under active development, use at your own risk.
Last edited by joukoy on Tue Mar 10, 2020 3:26 pm, edited 6 times in total.
User avatar
joukoy
Posts: 392
Joined: Tue Dec 17, 2019 3:27 am
cars: Pontiac Firebird 1978

Re: Segment Swap utility

Post by joukoy »

Screenshot
Edit: old pic removed, new pic from UniversalPatcher
Attachments
uvpatcher-0105.jpg
uvpatcher-0105.jpg (90.18 KiB) Viewed 31848 times
Last edited by joukoy on Sat Apr 18, 2020 9:31 pm, edited 2 times in total.
kur4o
Posts: 948
Joined: Sun Apr 10, 2016 9:20 pm

Re: Segment Swap utility

Post by kur4o »

Nice work. I am having trouble running it on xp. Any chance it will work on xp.
If you want to make it even better I have some ideas for future improvements.
User avatar
joukoy
Posts: 392
Joined: Tue Dec 17, 2019 3:27 am
cars: Pontiac Firebird 1978

Re: Segment Swap utility

Post by joukoy »

kur4o wrote:Nice work. I am having trouble running it on xp. Any chance it will work on xp.
If you want to make it even better I have some ideas for future improvements.
I uploaded version which should be compatible with XP, if you install .net4. Not tested.
Use google to find instructions for .net4
https://www.microsoft.com/en-US/Downloa ... x?id=17718

All ideas for improvements are velcome, but can't promise implementations. I am not a professional programmer...
kur4o
Posts: 948
Joined: Sun Apr 10, 2016 9:20 pm

Re: Segment Swap utility

Post by kur4o »

Just tested and it worked flawless.

Any segment starts with the following data
example
13 D8 -checksum of segment
00 04 -segment numerical number [01-08]01-OS;02-08 cal data
00 F8 2C 27 - segment p/n in hex [00 F8 2C 27=16264231]
54 52 -Gm version identifier in ASCII [54 52 = TR]

For OS this is saved at $500 address.

I think if that is made visible alot of people will know exactly what p/n are using from the bins. Now it is kinda blind suggestion.

A checksum verification will be awesome. If you are unsure how to calculate them I will give you some details.

$4000-7FFF area is eeprom data that contains vin and some other parameters needed for engine operations like theft data and Crank CASE data.
If that can be switched over or editable will be also very helpful for someone building a bin from scratch.

The ultimate improvement will be to unsplit the bin to segment files, and build a bin from segment files.
When there are enough calibration segments gathered a database can be made with simple description for each segment and sorted based on OS. I have a feeling that some segments can be used for multiple OS, if they match in size.

You can name the segments based on p/n, segment numerical number and segment AScii version for easy identification.
For OS segment merge 0-3FFF area with $20000- till last 2 bytes of bin. Last 2 bytes are always 4A FC, the space between end of segment 8 and $20000 is filled with 4A FC words.

I hope you like some of the ideas and turn it into reality. Great job so far.
User avatar
joukoy
Posts: 392
Joined: Tue Dec 17, 2019 3:27 am
cars: Pontiac Firebird 1978

Re: Segment Swap utility

Post by joukoy »

Let's see if this becomes an usable software...
(Old link removed)

Edit: Checksum calculation not yet implemented.
Only minimal testing done.
Last edited by joukoy on Thu Mar 12, 2020 5:01 pm, edited 1 time in total.
User avatar
joukoy
Posts: 392
Joined: Tue Dec 17, 2019 3:27 am
cars: Pontiac Firebird 1978

Re: Segment Swap utility

Post by joukoy »

Still learning english :oops: . Name changed.

- Added segment checksum calculation
- Fixed several bugs
- Added "shortcut", if segment swap is not needed, only patches

Should I calculate checksum for whole binary, too?
kur4o
Posts: 948
Joined: Sun Apr 10, 2016 9:20 pm

Re: Segment Swap utility

Post by kur4o »

I am having trouble saving the bin. Instead of bin saving dialog I have bin open dialog. Not sure where the problem is.
When I tried to extract calibration I set the description and than nothing seems to happen.
It might be an xp issue though.

The .cal format you use is identical with the tunercat`s .cal files. It might pose a severe confusion.

A simple checksum check is to sum the full cal segment including the checksum word. The result should be zero if the checksum is good.
The sum is word+word+word type of sum.

To calculate the checksum and compare them, a different approach is needed.
You have to sum the segment without the checksum word. Than do a 1`s complement to the sum. [FFFF-sum]+1.

The patch idea is awesome. For some basic stuff it will work much better than manual editing. The vats however is not on the OS segment, but lean cruise is there. Anyway you have to dial the checksums before adding any patches.

You might consider and some form of protection and dependencies between cal segments might. For example engine and engine diagnostics might be dependable. It is still unclear how the segments can interchange but it is good to consider it for future release.

An info button to check bins segments, vin, and so on can be really useful. I will try to gather you some info on the 4000-8000 eeprom area for future improvements.
User avatar
joukoy
Posts: 392
Joined: Tue Dec 17, 2019 3:27 am
cars: Pontiac Firebird 1978

Re: Segment Swap utility

Post by joukoy »

kur4o wrote:I am having trouble saving the bin. Instead of bin saving dialog I have bin open dialog. Not sure where the problem is.
When I tried to extract calibration I set the description and than nothing seems to happen.
It might be an xp issue though.
Fixed in version 1.1
Calibrations are extracted to folder Calibration, I need to add some feedback about success.
kur4o wrote: The .cal format you use is identical with the tunercat`s .cal files. It might pose a severe confusion.
I will change this in next version. Maybe something like .calsegment ?
kur4o wrote: The patch idea is awesome. For some basic stuff it will work much better than manual editing. The vats however is not on the OS segment, but lean cruise is there. Anyway you have to dial the checksums before adding any patches.
Segment checksum added to ver 1.1.
Patches are for calibration, not for OS => Should I use another name for them?
kur4o wrote: An info button to check bins segments, vin, and so on can be really useful
Do you have pointer to information, how to get VIN ?
User avatar
joukoy
Posts: 392
Joined: Tue Dec 17, 2019 3:27 am
cars: Pontiac Firebird 1978

Re: Segment Swap utility

Post by joukoy »

Uploaded new version with updates discussed in last message.

Fileinfo is still quite basic, will add more info later.
Post Reply