Re: Tesla Model 3 Rear Drive Unit Hacking
Posted: Wed Aug 16, 2023 1:08 pm
What is the progress for now with TI Chip?
openinverter Community
https://openinverter.org/forum/
Is it possible that in the last month someone has figured out the Oil Pump LIN bus controls?davefiddes wrote: ↑Tue Mar 28, 2023 5:24 pm Ah. I misunderstood. The oil seal housing != oil pump.
The oil pump defaults to limp home mode if not plugged in to the Tesla SW. It's controlled over LIN using an as yet undocumented protocol. There are some captures to decode if anyone wants a simple(ish) project. It's down Damien's and my priority list due to the limp home behaviour.
The Model 3 drive units are cryptographically paired with the VCSEC. Without the appropriate handshake, the inverter won't budge. Ingineerix and EV Controls collaborated on breaking (or going around, still not clear to me) this handshake, but they aren't willing to share--the stated reason is: "obviously giving out code to bypass this would be bad as then once it gets out people can use it to steal cars". If it involved extracting key material from the onboard microcontroller in the inverter, then it'd also likely pose a legal challenge to share it, but I don't want to guess.briandilley wrote: ↑Sat Oct 21, 2023 4:30 am I have an interesting project that some friends and I are working on. We have a rear drive unit from a plaid that we'd like to get working without swapping any hardware, we want to control it with CAN and whatever methods the vehicle does so as stock.
so what about drive units that have never been used? do they use some standard key to start with or are the chips completely non fuctional/blank or have some sort of "starter firmware" until pairing?
The inverter's main microcontroller is a TMS320F28377D, which is its own architecture microcontroller/DSP (C28x) that dates back to the very early days of Ti--it's not ARM Cortex or AVR or anything "normal". It also has a security unit as well as encrypted flash, and code read/debug protection. There are ways to glitch out the code read and debug protection, but even doing that you're faced with trying to reverse engineer a firmware for an architecture with no tooling support and no real way to recover from a mistake.
If I was a betting man, this is where I'd place my bets on "Tesla legal has an issue with this". I'd much rather go for someting along the lines of an open-source solution which, if you have the original VESEC controller, you can use to "properly" respond to the challenges without having to reflash or anything nefarious. This would have two advantages: 1) much less legal stress 2) open for everyone to use, and of course the fact that you couldn't use it to somehow steal a car...briandilley wrote: ↑Tue Oct 24, 2023 3:52 am I’m happy to be very open with any solutions for getting this running - even if it means flashing the same firmware on every drive unit that we want to run.
My understanding, and I could be wrong, is that it is less a "pairing" and more a encrypted call and response between the drive unit and other computers in the car. No one has (open source anyways) broken the encryption. Even on the LDU and SDU, when the call and response was implemented, the commercial conversion solutions required reprograming the inverter to an earlier firmware without it.CatCommando wrote: ↑Tue Oct 24, 2023 2:34 am so what about drive units that have never been used? do they use some standard key to start with or are the chips completely non fuctional/blank or have some sort of "starter firmware" until pairing?
I ask because Im both curious and have a brand new zero mile M3 FDU in crate coming soon and Id love to be able to contribute to all this in some way or at least be a guinea pig for testing stuff.
if there is a default "pre paired" state that we could make a dump of, Id again love to help.
Yes. The TMS320F28377D has a whole security sub-system with a pair of secure zones for each of the two processors. There is a region of OTP to store unique identifiers and security keys and the device is capable of secure booting from flash. Tesla enables a large chunk of the security capabilities of the chip. They haven't locked out everything they could with the OTP security bits so you can still get access to almost the entirety of the chip including the JTAG interface provided you wipe the contents first. The only bits on my inverter I have been unable to access are the security key stores which figures.briandilley wrote: ↑Tue Oct 24, 2023 4:40 pm Does the inverter have OTP? Are there "things" on the inverter than uniquely identify it? "things" that are used as part of the handshake?
davefiddes wrote: ↑Tue Oct 24, 2023 5:18 pm when/if people get their cars stolen it might get quite spicy for those involved though.
haha - understandabledavefiddes wrote: ↑Tue Oct 24, 2023 5:36 pm I personally wouldn't want to argue with a bunch of lawyered up ex-Telsa owners and Tesla Inc should the worst come to the worst. If you are cool with that fair enough. I probably spent too long on Slashdot in the late 90s and early 2000s.
That, I don't know.briandilley wrote: ↑Tue Oct 24, 2023 4:40 pm Which CANbus does this call and response come across? Speaking from the inverters point of view there's a "Party CAN" and "Vehicle CAN". I'm currently doing a man in the middle on the vehicle CAN but wonder if I should also be on the party can.
My understanding is that was what several commercial suppliers were doing for their LDU.briandilley wrote: ↑Tue Oct 24, 2023 4:40 pm Also curious - Tesla allows for their hardware to be flashed to older versions of firmware?
I actually just purchased it on Ebay of all places (item 195819903318 if you wanna look), its yet to ship. the description says they ordered it and just never used it. in the photos and other items they have for sale it looks to be just some kind of luxury german car body shop in Miami or something as there is also a Hyundai motor in crate next to it. but the M3 FDU is still in a tesla branded crate still and its absolutely spotless so who knows really until I get it.P.S.Mangelsdorf wrote: ↑Tue Oct 24, 2023 12:42 pm There might be some sort of initial key provided when vehicles are programmed at the factory to tie the computers together, but I have no idea, it's way above my head.
Also, and feel free to not answer this, but how in the world did you get a zero mile drive unit? I thought Tesla didn't sell those? Did it "fall off a truck"?
your whole method of doing this is super cool, Id love for more details as ideally I too would want to control the unit unmodified via just canbus if possible.briandilley wrote: ↑Sat Oct 21, 2023 4:30 am
Once we got all of this working, we started by filtering out every single message... not allowing a single message to pass through either way.
You'll notice that the 1e5 message is very similar, but has different values in them. A counter of sorts still seems to be present in bytes 7 and 8, but bytes 1 and 2 have changed and where byte 3 was always 0 yesterday, it sometimes contains values today.
My guess is that there is some other message that is sent to or by the inverter that determines what the payload of 1e5 actually is.
Huh, that's interesting. I need to try to order some parts direct from Tesla and see what I can and can't get. Ebay is likely still the cheaper option, but if we can get some stuff directly from them, that'd be good to know.CatCommando wrote: ↑Wed Oct 25, 2023 7:16 am I actually just purchased it on Ebay of all places (item 195819903318 if you wanna look), its yet to ship. the description says they ordered it and just never used it. in the photos and other items they have for sale it looks to be just some kind of luxury german car body shop in Miami or something as there is also a Hyundai motor in crate next to it. but the M3 FDU is still in a tesla branded crate still and its absolutely spotless so who knows really until I get it.
as for Tesla not selling them Im not sure that is the case (maybe luckily for us), even in their own online part catalog this part model number 1120960-10-H is listed as "Sales Restriction - Unrestricted" instead of "Restricted" "Tesla only" or "over the counter" as other parts seem to be classified. strangely a re-manufactured version of the same unit IS marked as "Tesla Only"
it could just be a right to repair sort of thing where they let you have a whole unit simply to avoid legal trouble? IDK but id love to know why and if it would be easy to just get them new directly from tesla for projects or for reverse engineering other units.
in any case Im going to try and make a 3d scan of the thing while its still semi suspended in crate either using my iphone 15 and photogramertry or one of these Intel realsense depth cameras ive got laying around.
I just signed up with our business information... i'll report back on how it goesP.S.Mangelsdorf wrote: ↑Wed Oct 25, 2023 12:06 pm Huh, that's interesting. I need to try to order some parts direct from Tesla and see what I can and can't get. Ebay is likely still the cheaper option, but if we can get some stuff directly from them, that'd be good to know.
We've decided to table this for the time being. It doesn't seem like we're going to be able to control _any_ unit with the methods that we're attempting to use. At best we'd only be able to control a unit that we've pulled out of another vehicle, after scanning it while on the vehicle.CatCommando wrote: ↑Wed Oct 25, 2023 9:56 am your whole method of doing this is super cool, Id love for more details as ideally I too would want to control the unit unmodified via just canbus if possible ....
Not sure the status but my guess is that once they're ready, it would be highly feasible to use them in the Plaid unit, if the Plaid is truly just 2 M3 inverters, at least in form-factor. Even if they use more powerful switching electronics, if the structure is the same, they should be compatible from a control perspective.briandilley wrote: ↑Sat Oct 28, 2023 4:50 pm Given that they use the same inverter form factor - what's the status of the model 3 open inverter replacement board? How feasible would it be for us to use two of them to run the plaid drive unit?