STM32F105使用固件库的时候串口乱码解决方法

主要是根据你的外部晶振修改的。若使用的外部晶振是8M,可用如下方法修改。

将 "stm32f10x.h" 做如下修改,就能解决问题。

#if !defined  HSE_VALUE
#ifdef STM32F10X_CL  
  #define HSE_VALUE    ((uint32_t)8000000) /*!< Value of the External oscillator in Hz */
#else 
  #define HSE_VALUE    ((uint32_t)8000000) /*!< Value of the External oscillator in Hz */
#endif /* STM32F10X_CL */
#endif /* HSE_VALUE */

 

 

STM32F105 是互联型产品

启动文件是:startup_stm32f10x_cl.s

猜你喜欢

转载自blog.csdn.net/u013165704/article/details/78239131