2006 Titan SE Crew Cab 4x4 270,000 miles. Not sure about the code because my light was always on because of the infamous cracked exhaust manifold but here's my story.
Struggled with the same symptoms for about 2 years. Never was stranded but several times thought I was. In the last days would rapidly turn key from run to start 10 to 20 times before it would engage starter.
After watching several DiY on the "tube" finally got a new starter and took 3 hours to replace it. Starter is under intake manifold! Plenty of knowledge on here about this. Never checked with shop to see price but it's surely $$$. I purchased starter from the "prime" store for $100. Gasket set from "*bay" you'll also need a little fuel line removal tool. This is the video I watched. Very thorough.