Advertising:

How to connect: Difference between revisions

From MS4X Wiki
Line 72: Line 72:
*8: After 10 seconds have passed remove the shorting wire from pin 104 (do not leave it connected as that will result in a corrupted read/write)  
*8: After 10 seconds have passed remove the shorting wire from pin 104 (do not leave it connected as that will result in a corrupted read/write)  
*9: Try connecting with the boot mode programming software. If connection failed power down the ECU and redo step 4 to 9.
*9: Try connecting with the boot mode programming software. If connection failed power down the ECU and redo step 4 to 9.
*10: After connection is successful you can read and write to the ECU.
*10: After connection is successful you can read and write to the ECU.
 
During the read/write process JMGarage can sometimes state that it's not responding. If this happens do not panic the program is still working in the background so just wait until it finishes.
 
In the event of something still going wrong during the read/write process like a laptop shutting down then power down the ECU and redo step 4 to 9 and try again.
   
   
'''It is recommended to always start with performing a full read of the ECU so that you have a backup that can be restored if anything goes wrong. Also remember to correct checksums on all binaries you write to the ECU.'''
'''It is recommended to always start with performing a full read of the ECU so that you have a backup that can be restored if anything goes wrong. Also remember to correct checksums on all binaries you write to the ECU.'''

Revision as of 17:51, 18 November 2022

Communication Hardware

To be able to communicate with the ECU most available software requires an INPA K+DCAN capable USB to OBD2 adapter. With many softwares the Logger.S solution can also be used instead of an INPA K+DCAN cable.


INPA K+DCAN Communication Issues

If you are having communication issues with your INPA K+DCAN cable verify that pin 7 and 8 on the OBD side of the cable are shorted together, some cables provide an external switch to connect the two pins. If no switch is present, then pin 7 and 8 needs to be soldered together.

The reason why pins 7 and 8 are not shorted together on some cables is because on the newer e90 platform pin 7 is used for K-Line and pin 8 was reassigned for ethernet communication. On the older platforms pin 7 and 8 are both used for K-Line communication.

OBD Programming

The bootloader in the MS43 ECU has built in programming functions that allows for reprogramming of the ECU through the OBD connector.

The built-in programming functions can do the following:

  • Read all data on the EEPROM except for a small section of the bootloader that contains ECU unique keys. Due to this the 512KB OBD reads should only be written with OBD programming software as writing them with boot mode programming software will permanently delete these keys.
  • Write new data to the program and calibration sections on the EEPROM. The bootloader section cannot be written to as doing so would delete the programming routines from the ECU.

The bootloader utilizes several safety checks to verify that the program and calibration sections have not been corrupted, so if something goes wrong when writing new data to the EEPROM the ECU can be recovered by power cycling the ECU and then writing the data again to the ECU.


How to connect

  • 1: Connect the computer to the OBD plug on the bench setup or the OBD plug in the car.
  • 2: Turn ignition key to position 2.
  • 3: Start OBD programming software.
  • 4: After connection is successful you can read and write to the ECU.

It is recommended to always start with performing a full read of the ECU so that you have a backup that can be restored if anything goes wrong.

Most OBD programming software automatically corrects checksums when writing but double check that the software you are using has this functionality otherwise you must correct the checksums manually.

Boot Mode Programming

The Infineon C167 processor used in the MS42 and MS43 ECU has an on-chip bootstrap loader which allows a custom programming routine to be uploaded to RAM which bypasses everything on the EEPROM. As the programming routine is uploaded into RAM and is entirely independent from the code on the EEPROM the boot mode programming softwares has full access to the whole EEPROM in the ECU, this gives the boot mode programming softwares the following abilities that are not possible with OBD programming:

  • Create a 1:1 backup of an ECU which can be used to create a clone of that ECU.
  • Virginizing an ECU so that it can be paired with another EWS module.
  • Changing the VIN recorded on the ECU.
  • Writing a modified bootloader to the ECU.
  • Recover an ECU that doesn’t respond to OBD communication.

It’s recommended to only use boot mode for the previous mentioned scenarios as the process is quite involved and the bootmode programming softwares offers no safety checks that the binaries that they write to the ecu actually will work with the ecu. If something goes wrong when writing new data to the EEPROM the ECU can be recovered by power cycling the ECU, re-doing the boot mode initialization process and then writing the data again to the ECU.

Avoid writing 512KB readouts made with the OBD programming softwares in boot mode.

