M-Drive and MDM in non M cars

aus335iguy

Colonel
Nov 18, 2017
2,248
803
0
Down under
Ride
335i DCT 2009
HI All
This thread is as per the title M drive and MDM in non M cars and is a natural progression of what was being discussed in this thread here .

In short M(2,3) and 1M modules have specific programming and features and as such the functionality they bring is highly desirable in non M cars. Specifically 335i, 135i and Z4s(including "IS" models)

This page explains what M drive and MDM are if you dont already know

So.... @amg6975 @RSL @AzNdevil @Olza @carabuser @Begood69 @NoQuarter @derekgates @S54ca @Stokes @KClemente @General.Massacre
I believe what most people want is the ability to have MDM and M drive without the hardware cost and so a coding/configuration solution would be ideal however it may well be that the hardware is M specific.

We do have the option of adding a can interface and a proof of concept from @superwoofy is on e90 post outlined here
and his code and other information is located HERE on Github

Ill ask that discussion related to M drive and MDM from the M coding thread be moved here from the Gods... I mean Mods? :D
 
Last edited:

AzNdevil

Lieutenant
Staff member
Nov 4, 2016
566
269
0
Hong Kong
Edit: 20230914: Hijacking my own post to put this tldr of how to get m drive working (at least to the best of my knowledge), please correct me if i am wrong

**NOT ALL INFO IN THIS POST HAS BEEN CONFIRMED**
**ATTEMPT AT YOUR OWN RISK, don't blame me if shit doesn't work**

if you want to be sure, i recommend reading the whole post anyways...

--------------------------------------------------------------------------------------------------------------------------------------------------------------
M Drive in a Nutshell
--------------------------------------------------------------------------------------------------------------------------------------------------------------
Servotronics (m3 short ratio steering rack steering assist)
EDC (electronic damper control)
DSC MDM Mode (relaxed version of non m dtc mode)
DCT Shiftlogic (bang bang shifting)
M3 DCT Cluster Shiftlight (bling bling)
Adjustment of M Drive Parameters in CIC iDrive

--------------------------------------------------------------------------------------------------------------------------------------------------------------
Quick Comparison between different ways on how to get M Drive working
--------------------------------------------------------------------------------------------------------------------------------------------------------------
m3 mdrive
you need this if you want to retrofit EDC

you will need to use this together with superwofy's canbus module for persistent M Drive Parameter Configuration
you will need to mod superwofy's canbus module code to switch servotronic mode (TBC)
you will need to mod superwofy's canbus module code and have something sitting in between the cluster and the rest of the bus to inject 0x399 canbus messages with the proper shiftlight fields (TBC)

you will lose dynamic cruise control (544), basic cruise control only (540), unless you retrofit a LDM module (TBC)

1m mdrive
you need this if you want to switch servotronics between comfort/sports mode
you need this if you want to switch between comfort/sports accelerator pedal map (linear/aggressive pedal)
you get to keep dynamic cruise control (544)

superwofy's canbus module
**
1m dsc firmware only**
Simple Version - https://github.com/superwofy/N54-Mdrive-MCP
Advanced Version - https://github.com/superwofy/E9X-M-CAN-Integration-Module

refer to his site/procedure, its very well written
the simple version gets the job done, the advanced version includes lots of creature comforts that

simple version handles servotronics
advanced version handles EDC and M3 DCT cluster shiftlights and other stuff

you need this if you are using a m3 dct cluster with shiftlights and want them to work
you need to know how to build, program, and hook the module up

--------------------------------------------------------------------------------------------------------------------------------------------------------------
Pre-Requisites for M Drive
--------------------------------------------------------------------------------------------------------------------------------------------------------------
  • Servotronics - m3 jbbf that supports servotronics, JBBF modules with the M mark on top is tested to work
  • Servotronics - m3 steering rack, LHD/RHD specific
  • EDC - m3 EDC module, wiring harness, and assorted stuff
  • MDCT Shiftlogic - M3 DCT GWS, Shiftknob, harness, etc (check the MDCT Thread)

  • MSD81 with a ikm0s/ina0s flash
  • 1M/M3 Kombi (Gauge Cluster) (depends if you are doing this on a E8x/E9x, cluster case/shell is different)
  • M3 SZL (if you use subwoofy's module you don't need it)
  • DSC...read below
