Hi,
Is the P0171 the only code you are getting? When you checked for vacuum leaks, did you check the intake? Is the fuel pressure within the manufacturer's spec? Low pressure can also cause a lean mixture.
I have one last question (sorry for so many). Do you have a live data scan tool? If you do, check the short-term fuel trims and also confirm the coolant temp sensor is reading correctly.
If you look at the attached pic, it shows the possible issues. If you haven't, check fuel pressure first. Also, confirm there are no vacuum leaks in the air intake tube between the airbox and throttle body and the intake manifold. Also, if you have an engine vacuum gauge, let me know the reading at idle.
Here is a link that explains how to check for a vacuum leak. Note that the smoke test shows leaks in the EVAP, but can miss something in the air inlet or intake. Also, check the PCV to see if there is an issue there as well.
https://www.2carpros.com/articles/how-to-use-an-engine-vacuum-gauge
https://www.2carpros.com/articles/how-to-check-fuel-system-pressure-and-regulator
If you look through the remaining pics, they provide diagnostic procedures. They cover everything that can cause this code.
If you haven't already, confirm fuel pressure and check again for a vacuum leak. Here are the manufacturer's specifications for fuel pressure. If you don't have fuel pressure gauge, most parts stores will lend one to you.
2007 Toyota Corolla L4-1.8L (1ZZ-FE)
Pressure, Vacuum and Temperature
Vehicle Powertrain Management Fuel Delivery and Air Induction Fuel Pump Fuel Pressure Specifications Pressure, Vacuum and Temperature
PRESSURE, VACUUM AND TEMPERATURE
Fuel Pressure .................... 304 to 343 kPa (3.1 to 3.5 kgf/sq.cm, 44 to 50 psi)
Fuel pressure for 5 minutes after the engine has stopped .................... 147 kPa (1.5 kgf/sq.cm, 21 psi) or more
_________________________________
Let me know what you find or if you have other questions.
Take care,
Joe
See pics below.
Images (Click to make bigger)
Friday, April 9th, 2021 AT 6:30 PM