2014-02-12 05:42 AM
Dear all,
I am using the STM32F429i-Discovery, and I experience some problems with UART communication: received symbols are differents from TX. Discussing with some colleagues points out the baudrate might be in charge, so I have two options: - using a scope to determine the real baudrate - ensure the clock is correcly configured For the second option, I was looking for the SystemInit and SystemCoreClock configuration. It seems the related file is system_stm32f4xx.c In the differents example projects I noticed 2 versions of this file, one ''20-September-2013'' (ST lib V1.0.0), the other ''11-November-2013'' (ST lib V1.0.1). For both of them, ''This file is customized to run on STM32F429I-DISCO board only '' They are quite differents, for PLL_M, M P and Q. I know the HSE_frequency is the crystal frequency (8MHz). What should be the correct PLL values ? Thanks & Regards2014-02-12 09:12 AM
Use the system_stm32f4xx.c from the Project Template directory.
STM32F429I-Discovery_FW_V1.0.1\Projects\Template\system_stm32f4xx.cPLL_M needs to be 8 for the 8 MHz crystal, and the project must define HSE_VALUE of 8000000Clone the project appropriate for the tool chain you use.2014-02-13 08:04 AM
Hi Clive,
Thanks for your advice. Tried with the good file, but the problem still. I am using a RF module connected to the UART, I am able to receive data and compare the data send to the received data. The LSB is correct, but not the MSB. If you have some extra advice... Regards2014-02-13 09:26 AM
I don't really have enough insight into what specifically you are doing, and how.
For MSB issues, I might guess you're using parity. For 8E1 or 8O1 you need to program the USART in 9-bit mode, as the ninth bit is the parity, while for 7E1 or 7O1 you need to program the USART in 8-bit mode.2014-02-14 06:47 AM
No parity for the UART
I tried generating a proper ''system_stm32f4xx.c'' with the excel sheet, but the characters read from the buffer aren't the same as the characters I have send. I have pointed out something strange with the baudrate: I have to set the UART a different value than the data bitrate. For example, setting the baudrate @ 115200 give wrong data in the RX buffer. I changed to 9600, same thing, so I tried with non-standard bitrate and found a working bitrate. Seems the UART clock isn't well configured.2014-02-14 07:07 AM
Sounds like the HSE_VALUE is wrong, is the ratio for the working baud rate 1:3.125 ?
STM32F429I-Discovery_FW_V1.0.1\Projects\Template\stm32f4xx_conf.h...
/* Define to prevent recursive inclusion -------------------------------------*/
#ifndef __STM32F4xx_CONF_H
#define __STM32F4xx_CONF_H
#if defined (HSE_VALUE)
/* Redefine the HSE value; it's equal to 8 MHz on the STM32F429I-DISCO Kit */
#undef HSE_VALUE
#define HSE_VALUE ((uint32_t)8000000)
#endif /* HSE_VALUE */
...