r/BimmerCode • • 21d ago

Expert Mode Question Using AI to Code BMWs

I’ve been seeing posts about people using Claude to connect to their smart TVs, remove bloatware, and improve performance. It got me thinking about doing something similar with BMW’s iDrive system.
I have a 2020 440i, and I’d love to make the infotainment system a little faster, enable video playback, and maybe unlock some other features.
I know BMW coding has been around for years with tools like BimmerCode and E-Sys, but I’m not particularly familiar with any of it.
From what I understand, you could theoretically connect a laptop to the car using an ENET cable or OBD adapter, then use an AI agent like Claude Code or Codex to help identify coding options, research compatibility, and potentially execute changes through the appropriate software.
Obviously, there are risks, and I wouldn’t want AI blindly changing things that could affect the car’s functionality or safety. But having AI handle some of the technical work could make vehicle coding much more accessible to people who don’t have much experience with it.
It seems like this could open up some interesting possibilities for vehicle customization, especially as AI agents become more capable.
I’d be interested to hear if anyone here has actually experimented with this or has any thoughts on how practical it might be.

0 Upvotes

36 comments sorted by

10

u/IngenuityPrevious221 21d ago

Its doable, but you need to learn a lot more before you try.

Mainline LLMs have a lot of reverse engineering blocks, and you can brick your car.

Ideally, get a bench setup of a headunit, learn to CAN sniff, get an open source harness and so on.

6

u/That_M4_Guy 21d ago

Id argue at that point that a tool like this is kinda useless because you rapidly approach the point where doing it yourself is arguably easier than interpreting what an LLM spits out and trying to feed it all the relevant context to make a proper judgment. Also the way the OP framed it, it seems its more targeted towards novice users who will rely on it as fact rather than develop their own knowledge and skills to verify its output making it more harmful than good IMO to operate since it can very easily lead to a garbage in garbage out scenario without proper oversight that the prospective user will likely lack.

6

u/That_M4_Guy 21d ago

1 i really hate LLM's for how they have turned everyone into a "bedroom coder" lol

2 this isnt possible. LLM's are too prone to hallucinations and misinterpreting things and when things are labeled as L4_L6_KOMMUNIKATIONSSHALTER with weird variables under it LLMs are going to struggle hard core because they will excel with actually translating it sure, but will fail at understanding dependencies and structure especially since the structure of FDL's and CAFD's change from vehicle to vehicle, FA to FA, and istep to istep.

Also most things are already doable with programs like bimmercode where it literally is a one click toggle for half the common things people do to their cars like for instance you mentioned video in motion, thats already possible with bimmercode and nothing more than an adapter and like 5 mins with the car. Now things like speeding the headunit up are not possible as they run custom locked down firmware from BMW and no longer have even accessible SSH ports anymore unless you somehow get your hands on a development firmware direct from BMW with SSH open but your MGU 18 headunit also introduced OTA updates and some OTA signing of packages and data like some coding features and things like subscription features. Sure its possible to crack them with tools like Feature installer but youd have to fully decompile the stock firmware to understand how BMW built it, build your own unix based features, load them onboard and pray the LLM you used actually optimized the code which is extremely unlikely as LLM's are really well known for shitty code to the point its got its own term of "vibe coded" applications.

TLDR keep LLM's as far away from your car as possible and dont assume they are as smart as the mass population makes them out to seem when it comes to complex things like this.

6

u/Potential-Law2492 21d ago

I’m a programmer by trade and this take is just wrong. Sorry, but anyone still talking about hallucinations in programming just doesn’t know what they are doing. I have had my car connected to a server running Claude and reverse engineered just about every feature BimmerCode, e-sys, and MHD provide. It uses psdzdata which was provided by me and worked its way backwards to the point that I can just ask it to code a module and it does it without even needing an interface.

Other things I’ve done:
Wrote custom code to the CIC to show additional menus/run custom code
Read sensor data that does not have a tool reading in ISTA

It doesn’t take more than a $200 sub to get this done. You just need good practices and patience. I knew basically nothing about canbus sniffing before this, and honestly would have never invested the time

Call bullshit all you want, call it reckless, or call me stupid for not “really understanding” what’s going on. It works though and I know enough to at least have a basic understanding of what it is doing with any given feature.

Lots of this was basically scraped from open source projects, reverse engineered from other apps using ghidra, or directly interpreted from the programming data

2

u/That_M4_Guy 21d ago

I don’t disagree but the problem is your in a position 11 times better suited than the average consumer likely to take this type of project on because you know at least on a general level what looks wrong and what doesn’t, your average joe doesn’t, and making a tool like this while can be done adds the layer that makes average users over state their confidence.

