Hi everyone, I need help diagnosing a rough idle/misfire issue on my EU-market BMW E36.
The car was originally a **316i with the M40B16 engine**. After some heat cycles, the head gasket blew, so I bought an **M40B18 engine** that came with its own ECU and ICV from a donor car, supposedly a 318i or 318is.
When I installed the M40B18 engine, I originally kept the **316i ECU, 316i AFM, and 316i ICV**. With that setup, the car actually ran fine. Later, the original 316i ECU failed, so I had to switch to the **318 ECU that came with the M40B18 engine**.
That’s when the problem started.
With the **318 ECU** installed, but still using the **316i AFM and ICV**, the car ran very rough and sometimes stalled. A lot of people told me I needed to use a 318i/318is AFM, so I replaced the AFM with one from a donor car. Unfortunately, the problem stayed the same.
The current symptoms are:
* Rough idle, especially after idling for around 3–4 minutes
* Sometimes stalls at idle
* Exhaust popping while driving
* Occasional popping/backfire sound from the intake
* Feels like misfiring/hesitation
* Problem happens even after replacing multiple parts
I replaced the intake boot/hose with a used one in good condition with no visible cracks. The issue did not change.
Recently, I also replaced the **L-shaped ICV** with one from a 318 donor car, but the problem is still exactly the same.
Every mechanic I asked kept telling me the AFM was bad. Because of that, I went back to the parts seller multiple times and exchanged it. At this point, I have tested **6 different AFMs**, and none of them fixed the issue.
So far, the parts/setup I tested:
* M40B18 engine installed in original 316i chassis
* 316i ECU + 316i AFM + 316i ICV = car ran fine before ECU failed
* 318 ECU + 316i AFM/ICV = rough idle/stalling
* 318 ECU + 318 AFM = still rough
* 318 ECU + 318 AFM + 318 L-shaped ICV = still rough
* Replaced intake hose/boot with good used one = no change
* Tested 6 different AFMs = no change
At this point, I’m seriously considering repairing the original 316i ECU and just running the car as a 316i setup on the B18 engine, since that setup actually worked before the ECU died.
The only thing I have not replaced yet is the O2/lambda sensor. I don’t want to keep throwing parts at the car unless there’s a real reason to suspect it. I’m also thinking about vacuum leaks, but I already replaced the main intake boot. I’m not sure if there are other hoses or hidden vacuum lines on the M40 that could cause this kind of issue.
My questions:
- What vacuum hoses should I check besides the main intake boot?
- What should I test next before wasting more money on parts?
I’ll attach a video showing the idle issue.
Any advice from people familiar with M40 engines or E36 316i/318i swaps would be really appreciated. I’m exhausted from chasing this problem and I don’t want to keep replacing random parts without finding the real cause.