Berberine hydrochloride is mainly used in the treatment of gastroenteritis, Shigellosis and other intestinal infections, with minor side effects. In order to better control the quality of berberine hydrochloride, homopiperonylamine was used as the starting material to obtain the related impurity 1 of berberine hydrochloride via Bischler-Napieralski reaction, dehydroaromatization reaction, oxidation reaction, oximation reaction and ring-closing reaction, and its purity was over 98% and its structure was confirmed by NMR and MS. At the same time, the causes and mechanisms of the impurities production were analyzed to provide guidance for improving the quality of berberine hydrochloride.