The 2011 Repair Manual has a few procedures which may help.
To initialize1. CHECK AUTO OPERATION (FRONT SLIDING ROOF SYSTEM)
NOTICE: Make sure that initialization is completed before inspection.
HINT: When pressing the switch for 0.3 seconds or less, the roof glass moves but auto operation does not operate.
(a) Turn the ignition switch to ON.
(b) When the roof glass is fully closed, press the OPEN switch for 0.3 seconds or more. Check that the roof glass automatically tilt up until it is fully tilted upward.
(c) When the roof glass is fully tilted up, press the OPEN switch for 0.3 seconds or more. Check that the roof glass automatically slides until it is fully opened.
(d) When the roof glass is fully open, press the CLOSE switch for 0.3 seconds or more. Check that the roof glass automatically slides until it is fully closed.
(e) When the roof glass is fully tilted up, press the CLOSE switch for 0.3 seconds or more. Check that the roof glass automatically tilts down until it is fully tilted downward.
(f) When the auto operation is operating, check that pressing any sliding roof switch stops the roof glass operation.
1. INITIALIZE SLIDING ROOF DRIVE GEAR SUB-ASSEMBLY (FRONT SLIDING ROOF ECU) AND SLIDING ROOF DRIVE GEAR ASSEMBLY (REAR SLIDING ROOF ECU)
NOTICE: When replacing the sliding roof drive gear, the new sliding roof drive gear requires initialization. If a reset is not executed, the following functions do not operate: AUTO operation and jam protection function.
(a) Press the CLOSE switch and keep it pressed until the sliding roof motor stops, then release it.
(b) Press and hold the CLOSE switch again. After 10 seconds, the system enters Initialization mode.
(c) Keep the CLOSE switch pressed, and confirm that the sliding roof moves in the following sequence:
--- Full close (soft stop position) -> Full close (mechanical stop position) -> Full close (soft stop position)
(d) Release the CLOSE switch. Press and hold the CLOSE switch again within 5 seconds.
(e) Keep the CLOSE switch pressed, and confirm that the sliding roof moves in the following sequence:
--- Full close -> Full open -> Full close
(f) Release the CLOSE switch.
(g) The Initialization sequence is now complete.