There is no movement in the system, but it is on the verge of slipping, so the force exerted by static friction is at its maximum.
Mass 2:
Mass 1:
We plug in what we just got for T into the equation for T from Mass 2 and solve for