This invention relates to dihydropyrimidinones of the formula wherein X and R1 to R7 are as defined in the description, as well as pharmaceutically acceptable salts thereof. These compounds are BACE2 inhibitors and can be used as medicaments for the treatment or prevention of diseases such as diabetes.