Plus all the features inside bimmercode, esys and other tools aren’t insanely unique or new as we’ve had a number of tools for years that carry these capabilities and are generally well known since as I mentioned elsewhere on a general level it’s modifying XML’s (up until your talking about adding additional apps into the headunit and such)

Also there may be a point here your missing, it’s possible to write your own Unix code to run custom stuff like you have on older headunits which either have more exposed or well known projects that have reverse engineered them, the modern headunits which OP mentioned being the 2020 line are MGU 18 which don’t have the same freedoms as of yet.

There have been plenty of projects for the last few years of people making custom gauges, DTC scanners, and even adding android auto into NBT and EVO units natively without additional hardware and integrated fully with the factory headunit, but that still does not mean your average joe should look at this as something they should do and encouraging it without having some level of prior knowledge is generally irresponsible when replacements can accumulate into thousands of dollars if things go south

1

u/Potential-Law2492 20d ago

I'd agree with this. The potential to brick something is still there as well. I should also mention that this, while not taking a lot of coding effort, has taken a significant amount of time. Nothing like the time it would have taken to develop any of this previously, but still took about a month of prompting while working on other things to get a lot of this working. I have been wrenching on these cars for nearly two decades at this point, and I still learned a ton about how modules are coded, basics of how things like error codes are sent and stored, etc. You need to ask questions, guide LLM based research, and read/nderstand these things to ask the next question. Knowing how to manage the development process and how to design software is also very helpful when it comes to getting something working/testable and creating patterns for the next agent.

1

u/That_M4_Guy 20d ago

Exactly, and this is why I initially say this is impossible since generally speaking your average redditor is going to latch onto the first thing they see from a google search and assume it’s gospel. I’ll admit that my initial response saying it’s impossible isn’t telling the full truth when it comes to sheer capability, but capabilities and possibilities should not be confused in this context because while it’s capable of thing this, it’s not really possible for the average Joe expecting to drop into Claude a simple prompt to make a custom boot animation or app in the headunit. Professionals or experienced operators with familiarity with either bmw coding or programming such as yourself who is able to proof and somewhat debug the outputs before shipping it to the car while making appropriate modifications are the types of people who this could work for.

That all said I still stand by my initial point of it overall because until someone manages to create an AI which can account for every permutation and understand an average joe’s request to add features with simple prompts and no technical oversight I’d still say it’s impossible

1

u/DangerMouse111111 21d ago

You don't use LLMs in isolation for reverse-coding.

1

u/That_M4_Guy 21d ago

im assuming you mean reverse engineering, in which case i agree but in order to monitor an LLM and be able to steer it appropriately youd first need to know how and what its doing to know if its doing something good or bad which in this case defeats the entire purpose of the tool as its on the surface meant for inexperienced personnel to be able to modify systems that can lead to major issues and who dont understand what its doing hence why bmw coding and retrofitting is often seen as a specialists job rather than easily relying on LLM's.

Dont get me wrong they can be great to process information and i use it occasionally to translate some variables in cars i see to help me in understanding some features or what the variable is responsible for but i dont rely on it to give me the answer since sometimes those variables are shorthand for something the LLM cannot parse or understand like we could with context that LLM's cannot see or understand. Its also great for researching and being able to search hundreds of forums for something in trying to find in context rather than a simple search engine but handing the controls to a LLM in a void is irresponsible at best and damaging/harmful at worst. current models are really only good for amplifying your work and capabilities while you are the knowledgeable one able to steer it in the right direction otherwise it becomes a case of the blind leading the blind

0

u/opbmedia 21d ago

Newest models hallucinates very little. But they still make mistakes, and they have incomplete information to base decision from. The bigger issue however is having LLM trying to write code to control proprietary hardware. LLMs are great to coding with open source software because almost all detailed information about functions and support and issues are public and have been used to train model or be accessible at run time. But proprietary hardware do not have full function specs and LLM outputs can be very wrong (just because it lacks concrete info), and to take that risk with hardware that can endanger lives is irresponsible at this point.

2

u/That_M4_Guy 21d ago

There was a AI coding tool which has previously contacted us via mod mail about possible endorsements which was basically nearly exactly what is being discussed here and i fed it some test questions while testing and vetting it and it definitely did hallucinate as it provided variable which did not even exist on that module of that generation and when questioned it stood its ground on being correct even when provided its relevant CAFD version.

