Nissan Micra K12 - 2004 Micra 1.4 SE Codes (P0340) - findmak

Hi,
I have a 2004 micra (petrol) I just bought and I have noticed that when I start it from cold it idles erratic but is fine once it warms up, and also I noticed engine light in the dash which had the error code: P0340.
If I delete the error code once the car is warm it does not seem to come back on

I looked through the service history and in 2009 it was recommended to change the throttle body and boost sensor for the problem of "erratic idle from cold"

I am wondering is the problem due to the throttle body, camshaft sensor, or the chain being stretched or some other problem?

Nissan Micra K12 - 2004 Micra 1.4 SE Codes (P0340) - unthrottled

So the fault code suggests a problem with the camshaft position sensor circuit and you want to replace the thottle body? The problem could be anywhere in the circuit not just just the sensor itself.

Nissan Micra K12 - 2004 Micra 1.4 SE Codes (P0340) - findmak

The reason for thinking the thottle body was when looking through the service the nissan dealer recommended changing the thottle body back in 2009 for a similar if not the same problem.

What should I do?