wrong baud rate (yet another thread...)

I try to use the NUCLEO F302R8T6 board which I initialized using a start-up.c – file which was generated by the STM32F30x_Clock_Configuration_V1.0.0.xls tool. I changed the NUCLEO board configuration accordingly to the UM1724 User manual for STM32 Nucleo boards page 22 5.7.1 -> MCO from STLINK to use the 8 MHZ produced by the on board quartz. The system_stm32f30x.c file (which I renamed into “system_stm32f3xx.c” to make it compatible with the KEIL CMISS package) contains the following definition:

Unfortunately the prescaler option of the RCC_MCOConfig command in combination with RCC_MCOSource_PLLCLK has no effect on the output frequency (therefore an oscilloscope with a high sample- frequency is required).

Regarding CLIVE1’s recommendations:

A: Check the bit clock you see on the USART output by outputting a continuous stream of 0x55 characters.
-> I did so and found that the baud- rate is twice as high as defined.

I did a few experiments by changing the startup.c configuration regarding the APB1 & APP2 prescaler values.

I summarized my result in the following table:

APB1 APB2 Multiplier X (real baudrate = x* baudrate defined)

2 1 0.5

2 4 2

2 2 1

4 8 2

4 2 0.5

4 4 1

Looks like that both APB1 and APB2 must have the same prescaler to get the defined baudrate. I read the reference and also the datasheet but I didn’t found neither an explanation for the obtained result. I would be very happy if someone would explain those findings.

To make sure no strange files of different library’s (e.g. older versions from keil and newer version from SPL) are mixed together I made a new project containing only such header files which come together with the standard peripheral library (latest version). No effect. Then I checked the EXCEL clock configuration tool and found that it produced in the wizard mode at least for f30x and f37x controller’s wrong entries for the rcc Registers (see the table in my first post PLLMUL must be 9 and PREDIV must be 1 to reach 72 MHz). In the expert mode it seems to produce more consistent parametrization however I in the case of the f302 it is still as shown in the table of my previous post. Probably it is necessary to check each register entry using reference manual.