The invention relates to compounds of formula (I) Formula (I) wherein X, Y, R1, R2, (R4)n, and (R5)m are as defined in the description, and to pharmaceutically acceptable salts of such compounds. These compounds are useful as calcium T-channel blockers.