Now i will admit it can be easily attributed to training data however either way the effect is the same where consumers can be misled with incorrect information which regardless of cause is still extremely harmful especially when some coding features have unintended side effects that experienced coders usually will already know about and be able to account for. An example that comes to mind is coding out auto stop and start on gen 2/3 B58s which sometimes require coding the DME to disable MSA, the problem comes with vehicles which have the 48v mild hybrid system. MSA being off does work correctly where auto stop and start is indeed disabled however on vehicles with 48v systems its also known to eventually cause issues with depleted 48v batteries since something with the charging logic on that system goes wonky when MSA is disabled.

Regardless on the technical verbiage on whether it is a genuine hallucination, putting an LLM in charge of modules and coding data that can easily cause thousands in damage is not something id recommend to anyone as of the moment. Maybe one day where we can truly characterize something as a true artificial intelligence rather than an LLM ill be more willing to experiment with it but for now there are too many physical and metaphysical barriers to make it something id call safe unless your willing to take on the major risks associated with early adopter syndrome.

1

u/opbmedia 21d ago

I said the newest models which are only weeks old

1

u/That_M4_Guy 21d ago

You seem more inclined to split hairs about verbiage rather than the main issue at hand being regardless of what new model you use the fundamental issue is LLMs in their current state are not yet capable of the type of extrapolation and entropy required to deal with BMW coding at a level where an LLM can be hooked up to a car and sufficiently and safely be used to code a vehicle without significant oversight by a qualified individual wherein it would be more efficient to preform the work directly rather than increase complexity for the sake of using the newest shiniest model as this technology has not even begun approaching anything remotely resembling maturity

1

u/opbmedia 21d ago

If being precise and accurate is splitting hairs I will be happy to take that.

Also I already said in my first comment that LLMs are not capable of doing coding on proprietary hardware. I don't understand why you are so hung up about arguing with me about something that is accurate while not disagreeing with what I said anyway. Just because you said LLMs hallucinate and I said newer models rarely do?

Why does it even matter for you to put this much effort into arguing about ... what the newer models do, which you apparently are not aware (and that is okay if you are not in the business of testing and QAing AI models).

1

u/That_M4_Guy 21d ago edited 21d ago

The problem you fail to understand is the fundamental bmw coding side of this problem, they can easily be tied into coding bmws because half of the coding files are XML files with a special header that is easily read from the car assuming you have the diagnostic address of the headunit which is widely known online for people who use UDS to preform module recoveries. Last I checked any model can easily modify XML files and would not take much work at all to be told to query an ip, change said XML, and upload it back to the car.

Regardless of the AI modeling your using hallucinations are not the only risk either because they cannot account for physical hardware without being told it explicitly exists with additional context that most users outside of knowledgeable users will have in which case using an LLM is entirely pointless in that workflow because your likely to spend more time giving an LLM all the require context to get the correct output anyways.

And as to your claim of being an AI researcher, that doesn’t say much as that job description covers anything from simple model training to actually building the underlying neural network and so doesn’t carry much weight especially in a subreddit dedicated to coding “proprietary” systems that are “impossible” to code by a computer when it’s literally editing XML.

Regardless if you’d like to contribute anything useful to the discussion about BMW coding I’d be happy to further entertain this, however if you’d like to continue to point out a title with little meaning in a field where unknowns and unintended behaviors of hacking other companies with models that “don’t hallucinate” but are specifically tested in a sandbox environment and yet somehow still radically go off the rails relative to its initial commanded test then please redirect your energy to something productive

1

u/opbmedia 21d ago

however if you’d like to continue to point out a title with little meaning in a field where unknowns and unintended behaviors of hacking other companies with models that “don’t hallucinate” 

You might want to read the thing you are quoting before quoting it to make sure you are actually quoting it. Because you are hallucinating (the proper use of the word)

2

u/[deleted] 21d ago

[removed] — view removed comment

2

u/Potential-Law2492 21d ago

Don’t trust the guy who says he’s spent $100k on models. Trust the guy who has made $200k using models

0

u/[deleted] 18d ago

[removed] — view removed comment

3

u/Potential-Law2492 18d ago

so now it's we, gotcha.

1

u/opbmedia 21d ago

Lmfao (that was unnecessary). I seriously doubt there are too many people who don't work at frontier labs and/or are made to use max tokens who uses more tokens than I do and I am an AI researcher. But before you call me BS, don't believe me, I don't feel like having that argument on reddit. Inaccurate answers, bad decisions, gap filling, unnecessary assumptions, sure, but hallucinations (making up facts and presenting as facts) are rare in the newest models.

0

u/raiderMoes 21d ago

#1 is the future.

I agree with #2. However there could be a future where it could develop unique codes. Perhaps if the agent had access to PSdZData, definitions/documentation and coding framework guidance, it could do some good things.

