Broken! Busted! Before Giving Up, Give It A Go And Try To Fix It

Hi my name is Amadeusz, and I am currently completing my university placement year as a Software Engineer here at Zircon. In addition to computer technology, I am also a fan of fast cars and motorsports. For this article I would like to tell the story of how this hobby sparked my interest in software engineering for embedded systems.

How Did It All Start?

After doing well in my A level exams, I wasn’t sure on where I wanted to go or what I would be good at. I had so many potential ideas I decided to take some time to mull things over, so to keep myself busy I relocated and found myself a fulltime job. After a few years of employment I decided to treat myself to a nice car, a BMW from a local auction, which is where our story begins.

It took less than a couple of hours for my ‘treat’ car to start throwing errors at me. A quick inspection highlighted that the source of my woes was the left side headlight that had stopped working. Naively hoping for burnt bulbs I got hold of some replacements, but it was no help at all. Not one of the local garages could provide me with a solution, instead directing me to a BMW authorised garage. Taking this advice I booked my car in for an inspection, however the resulting quote I was given exceeded a third of the value of the car itself.

My nature wouldn’t simply let me accept such a high price. Having asked for some clarification of the problem, I found myself presented with two options:

  1. Give up and pay for the repairs
  2. Try finding a solution for the problem itself

“If someone else can do it, surely I can do it too. Nothing is impossible” was the thought that pushed me to take my car back from the garage and begin my research. Unsurprisingly the garage wasn’t too keen on sharing their knowledge on the procedure, and I quickly found that no one within the UK had managed to solve this problem. Unable to find any DIY instructions online I turned to international forums, where I was advised to acquire a number of books. I was able to glean the information I needed but only after they were translated from German.


For me the most challenging step of the repair process was understanding the functionality and architecture of the CANBUS, a vehicle bus standard that allows microcontrollers and devices to communicate with each other in applications without a host computer. I ended up spending a lot of time figuring out how I could interact with the CANBUS in my car using my laptop and a simple OBD interface.

We can imagine CAN as a multi-master serial bus on the car, used for connecting electronic control units/nodes, such as the engine/transmission ECU or the Light Control Unit (LCU). There have to be two or more nodes on the CAN network, there is no need for a hosting machine. The complexity of the node can range from a simple I/O device up to an embedded computer with a CAN interface and sophisticated software. The node may also be a gateway allowing a standard computer to communicate over USB or Ethernet port to devices on a CAN network. In the automotive industry this node is referred to as the ON Board Diagnostic (OBD) port, and it allowed me to connect to the CANBUS of my car.

The First Line Of Code

With knowledge of the CANBUS finally under my belt the next step was to get my hands on an OBD2 K+DCAN cable, which supports read/write data transfer of specific diagnostic messages using CANBUS protocol. While waiting for the cable to arrive I began my preparation, reading about its capabilities and what modes it can support.

It was during this prep time that I stumbled across something called ‘UART’, a programing library used to read and write to the data frame of the CAN messages directed to different nodes. Initially I had no idea what all of the introduced variables were for. I found myself getting lost in the ‘nested loops’ and confused by ‘arrays’, but I refused to give up. I immersed myself in YouTube tutorials and C programming by Tony Royce until finally it began to make sense.

To avoid injuring my car further I felt it wise to practice writing a few simple programs in C using a TRICORE compiler as a means to develop my programming skills.

Fixing The Problem

With the cable in hand and knowledge in place, I connected to the OBD port and managed to send a request to the Light Control Module (LCM). In return I was presented with a long piece of data, encrypted in hexadecimal values, which typically I was unable to understand right away. After yet another round of research and investigation I realised that a data interpreter, such as HEX Visualiser, and a database translator called NCS Expert were required to successfully interpret and modify the data.

Having run the data through these tools within the space of a few hours, I had figured out that the main checksum responsible for the faulty headlight had triggered and cut the circuit. It turns out that BMW implement this method to prevent vehicles from catching fire as a result of incorrect resistance bulbs or damaged wiring. In the case of my car the previous owner had fitted aftermarket LED bulbs, which caused the problem as LEDs have a much lower resistance than standard H8 wire bulbs. He sold the car at auction as it would not pass an MOT.

Blank Space

In Car Diagnostics

Going Further

Having found a solution to my problem I decided to help fellow BMW owners avoid hefty repair bills and posted a set of simplified DIY instructions to a popular forum. For a brief period I even offered a service to fix the issue for other owners, receiving 17 requests on just the first day which I think demonstrates just how frequent these cases are. I decided to stop this service after a short period as the procedure required using my car as a socket for the LCM module.

Knowing that I was capable of interacting with my cars ‘computer’, when my Beemer didn’t feel as fast or as responsive as it had done initially I felt it was time to up the game a little bit. Having successfully accessed and edited the memory data of the LCM, I was confident that I could do the same with the ECU to increase the power output of the engine.

I really enjoyed the time spent working on my car, and helping others in the same seemingly hopeless situation gave me a feeling of accomplishment and satisfaction. However, it was a private message from one of the forum users telling me that I could be an embedded engineer if only I wanted to, that really triggered a spark. It made me realise that software engineering is more than typing blocks of script. It can be an opportunity to express passion and creativity.

A few months later I quit my job and began applying for university courses.