These codes indicate an issue with the camshaft position sensor A and B on bank 1. If replacing the sensor hasn't solved the issue, it's likely a problem with the wiring. Here is a list of other possible causes.
P0340 TOYOTA - Camshaft Position Sensor 'A' Circuit Bank 1
Read more: https://www.autocodes.com/p0340_toyota.html
Take the AutoCodes.com automotive tests and turbo-charge your car repair knowledge