STM32F429 lead to incorrect serial clock can not properly send and receive

Before long ago made himself block F4 board, the design principle Figure did not go to the official reference, read the manual after the start, came back to finish the test board received at PC serial port found all garbled, tried several waves special rates also did not correctly received, serial code is the official reference routine, there should not be a problem. So the clock to locate, download the official reference designs, found a clock that is 25M external reference clock, and I was 8M, open the header file stm32f4xx.h, find the macro is defined as follows, my chip is F429 , according to the official definition of the external clock source is 25M

 

Modify the actual clock source 8M follows:

After compiling according to the above modifications, PC still can not receive the correct data, view system_stm32f4xx.c file, locate the following macro division factor, the division factor is 25,

Such division can not be correctly obtained 1M, 8 modified so as to enable correct frequency-divided clock obtained 1M, compiled test. Also note that the two documents mentioned above default can not be modified, it is necessary to attribute a file directory in the corresponding file, remove the read-only attribute can be modified.

 

End ------------ ------------ restore content

Guess you like

Origin www.cnblogs.com/DPShadow/p/12043785.html