UART with high speed baudrate fail

ChibiOS public support forum for topics related to the STMicroelectronics STM32 family of micro-controllers.

Moderator: RoccoMarco

Post Reply
vambwodonk
Posts: 15
Joined: Tue Oct 14, 2014 5:36 am

UART with high speed baudrate fail

Post by vambwodonk »

hi,
I used UART driver to AHRS with 230400 Baud, then my stm32f407 is fail.
when i try with slower baudrate like 115200, it worked again.
i try to brute force baudrate speed config until found faster baud magic number -> 169696.
If, i changed to 169697 UART fail again.

this is my UART config,

Code: Select all

static UARTConfig uart_cfg_COMM = {
      COMMtxend1,
      COMMtxend2,
      COMMrxend,
      COMMrxchar,
      COMMrxerr,
      169696,
      0,
      USART_CR2_STOP1_BITS | USART_CR2_LINEN,
      0
};


Any suggestion?
Is UART driver speed can't above 169696?
User avatar
Giovanni
Site Admin
Posts: 14892
Joined: Wed May 27, 2009 8:48 am
Has thanked: 1202 times
Been thanked: 996 times

Re: UART with high speed baudrate fail

Post by Giovanni »

Hi,

There could be an integer overflow, you cannot set any baud rate, it must be physically achievable from the system clock using the USART prescaler.

I suggest to enable assertions in chconf.h, in case of an invalid value an assertion should be triggered.

Giovanni
Post Reply