Camshaft fault codes
Camshaft position sensor fault codes can be set due to a sticking / dirty VANOS solenoid. The easiest way to check it is to remove the VANOS solenoids and gently clean them with air. Reinstall and recheck. There is a software update for the ECM to address this problem in the future. The update provides a routine for the engine / VANOS solenoids to flush out debris.
...
Possible fault codes you may have if this is your problem:
P0340, P0345, P0365, P0390