tommy77, any chances you ran out of fuel recently ? they could have triggered the code (System too lean), if so just disconnect battery for 1 minute (or remove 15A EFI fuse instead) to reset the ECU.
more on P0171/P0172 here:
http://www.camrystuff.com/manuals/Gen4/Diagnostics.pdf
page 84.
Possible trouble areas:
-Gas leakage on exhaust system
-Air intake (hose loose)
-Fuel line pressure
-Injector blockage
-Heated oxygen sensor (bank 1 sensor 1)
-Manifold absolute pressure sensor
-Engine coolant temp. sensor
You may have leaks on the intake vacuum or one of vacuum hoses around engine (EGR system) is leaking vacuum.
Does the engine run rough at idle ? your fuel injectors might be clogged/dirty, so ECU is administering much more fuel to keep system running closest to ideal theoretical value. when have you replaced the fuel filter last time ? have you tried adding Chevron Techron to tank ?
have you checked your flex pipe for cracks ? that would be an exhaust leak tricking your rear o2 sensor to report false values to the ECU.
you may need some obd2 scanning tool which will show you fuel trims at different conditions. also such tools could tell you under what conditions the code was triggered (reading the Freeze Frame).
it would also tell you what other (also pending) codes you may have. or you would be able to watch o2 sensors voltage outputs and seeing much more live data from ECU.