The obvious first guess is the fuel pump is going bad.
Of course, it could also be something electrical or a problem with the PCM itself. This is one of those things where you'll likely have to take it for a proper diagnostic. Codes are all well and good, but a good mechanic or the dealership can read the historical files and/or view all the relevant live data to see what component is causing the issue.