Giovanni wrote:Depending on the peripherals clock 1200 bauds could be too low to handle using the 12bits resolution of the BRR register. You may reduce the peripherals clock in mcuconf.h, STM32_PPRE1 for USART3.
I am assuming you are using an STM32F4.
Giovanni
This was the issue, needed to divide the clock down more, so set STM32_PPRE1 to STM32_PPRE1_DIV8, this seems to work ok.
One thing that did come to mind, its not that intuitive to setup serial ports. My thoughts behind OS level drivers are that they should be well abstracted from the hardware, but i still found myself needing to find out what CR1,Cr2 and CR3 register bits were, so i could match them up to the defines in Chibios.
I'm sure you have seen the how a uart is configured using the STM32 plibs, having a configuration structure like that would be very helpful.
something like
/* Prepare USART parameters - 1200 / 9b / odd parity, no flow control */
SerialConfig.USART_Driver = &SD3;
SerialConfig.USART_BaudRate = 1200;
SerialConfig.USART_WordLength = USART_WordLength_9b;
SerialConfig.USART_StopBits = USART_StopBits_1;
SerialConfig.USART_Parity = USART_Parity_Odd;
SerialConfig.USART_HardwareFlowControl = USART_HardwareFlowControl_None;
sdStart(&SerialConfig);
In the low level driver the above configurations are placed into to correct CRx registers. To me this is alot more intuitive.
Thanks for the help