The OBD programming routines in the ECU blocks reading of a small area in the bootloader section that contains ECU unique keys so if that readout is flashed in boot mode the ECU unique keys will be permanently deleted.

They can only be restored if you have made a boot mode backup of the EEPROM before they were deleted.

Boot Pin Location

To initiate boot mode pin 104 on the C167 processor needs to be grounded when powering up the ECU, luckily a test pad is located just to the left of the pin on the MS42 and MS43 making the process easier.


How to connect

As pin on the C167 processor needs to be grounded when powering up the ECU it is best to perform these steps with a bench setup, but it can be performed in the car as well but extra care has to be taken that nothing is accidentally shorted. To prevent connection issues verify in the device manager on the computer that the OBD cables com port is configured with a latency timer of 16 milliseconds.

  • 1: Ensure that the ignition is off and open the ECU compartment under the hood. Disconnect all connectors to the ECU and remove the ECU from the compartment.
  • 2: Remove the protective covers on the ECU by undoing the four bolts.
  • 3: Place the ECU circuit board on an ESD safe surface.
  • 4: Connect the computer to the OBD plug on the bench setup or the OBD plug in the car.
  • 5: Start boot mode programming software.
  • 6: Short pin 104 on the C167 processor to ground with a piece of wire or something similar.
  • 7: Power up the ECU and keep shorting pin 104 for approximately 10 seconds. If you are working in the car you can power up the ECU by turning the ignition key to position 2 and then connecting the X60001 connector.
  • 8: After 10 seconds have passed remove the shorting wire from pin 104 (do not leave it connected as that will result in a corrupted read/write)
  • 9: Try connecting with the boot mode programming software. If connection failed power down the ECU and redo step 4 to 9.
  • 10: After connection is successful you can read and write to the ECU.

During the read/write process JMGarage can sometimes state that it's not responding. If this happens do not panic the program is still working in the background so just wait until it finishes.

In the event of something still going wrong during the read/write process like a laptop shutting down then power down the ECU and redo step 4 to 9 and try again.

It is recommended to always start with performing a full read of the ECU so that you have a backup that can be restored if anything goes wrong. Also remember to correct checksums on all binaries you write to the ECU.

You can identify a bad read file if bytes 0x00, 0x04, 0x08 or 0x0C read anything other than 0xFA. This happens if the boot pin is not un-grounded before read or write.

Up- / Downgrading Software Version

Upgrading and downgrading the software version is done by writing a 512KB binary with the new software version to the ECU.

This can be done through both OBD and Boot Mode but it’s recommended to use OBD as Boot Mode will also overwrite the bootloader section which contains the VIN and ISN.

Overwriting the ISN can desync the EWS from the ECU which requires the ecu to be virginized to be able to sync the EWS to the ECU again.

Bench Setup

MS42/MS43 ECU Pinout

BMW MS 43 Pinout Description.png

K-Line Connection

The MS43 ECU uses the K-Line interface for communication with diagnostic equipment for troubleshooting and programming purposes. For K-Line communication the following pins needs to be connected:

Pin Description Pin Location
VCC / +12V X60001 – Pin 1, 7, 8
GND / Ground X60001 – Pin 4, 5, 6
K-Line X60001 - Pin 3

Some people has reported having issues getting K-Line communication working with Pin 3 on the X60001 connector, if you are experiencing issues then you can try using Pin 32 on the X60004 connector instead.


CAN-Bus Connection

The MS43 ECU uses two separate CAN-Bus interfaces to communicate with auxiliary modules.

The first interface is used for the automatic transmission control unit (TCU) and is located on the X60002 connector.

The second interface is used for the ABS, ASC/DSC, instrument cluster and steering angle sensor modules and is located on the X60004 connector.

Setting up CAN-Bus communication on the bench is only needed for development purposes.

For CAN-Bus communication the following pins needs to be connected:

Pin Description Pin Location
VCC / +12V X60001 – Pin 1, 7, 8
GND / Ground X60001 – Pin 4, 5, 6
CAN-Bus Low / TCU X60002 – Pin 3
CAN-Bus High / TCU X60002 – Pin 4
CAN-Bus Low / Auxiliary X60004 – Pin 37
CAN-Bus High / Auxiliary X60004 – Pin 36

Pinouts

For the complete pinout of every connector on the MS43 visit Siemens MS42 Pinout or Siemens MS43 Pinout.