现在库版本是1.3吧,可以测试多个数据看看十六进制显示,如果是固定的错误估计和我的情况一样
固件库默认你的HSE板上晶振为25MHZ,大多数人用的估计是8Mhz,我就是,然后没有管,系统初始化的时候预分频系数什么也就对应错了
造成串口输出的数据是固定的乱码
在stmf4xx_conf.h里面从新配置一下HSE
[mw_shl_code=c,true]#if defined (HSE_VALUE)
/* Redefine the HSE value; it's equal to 8 MHz on the STM32F4-DISCOVERY Kit */
#undef HSE_VALUE
#define HSE_VALUE ((uint32_t)8000000)
#endif[/mw_shl_code]
原来stm32f4xx.h里面设置
[mw_shl_code=c,true]#if !defined (HSE_VALUE)
#define HSE_VALUE ((uint32_t)25000000) /*!< Value of the External oscillator in Hz */
#endif /* HSE_VALUE */[/mw_shl_code]
|