I switched out the camshaft position sensor with
the old crankshaft position sensor, assuming that since replacing the later, the problem wasn't fixed.
Stalling at idle could be due to a faulty mass airflow
sensor, faulty camshaft or
crankshaft position sensors, worn spark plugs, wires or defective ignition coil (s), inadequate fuel delivery or pressure (clogged fuel filter, injectors, faulty fuel pump or pump circuit), contaminated or
old gasoline, defective throttle
position sensor, faulty idle air control valve, leaks in the EGR system, intake vacuum leaks, and so forth.