Announcement

Collapse
No announcement yet.

Using USBJTAG u-link NT with the MSS60/65

Collapse
This is a sticky topic.
X
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Using USBJTAG u-link NT with the MSS60/65

    After learning about this device (https://www.usbjtag.com/), it seemed promising as an option to be able to BDM these DMEs. Worked with the main dev on it for a little bit and got it working well. This device can also be used with the MSS54HP for those who have both cars (and with minimal modification to the XML files, can likely also work with the MSS52 / 54 non-HP).

    One quirk of the program is it can't access both internal and external flash within the same session, so you need separate XML files. XMLs he helped me build in the code blocks below

    Internal Flash
    Code:
    <Test>
        <Name>BMW_MSS6x_Internal_Flash_BDM</Name>
        <Protocol>BDMPPC</Protocol>
        <Endian>Big</Endian>
        <Speed>1</Speed>
        <Cat>ECECM</Cat>
        <SubProtocol>MPC55X</SubProtocol>
        <sprogram>1</sprogram>
        <InternalFlash>1</InternalFlash>
        <Memorys>
            <Memory>
                <Name>MPC_Flash</Name>
                <Type>1</Type>
                <Address>0x0</Address>
                <Size>0x80000</Size>
            </Memory>
            <Memory>
                <Name>Shadow_block</Name>
                <Type>1</Type>
                <Address>0xF0000000</Address>
                <Size>0x200</Size>
            </Memory>
        </Memorys>
    <Inits>
            <Init>
                <Address>0x002FC000</Address>
                <Value>0x70420C20</Value>
                <Bytes>4</Bytes>
            </Init>
            <Init>
                <Address>0x002FC024</Address>
                <Value>0x00000000</Value>
                <Bytes>4</Bytes>
            </Init>
            <Init>
                <Address>0x002FC028</Address>
                <Value>0x00000000</Value>
                <Bytes>4</Bytes>
            </Init>
            <Init>
                <Address>0x002FC02C</Address>
                <Value>0x00000000</Value>
                <Bytes>4</Bytes>
            </Init>
            <Init>
                <Address>0x002FC030</Address>
                <Value>0x00004A6C</Value>
                <Bytes>4</Bytes>
            </Init>
            <Init>
                <Address>0x002FC038</Address>
                <Value>0x07008C00</Value>
                <Bytes>4</Bytes>
            </Init>
            <Init>
                <Address>0x002FC03C</Address>
                <Value>0x02500000</Value>
                <Bytes>4</Bytes>
            </Init>
            <Init>
                <Address>0x002FC100</Address>
                <Value>0x00C00863</Value>
                <Bytes>4</Bytes>
            </Init>
            <Init>
                <Address>0x002FC104</Address>
                <Value>0xFFF80010</Value>
                <Bytes>4</Bytes>
            </Init>
            <Init>
                <Address>0x002FC108</Address>
                <Value>0x00400043</Value>
                <Bytes>4</Bytes>
            </Init>
            <Init>
                <Address>0x002FC10C</Address>
                <Value>0xFFE00040</Value>
                <Bytes>4</Bytes>
            </Init>
            <Init>
                <Address>0x002FC110</Address>
                <Value>0x01600843</Value>
                <Bytes>4</Bytes>
            </Init>
            <Init>
                <Address>0x002FC114</Address>
                <Value>0xFFEF8030</Value>
                <Bytes>4</Bytes>
            </Init>
            <Init>
                <Address>0x002FC118</Address>
                <Value>0x01400847</Value>
                <Bytes>4</Bytes>
            </Init>
            <Init>
                <Address>0x002FC11C</Address>
                <Value>0xFFEF8000</Value>
                <Bytes>4</Bytes>
            </Init>
            <Init>
                <Address>0x002FC140</Address>
                <Value>0x1C000000</Value>
                <Bytes>4</Bytes>
            </Init>
            <Init>
                <Address>0x002FC144</Address>
                <Value>0x7C000000</Value>
                <Bytes>4</Bytes>
            </Init>
        </Inits>​
    </Test>
    External Flash
    Code:
    <Test>
        <Name>BMW_MSS6x_Ext_BDM</Name>
        <Cat>ECECM</Cat>
        <Protocol>BDMPPC</Protocol>
        <SubProtocol>MPC55X</SubProtocol>
        <Speed>1</Speed>
        <Endian>Big</Endian>
        <Use32bit>1</Use32bit>
        <Memorys>
            <Memory>
                <Name>Ext_Flash</Name>
                <Type>1</Type>
                <Address>0x400000</Address>
                <Size>0x200000</Size>
            </Memory>
        </Memorys>
        <Inits>
            <Init>
                <Address>0x002FC000</Address>
                <Value>0x70420C20</Value>
                <Bytes>4</Bytes>
            </Init>
            <Init>
                <Address>0x002FC024</Address>
                <Value>0x00000000</Value>
                <Bytes>4</Bytes>
            </Init>
            <Init>
                <Address>0x002FC028</Address>
                <Value>0x00000000</Value>
                <Bytes>4</Bytes>
            </Init>
            <Init>
                <Address>0x002FC02C</Address>
                <Value>0x00000000</Value>
                <Bytes>4</Bytes>
            </Init>
            <Init>
                <Address>0x002FC030</Address>
                <Value>0x00004A6C</Value>
                <Bytes>4</Bytes>
            </Init>
            <Init>
                <Address>0x002FC038</Address>
                <Value>0x07008C00</Value>
                <Bytes>4</Bytes>
            </Init>
            <Init>
                <Address>0x002FC03C</Address>
                <Value>0x02500000</Value>
                <Bytes>4</Bytes>
            </Init>
            <Init>
                <Address>0x002FC100</Address>
                <Value>0x00C00863</Value>
                <Bytes>4</Bytes>
            </Init>
            <Init>
                <Address>0x002FC104</Address>
                <Value>0xFFF80010</Value>
                <Bytes>4</Bytes>
            </Init>
            <Init>
                <Address>0x002FC108</Address>
                <Value>0x00400043</Value>
                <Bytes>4</Bytes>
            </Init>
            <Init>
                <Address>0x002FC10C</Address>
                <Value>0xFFE00040</Value>
                <Bytes>4</Bytes>
            </Init>
            <Init>
                <Address>0x002FC110</Address>
                <Value>0x01600843</Value>
                <Bytes>4</Bytes>
            </Init>
            <Init>
                <Address>0x002FC114</Address>
                <Value>0xFFEF8030</Value>
                <Bytes>4</Bytes>
            </Init>
            <Init>
                <Address>0x002FC118</Address>
                <Value>0x01400847</Value>
                <Bytes>4</Bytes>
            </Init>
            <Init>
                <Address>0x002FC11C</Address>
                <Value>0xFFEF8000</Value>
                <Bytes>4</Bytes>
            </Init>
            <Init>
                <Address>0x002FC140</Address>
                <Value>0x1C000000</Value>
                <Bytes>4</Bytes>
            </Init>
            <Init>
                <Address>0x002FC144</Address>
                <Value>0x7C000000</Value>
                <Bytes>4</Bytes>
            </Init>
        </Inits>
    </Test>
    
    ​
    I found speed 0 to be unstable. Initially i was using Speed 2, but found the external flash would hang on erase. Speed 1 seems to work reasonably reliably for me after some testing. YMMV based on connection quality, cable length, etc.

    Regarding the censorship. This can be cleared by manipulating the registers. Clearing the censorship however will erase the entirety of the internal flash and shadow memory. So you must have a backup made via OBDII/CAN available to restore (i.e with MSS6x Flasher). It is not possible to backup the shadow memory - however it is known that the valid shadow memory for these ECUs would be the first 4 bytes set to '20 41 00 00' and the remainder to FF, so this is not an issue. Current version of MSS6x Flasher will save a full read in BDM format as well as the full binary to make this process a little easier.

    Image attached with the commands to clear / set the censor bits. This can likely be packaged into the script, but it is not something you should have to run more than once per ECU.



    If you wish to place the ECU in censored mode, that can also be done using similar commands as above. However you must ensure that the IWS bit in the shadow block is set to 1 if you wish to retain the ability to clear the censor. If it is set to 0, it is not possible to clear the censor bits. From my testing with the MSS65 in this state, the ECU itself also appears to be rendered incapable of running its internal flash/erase routines -- effectively rendering it a brick if you have an incomplete program. I am not certain if that would be the case on the MSS60, and I don't intend to find out​

    #2
    So apparently I do need to figure out how to init the flash. If you happen to reset the DME while the external flash is blank, that breaks things quite a bit. Ideally a BDM device would be able to recover from complete bricks and/or allow flashing completely blank modules.

    Guess I have to dig through the reference manual and disassembly.

    Edit: Added a bunch of init values that the DME seems to setup. I don't know if I need *all* of them, but does seem to allow reading/writing to the flash even when there isn't a valid program

    Comment


      #3
      If you want an easy way to go from the 1.27mm pitch BDM header to 2.54mm pins that most devices use, this little board works well. Ignore the actual pin labels - it's a straight 1:1 layout https://www.amazon.com/dp/B09DKDG7XN...fed_asin_title

      You can solder on some headers pin headers (like these) and connect directly to the ulink NT with its breakout cable using the below diagram

      ​​Click image for larger version

Name:	image.png
Views:	252
Size:	53.0 KB
ID:	354538​

      Or alternatively you can build a little adapter board like below and use a standard ribbon cable at each end

      Click image for larger version

Name:	65351981-C4C1-4266-98D9-A9AF9FE81395_1_201_a.jpg
Views:	253
Size:	62.7 KB
ID:	354536

      Click image for larger version

Name:	36663168-D349-4905-9143-13800A07EE61_1_201_a.jpg
Views:	241
Size:	66.5 KB
ID:	354537​​

      Comment


        #4
        Thanks for this Terra. I followed your guide and was able to clear the censor and flash the backup injector shadow and MPC flash without too much hassle.

        Very neat little tool this u-Link

        Comment


          #5
          Hey Terra, thanks for your work as always. I need to recover an MSS65 that had RSA bypass fail.
          Which processor do we select in the software? I don't see MPC563.

          Edit:
          Found my mistake. Defining the script directory wasn't enough for the program to pick it up. I had to copy the scripts over to the config folder in %appdata% and now I see BMW_BMW_MSS6x_Ext_BDM and
          MSS6x_Internal_Flash_BDM
          ​

          For further clarification, do we run the commands in the screenshot once and then load the BDM backup and perform a write?

          Here's the data word for word from the screenshot. I'm sure some of them were outputs like the Target CPU but I wrote it anyway

          Code:
          -speed 1
          -peek 2fc800
          Peeked Address=0x002FC800 Data=0x43FF00FF
          -pokeb 2fc803 0
          -pokeh 2fc80a ff46
          -pokeb 2fc803 0
          -pokeb 2fc80b 47
          -pokeb 2fc80b 46
          -pokeb 2fc80b 4
          -reset
          -reset 1
          Target cpu is a 'MPC565/6'
          IMR 00000000
          Internal flash is not enabled in IMMR
          -reset 1
          Target cpu is a 'MPC565/6'
          IMMR 36200800
          -peek 2ffc800
          Peeked Address=0x002FC800 Data=0x40FF00FF
          -pokeb 2fc80b 42
          -pokeb 2fc800 1
          -pokeb 2fc80b 43
          -pokeb 2fc80b 42
          -pokeb 2fc80b 0
          -reset
          -reset 1
          Target cpu is a 'MPC565/6'
          IMR ffffffff
          -reset 1
          Target cpu is a 'MPC565/6'
          IMR 36200800
          -peek 2fc800
          Peeked Address=0x002FC800 Data=0x41FF00FF​
          Last edited by armenh7; 11-12-2026, 12:12 AM.

          Comment


            #6
            Those screenshot commands are only if you're clearing censorship mode for BDM access. You shouldn't need to do that on an MSS65

            For an MSS65, just loading an appropriately formatted backup and flashing the respective internal/external/shadow memories should be sufficient.

            Comment


              #7
              Originally posted by terra View Post
              Those screenshot commands are only if you're clearing censorship mode for BDM access. You shouldn't need to do that on an MSS65

              For an MSS65, just loading an appropriately formatted backup and flashing the respective internal/external/shadow memories should be sufficient.
              Got it. Thank you.

              I was able to read the DME with ACDP but it would fail to write so it seems like the CPU is locked. This was before I attempted RSA bypass and ended up with a soft brick.

              Comment


                #8
                I don't know what ACDP is, but if you can read over BDM, that means it's not locked

                Comment


                  #9
                  Originally posted by terra View Post
                  I don't know what ACDP is, but if you can read over BDM, that means it's not locked
                  It's a tool for ECU work, keys, etc. When I tried to write, it failed to erase (before I did any MSS6X Flasher operations). They even have a disclaimer on their website that claims some MSS65 are locked but no mention of MSS60.

                  I get error ecu security access denied immediately when trying to flash with winkfp. MSS6X Flasher gets about halfway flashing then fails.
                  Last edited by armenh7; 11-12-2026, 12:01 PM.

                  Comment


                    #10
                    There is a difference between a BDM and OBD lock. Your DME sounds like it has different security access keys (or this is some sort of prototype or motorsport variant of the DME that uses different keys)? While it is theoretically possible to BDM lock an MSS65, it is generally rare for that to be the case (has to be a deliberate action - it's not done at the factory or through any onboard routines like the MSS60)

                    If you managed to get a full read and are willing to share that read, it shouldn't be too difficult to figure out what's going on.

                    Comment


                      #11
                      Originally posted by terra View Post
                      There is a difference between a BDM and OBD lock. Your DME sounds like it has different security access keys (or this is some sort of prototype or motorsport variant of the DME that uses different keys)? While it is theoretically possible to BDM lock an MSS65, it is generally rare for that to be the case (has to be a deliberate action - it's not done at the factory or through any onboard routines like the MSS60)

                      If you managed to get a full read and are willing to share that read, it shouldn't be too difficult to figure out what's going on.
                      Full read from MSS6X flasher and ACDP attached. The ACDP read is from before using MSS6X flasher.
                      Attached Files

                      Comment


                        #12
                        Hmm so comparing to a known stock 140E binary, the program appears to be stock. Does your WinKFP setup work with other MSS6x DMEs?

                        Comment


                          #13
                          Originally posted by terra View Post
                          Hmm so comparing to a known stock 140E binary, the program appears to be stock. Does your WinKFP setup work with other MSS6x DMEs?
                          Yup, flashed plenty of them before.

                          I can get a read of the now "corrupt" if needed to see what's different. Just kidding. MSS6X Flasher just crashes when trying to read now ("program not available or not complete")
                          Last edited by armenh7; 11-14-2026, 02:25 PM.

                          Comment

                          Working...
                          X