depending on your car's build date...​
if you want to try your luck, try flashing your dsc module with the 1m/m3 firmware using winkfp but generally...​
if your car is pre 08, you will need...​
  1. m3 dsc module or post 07 dsc module that supports the 1m/m3 dsc firmware (as long as its from a 6 cylinder engined car, it **SHOULD** work
  2. m3 jbbf requires repinning obd port to provide d can or you wont be able to code it from ncsexpert at all (i have the details written down somewhere, pm me if you need it urgently or i will add it when i remember)
  3. updated yaw sensor that works with newer dsc modules, existing bracket needs to be trimmed with an angle grinder for updated yaw sensor to fit, longer bolts are also required to hold the yaw sensor in place
  4. new yaw sensor connector and plug has to be repinned
you can use this plug (courtesy of @KClemente ) or be cheap like me, i sourced a similar plug on taobao for 50 cents and shaved the key off together with some skin from my finger​
08 or after...​
  1. just flash your dsc module with the 1m/m3 dsc firmware
--------------------------------------------------------------------------------------------------------------------------------------------------------------
MDrive Variants
--------------------------------------------------------------------------------------------------------------------------------------------------------------
m3 mdrive/mdm:
additional hardware
m3 dsc button module (optional if you don't retrofit EDC, you can repin your non-m center console button module to turn off dsc)​
female pin (MQS ELA 0.35-0.5 MM2) for dsc module pin41​
solid core wire thats stiff enough to go into a connector, to be routed from dsc to your dsc off button​
or you can use the part numbers courtesy of @KClemente
The pin part number is: 61 13 6 901 726 and the grommet for the wire is: 61 13 8 366 245

Now if you look at the dsc connector you’ll see two holes per pin. What my impatient self did, was loop I think 16-18 gauge wiring through both holes of that pin which when the connector is locked into place, would tightly hold the wire and keep a good secure connection. Hasn’t failed ever.
wiring
m3 dsc module
ground pin41 of dsc module for ~2 seconds to turn off dsc (at least thats what my m3 dsc module wanted)​
if you want to repin non-m center console button module to turn off dsc, remove pin 1 on the 6 pin connector and hook it up to pin41 of dsc module​
non m dsc module
constant 12v to pin41 of dsc module to prevent button held down error​
pin 6 of m3 dsc button module to pin41 of dsc module (m3 dsc button module grounds the other side)​
quote from @RSL
Sorry, been out of it for a while. Yes, myself and at least one other had to run +12v to pin 41 on DSC. Mine is 5/2010 build 2011 335is, but I don't think I have any pics with my DSC module number handy for reference. If using an actual M3 DSC, this should not be an issue.

The telltale sign is getting the button pressed >10 sec error after turning the car on. If you get that with nothing or ground connected to pin 41 with M3 DSC flashed to non-M DSC, you probably need +12v to the pin instead and will then need to connect the DSC Off button to a relay to break +12v to turn it off manually. I used +12v, but 3 or 5v may work. Before I added the relay for the button, I just set default to DSC off when MDrive activated.

If there are no codes (and codes aren't disabled) and it still doesn't work, it's hard to say, especially with all the other hardware that changed to support it.
1m mdrive/mdm:
nothing is required...(as far as i know) since 1m dsc firmware uses the non-m way of disabling dsc (button goes to jbbf, jbbf sends dsc a message on canbus)
--------------------------------------------------------------------------------------------------------------------------------------------------------------
software side of things
--------------------------------------------------------------------------------------------------------------------------------------------------------------

1. 1m/m3 dsc coding
ncsexpert, change VO of either CAS or FRM module to 1M or M3 (build code, eg. KG92 for RHD M3), default code dsc module

2. ecu tune switch/parameter setting
curteosy of @KClemente /@RSL
0x4EDD3 is the 0x399 toggle in IKM0S.

If toggle is 00, st_dsc_can will not change. Set to 01 to enable.

Sidenote: I had to change K_SPORT_MDRV_DSC to 04 to get the M button to set the DSC to MDM mode. You can also set it to 01 to have the M button to turn off DSC completely. Though you'd be able to change it via CIC if you build and install superwofy's CAN module.

--------------------------------------------------------------------------------------------------------------------------------------------------------------
--------------------------------------------------------------------------------------------------------------------------------------------------------------
original post:
let me share some of my throughts on this after a bunch of research and looking in the dme stuff
there are just too many variables and i am going to try and break them down, forgive me if i make any mistakes and let me know


before we start, i think MDM and M drive should be discussed further as there are a few variations involved

on a 1M, according to https://www.1addicts.com/forums/showthread.php?t=465001
m drive only changes throttle maps, mdm is the one that lets the car slide around a little before catching it
i dont know which mode changes the servotronics as well but im sure its changed in one of these modes
- personally i think this should be the easiest and suitable for 6MT cars

on a M3, its complicated... from my research, mdm is a must, m drive is an option, idrive is an option
functionality and adjustment wise it will be different for each combo, also, year variations (pre/lci) seems to be different as well
i gave up trying to sumamrize after reading https://www.m3post.com/forums/showthread.php?t=510885

but... m drive retrofit on a m3 just involves replacing the szl with a sports one and proper coding according to https://www.m3post.com/forums/showthread.php?t=676825

we also have the Z4 variant, normal/sports/sports+, to me this looks just like m drive and mdm with different names

lets throw in a bunch of variables in our setups

szl - non-sport (non m), sport (1m/m3), some kind of center console button box (z4)
from the non-m dme side of things, a sports szl is the minimum requirement for m drive
on top, due to different variants of m drive/mdm on the m3 itself wrt (pre/lci), some have the mdm button (st_mdrv_taster), some doesnt, this is another unknown

z4 sports mode, at this stage we are still not sure if that center console button box thingy is responsible for generating 0x315 canbus messages

transmissions - 6MT, 6HP (non-m) , DCT (non-m), DCT (m3/z4)
6MT is self explanatory, no gateway, no programming
6HP does have sports mode, i doubt any of the M3/Z4 stuff cares for this
DCT (non-m) and (m3/z4), the main difference is the gateway and program running on it
as @Olza confirmed, there is code on the gearbox side of things to handle switching into m drive/z4 sports mode depending on what it receives on the canbus
(m drive = some bit in 0x399), (z4 sports = some bit in 0x315)

jbbf - from servotronics retrofit thread, there ARE physical differences between M3 and early non M JBBF, maybe 335is jbbf are the same as M3 as they are able to drive servotronics after adding a fuse, module version and coding options also differs

zwp_abschaltung_dkg only exists on jbbf2/3 used by m3
although the option translates to zwp_ switch-off_DKG (according to google translate), if M3 and non M cars dont share the same zb, it is possible that the jbbf might handle passing on canbus messages differently, same goes for z4 sports mode
1610647952912.png


dsc - 1m/m3/non m 335is, early non m (i think its sometime pre 2008)
as i have discovered, you cant flash the M3/1M dsc programs on early non m dsc modules
i have done some research on this, it is possible to retrofit but this will require a new dsc and yaw sensor replacement + some repinning
in fact, this is requirement for a DCT swap for pre 08 non M cars....

on top, ncsexpert coding for both 1M and M3 dsc definitions allows switching dsc off through canbus commands
1610485976807-png.png



1610486040193-png.png


kombi - non m, m
you need the m cluster to see the M light go on

of course we also need to add in the wiring differences since non m and m cars are different afterall...
i havent reviewed this in depth but i think @aus335iguy can share his insight on it
 
Last edited:

aus335iguy

Colonel
Nov 18, 2017
2,248
803
0
Down under
Ride
335i DCT 2009
I concur
The 1M implementation of MDrive is just servotronic and throttle maps
The M3 implementation adds others such as EDC, drivelogic and MDM.
This conflates the issue. Per previous (full M3 hardware implementations on 335’s) by @Begood69 and @dyezak the two can be moshed together and that yields sharper throttle but not the recall of the drivelogic level and I haven’t seen conclusive proof that the dynamic mode is activated

CAN logging on an M3 like @amg6975 and something like @Begood69 car will show the difference pretty conclusively.
 

amg6975

Sergeant
Oct 27, 2019
278
184
0
Ride
2012 135, 2005 ZHP, 2009 fJCW
Just need to confirm that bits 0-1 of Byte 1 in 0x399 do not change in IKM0S and thats the smoking gun.

If IKM0S could be modified to provide the on/off in 0x399 then everything should work. Otherwise you’ll want DME software that doesn’t output 0x399 and do it yourself with a CAN solution. In that case you could use the SPORT button instead of needing the M3 SZL.
 
  • Like
Reactions: aus335iguy

AzNdevil

Lieutenant
Staff member
Nov 4, 2016
566
269
0
Hong Kong
Just need to confirm that bits 0-1 of Byte 1 in 0x399 do not change in IKM0S and thats the smoking gun.

If IKM0S could be modified to provide the on/off in 0x399 then everything should work. Otherwise you’ll want DME software that doesn’t output 0x399 and do it yourself with a CAN solution. In that case you could use the SPORT button instead of needing the M3 SZL.

i can confirm this, at least to my knowledge, i dont see anything changing bit 0-1 of byte 1 in 0x399

if bit 0-1 of byte 1 really causes the gearbox to switch modes then....the alternative is Z4 sports mode
 

JohnDaviz

Lieutenant
Jan 6, 2019
863
577
0
Ride
335i E92 DCT
dsc - 1m/m3/non m 335is, early non m (i think its sometime pre 2008)
as i have discovered, you cant flash the M3/1M dsc programs on early non m dsc modules
i have done some research on this, it is possible to retrofit but this will require a new dsc and yaw sensor replacement + some repinning
in fact, this is requirement for a DCT swap for pre 08 non M cars....

I have a late 2009 EU DCT 335i
There never was a 335is in Germany. It was just the standard car and you could order it simply with a DCT.

How can I check if my DSC is capable of being properly working after coding or if I need another module?
 

RSL

Lieutenant
Aug 11, 2017
937
501
0
I can confirm I've seen no change in B1 bits 0-1 in any logs as well.

Perhaps @carabuser can take a look at INA0S and see if there is any 0x399 output in it. I could flash back to INA0S and just broadcast with it to test. That may be enough, but I'd still prefer button option to CAN.
 

Olza

Corporal
Feb 2, 2020
229
223
0
Minsk, Belarus
Ride
BMW M240 xdrive
i guess there is an option to support full MDM in x35 latest programs for 0x399 output. but disabled in config. who has disassemble of this to check?
 

carabuser

Lieutenant
Oct 2, 2019
870
1
766
0
UK
Ride
Z4 35i & 335i
I can confirm I've seen no change in B1 bits 0-1 in any logs as well.

Perhaps @carabuser can take a look at INA0S and see if there is any 0x399 output in it. I could flash back to INA0S and just broadcast with it to test. That may be enough, but I'd still prefer button option to CAN.
Is that signal mentioned in the Continental or BMW specification docs?

Found this signal that comes from the SZM module into the DME:
FAHRZEUGMODUS (Vehicle Mode)
DME symbol name: STATE_VEH_MOD


Page 1168 of the BMW doc details the MDrive status. It's passed to the KOMBI by the Continental layer to MDrive display purposes. It just mirrors the status of a signal called SY_SPORT_SZL. I think this is derived from STATE_VEH_MOD but haven't followed it in the code.

I haven't followed the sport button and MDrive stuff at all. If you can work out what signal you want me to chase I can find it in the code. Just need a symbol name to follow.
 
Last edited:
  • Like
Reactions: RSL and Olza

AzNdevil

Lieutenant
Staff member
Nov 4, 2016
566
269
0
Hong Kong
Is that signal mentioned in the Continental or BMW specification docs?

Found this signal that comes from the SZM module into the DME:
FAHRZEUGMODUS (Vehicle Mode)
DME symbol name: STATE_VEH_MOD


Page 1168 of the BMW doc details the MDrive status. It's passed to the KOMBI by the Continental layer to MDrive display purposes. It just mirrors the status of a signal called SY_SPORT_SZL. I think this is derived from STATE_VEH_MOD but haven't followed it in the code.

I haven't followed the sport button and MDrive stuff at all. If you can work out what signal you want me to chase I can find it in the code. Just need a symbol name to follow.

its in c_can_st_mdrv where the 0x399 canbus message is put together
i dont see any references myself in both IK or IN but you may be better at this than me
 

Olza

Corporal
Feb 2, 2020
229
223
0
Minsk, Belarus
Ride
BMW M240 xdrive
Is this 0x315? DKG used Byte1 high four bits for vehicle status calculation for Z4 (normal, sport, sport+).
Do we know exact values and their meanings? Because in DKG strange calculations occurs, like for Program mode used 9-10-11-12-13 values, but should be only 9-10-11 for P1-P2-P3. For Sport status value <4 or <13?!
But it is not related to Mdrive.

Edit. Yeah, exactly HIGH bits, which unused in DME desc.
1610728907019.png

1610728591040.png
 
Last edited:
  • Like
Reactions: RSL

amg6975

Sergeant
Oct 27, 2019
278
184
0
Ride
2012 135, 2005 ZHP, 2009 fJCW
Is this 0x315? DKG used Byte1 high four bits for vehicle status calculation for Z4 (normal, sport, sport+).
Do we know exact values and their meanings? Because in DKG strange calculations occurs, like for Program mode used 9-10-11-12-13 values, but should be only 9-10-11 for P1-P2-P3. For Sport status value <4 or <13?!

Edit. Yeah, exactly HIGH bits, which unused in DME desc.
View attachment 48110
Yes, that looks like 0x315. My 135 doesn't have it and the M3 MOD_VEH is stuck at 0xF1.
 

amg6975

Sergeant
Oct 27, 2019
278
184
0
Ride
2012 135, 2005 ZHP, 2009 fJCW
Is that signal mentioned in the Continental or BMW specification docs?

Found this signal that comes from the SZM module into the DME:
FAHRZEUGMODUS (Vehicle Mode)
DME symbol name: STATE_VEH_MOD


Page 1168 of the BMW doc details the MDrive status. It's passed to the KOMBI by the Continental layer to MDrive display purposes. It just mirrors the status of a signal called SY_SPORT_SZL. I think this is derived from STATE_VEH_MOD but haven't followed it in the code.

I haven't followed the sport button and MDrive stuff at all. If you can work out what signal you want me to chase I can find it in the code. Just need a symbol name to follow.
What are these docs and how do I get them?! All my info is just from datalogging the CAN and figuring out what does what.
 

carabuser

Lieutenant
Oct 2, 2019
870
1
766
0
UK
Ride
Z4 35i & 335i
I can make code changes to the program sector if that's needed but it's probably something that can be solved with changes to local variables in the calibration sector. If the logic works for the 1M but not for other cars then it'll almost certainly be an LV_ flag that can be altered.

I don't have as much spare time these days, have to actually work for a living again so I've not done much with the DME recently.
 

amg6975

Sergeant
Oct 27, 2019
278
184
0
Ride
2012 135, 2005 ZHP, 2009 fJCW
I can make code changes to the program sector if that's needed but it's probably something that can be solved with changes to local variables in the calibration sector. If the logic works for the 1M but not for other cars then it'll almost certainly be an LV_ flag that can be altered.

I don't have as much spare time these days, have to actually work for a living again so I've not done much with the DME recently.
I think the missing link is the M Drive enable being in the lowest two bits of Byte 1 in 0x399 (what I call M_ACT below.) If we can get that turned on all the M Drive modes should work across the board using the M button on the steering wheel.

The 1M doesn't do this because it doesn't do M Drive like the M3.

1610736893455.png
 
Last edited:

carabuser

Lieutenant
Oct 2, 2019
870
1
766
0
UK
Ride
Z4 35i & 335i
I think the missing link is the M Drive enable being in the lowest two bits of Byte 1 in 0x399 (what I call M_ACT below.) If we can get that turned on all the M Drive modes should work across the board using the M button on the steering wheel.

The 1M doesn't do this because it doesn't do M Drive like the M3.

View attachment 48120
Is all that based within the DME?

If so then the symbolic name for what you call M_ACT_2 is STATE_SPT_DISP_CAN. The description for St_mdrv_anz reads "The MDrive display in the Kombi is controlled via this signal." This signal is then mapped to STATE_SPT_DISP_CAN for transmission to the KOMBI.

1610737613597.png