I found inside my AFM (ADM ST185) that the metal coating on the printed circuit board (inside the AFM) was corroded - kept getting AFM errors and random non-running episodes (died about 3km from home) after I built the motor and was out testing it.
I ended up bypassing the corroded section with some fine wire (I cut up some flat IDE cabling salvaged out of an old PC) and carefully soldered it between the connector and other parts in the AFM. AIT sensor is also in the AFM and one of wires connecting it was corroded.
Mind you, your problem could just be the connector/plug being loose on the AFM.
No idea about the O2 sensor but on my car, the plug connecting it is missing the locking tab and it is in a spot that gets fairly warm.
Bookmarks