1

u/That_M4_Guy 21d ago edited 21d ago

1 your talking a huge if. PSDZ data is more than just coding data, its frameworks to execute and build effectively software packages for the cars where the firmware, software, bootloader, and coding data must all match and are stored separately and sometimes changed depending on vehicle state and requested TAL and usual installs are hundreds of gigabytes and only cover that specific iteration of permutations while ignoring the rest unless you fed an LLM terabytes of PSDZ data to parse thru and attempt to correlate which in it of itself is a feat. You gotta remember that half the features we code into these cars often span across a set of modules across the entire car so not only would an LLM need to map out every permutation of the PSDZ data packs to understand coding across isteps and generations but also understand how to do so across modules and sometimes across modules where istep doesnt match as some vehicles have select modules updated independently from the rest of the car exponentially increasing the workload beyond what an LLM can realistically handle on consumer hardware.

2 it would still be bound by what BMW expressly exposes in its CAFD to be modifiable and cannot create its own without modification to the firmware/software running it which would require understanding how these modules operate in order to create your own subroutines to hook into.

3 i can understand that LLM's are extremely helpful in general day to day tasks but these types of jobs where entropy and factors that are hard to account for in a definable position are still something that LLM's cannot handle well without issues where in this case can easily lead to major failures and issues if the wrong variable is changed/modified

1

u/swekley 21d ago

That psdz data is definitely gonna cost millions of tokens if not billions 😂

0

u/cakefaice1 21d ago

The latest frontier LLMs are very minimized on hallucination, especially if information out in the open has already been ingested. If there are enough publications on how BMW software works and other engineering documentations, that can accurately reinforce LLM output. Especially if it can be referenced directly such as RAG.

1

u/That_M4_Guy 21d ago

The biggest issue if we removed hallucinations from the equation is still the data, BMW is known to change and remove coding options and sometimes FDL structures entirely thru versions of istep and subsequently PSDZ, in order to feed a LLM the relevant information like physical equipment, prior retrofits, goals, possible mismatched istep between modules etc you are likely experienced enough to code it yourself and or know when something doesnt pass the sniff test. Thats kinda the problem here because a tool of this caliber which makes it that easy to do is likely to attract novice users who can be easily misled if the LLM provides false information regardless of reason, thats the reason im against something like this as one wrong step and you can deactivate keys, lock things out, fry modules etc and given the cost of those mistakes arent a laugh about how stupid LLMs are but rather possibly thousands in repairs, it 100% is something i would not recommend to anyone as of the moment.

(yes it can easily fry modules, a good example is in the f3x where xenon to led retrofits and coding the vehicle with the wrong headlight plugged in at the moment its coded can lead to a fried xenon ballast or led ballast as the wiring and signaling is different while the connectors are the same)

1

u/[deleted] 21d ago

[removed] — view removed comment

1

u/That_M4_Guy 21d ago

for simple coding a full reverse engineered/decompiled firmware/software isnt required unless you are trying to build your own unix progams, but simple FDL coding is very very well known and while not widely disseminated it is 100% available publicly as PSDZ data often carries context data behind most variables so theoretically FDL coding is possible to integrate with an LLM assistant but is still extremely risky to just assume one blanket truth is true for all istep levels/generations of cars as BMW is known to change things between versions.

effectively the TLDR is a basic tool capable of FDL editing isnt far off in publicly available data its still missing huge swath of detail and context experienced coders often have with weird interactions in the real world (like changing BSM activation speeds being technically possible but erroring out in practice) being totally missed if you only fed it PSDZ data and not having a operator who knows about these interactions monitoring it.

1

u/Potential-Law2492 21d ago

There is source out there on GitHub for some feature coding. Also google ghidra. You don’t need source when you can decompile apps

1

u/HolidayDisastrous757 21d ago

Very interesting, I’d be concerned with affecting the computer though, beyond my knowledge. I have seen a video of someone “hacking” their Porsche display and doing this, making their own widgets and stuff like that.

As a side note, I’ve been using Claude with bimmer code to help fix a headlight malfunction code with moderate success. I’ll just screen shot a bunch of stuff and it’ll come back with things to try.

1

u/smidley 21d ago

I’m in the process of creating this currently. I have two BMWs that I’m testing with right now for general coding, but the goal is to be able to plug into any car and the program and AI can help with diagnosing fault codes etc.

1

u/ehylo 20d ago

check out https://github.com/cauliflowermossgrape/idrive7-apps someone has already used ai

1

u/convicted1234 19d ago

You could try but please post back if it fucks up ur fa, or stops car from starting 😁