Thread: map switching
View Single Post
Old Tue, Jan-23-2018, 01:49:20 PM   #132
Obioban's Avatar
Join Date: Jul 2003
Posts: 38,081
In the garage:
Reputation: 54 Obioban has a spectacular aura about
Location: SE PA

United States

Default Re: map switching

Use with extreme caution, as you can screw things up, but, from Paffy:

MSSMapper operation:

MSS54HP ECU has two independent CPUs with 512kb EEPROM each. Almost 256kb on
each CPU is unused. The tune file is 64kb, with 32kb worth of data for each CPU.

The unused space in the EEPROM is split into 32kb blocks on each CPU and the
separate tunes are loaded into those slots. The ECU accesses 99% of KL_ and KF_
maps using a lo okup sub-routines. These subroutines are modified to adjust the
table memory address b ased on the map selected by the driver.

Then there's several processes happening in the background to communicate the
current map information between the CPUs, processing the buttons and notifying
the driver usin g the RPM indicator.

Remapping constants:

Since there's not a single routine to access K_* constants, mapping those
requires a s can of the whole program space and replacing references to the
particular constant fro m EEPROM to a new RAM address instead.

MSSMapper does this using the remaps tables at the bottom of the program
interface. It searches for address on the left and replaces it with address on
the right in the Ful lbinary - that takes care of accessing the constant's
values from RAM insted of EEPROM .

You need to also create a relocation address table in the tune file in order to
activate the switching of values whenever driver initiates a map switch. The
location of rel ocation tables in the tune file are:

For master CPU $8060 and $1200 for slave.

The format is a list of source address (four bytes) + RAM address (four bytes),
ended with 0xffffffff.

The source address is in the actual format used in software and it always copies
a long (32bit), so it needs to be aligned on 4-byte boundary. The RAM I'm using
right now is at the bottom of the stack on each CPU starting at $00ffe530. Each
CPU accesses the EE PROM tune data with base address $00088000.

Example to re-map K_TI_GA:
It's on slave CPU accesed at $00088070. The value in tune file is at address
$0070 (tune file is ordered slave 32kb first, then master 32kb)

Edit your base/main tune file and add following at 0x8060 address (slave
remapping mapping table): 0x00,0x08,0x80,0x70,0x00,0xff,0xe0,0x30

That will tell the ECU software to copy a long(4 bytes) from
$00088070 (adjusted to active map) to $00ffe030 whenever map switch occurs.
In the MSSMapper, under slave remaps, type 0x88070 and 0xffe030
in the first line. That will scan the ECU software and change all
0x88070 references to the RAM location.

Current Cars: 2005 IR/IR M3, 2001 LMB/blk M5,04 M3 wagon, 2017 i3
Past cars: 04 M3, 03 530i, 96 M3, S50B32 e36 M3 CM race car
Jump to top Obioban is offline   Reply With Quote