P0340 on a Subaru: Causes, Fixes & Repair Cost
⚠️ Severe · not recommended to drive
The engine may not start, or it may stall while driving, so have the car towed if it won't start.
What P0340 means on a Subaru
On a Subaru, P0340 means the engine computer is getting no signal or a bad signal from the camshaft position sensor. Without camshaft position, the computer can't time fuel injection correctly, and the engine may refuse to start or may stall.
Is P0340 common on Subarus?
P0340 shows up on Subarus with higher mileage, often Outback, Forester, Impreza, and Legacy models. Subaru's boxer engines have a camshaft position sensor on each cylinder head, and these sensors fail with age and mileage. Oil leaks or wiring damage near the timing covers can also trigger it.
Commonly reported on: Outback, Forester, Impreza, Legacy.
Symptoms
- Check engine light is on
- Engine cranks but won't start
- Engine stalls while driving
- Rough running or loss of power
Common causes
- most common: Failed camshaft position sensor
- common: Damaged wiring or connector at the sensor
- common: Oil contamination on the sensor
- less common: Timing chain or timing belt issues
How to fix it
| Fix | DIY? | Typical cost |
|---|---|---|
| Replace the camshaft position sensor | Yes | $50–150 |
| Repair damaged sensor wiring or connector | Mechanic | $100–250 |
| Have a mechanic check the timing belt or chain and its components | Mechanic | $600–1200 |
Frequently asked questions
Other common Subaru codes
P0340 on other brands
Looking for the full (non-brand-specific) guide? See the P0340 code page →
Browse all Subaru codes: Subaru hub →
Updated 2026-08. This page is informational and not a substitute for professional diagnosis.