the code you have there is for the exhaust cam sensor and chances are it is fulting intermitantly causing your idle fluctuations. Replace the sensor, clear the code and carry out a test drive to see if it reoccurs.
The sensor can be seen here as number 5........
Yes, as the fault description you have there is just a generic term describing a fault in the ignition system. The cam sensors are counted in the igntion side of the engine management, hence the fault description obtained from the scanner you're using. P1397 is a generic code which only relates to an exhaust cam sensor problem, which are very common on this engine.