Modify the hardware setup code for Stm32f4 series