AnsweredAssumed Answered

UART framing error on STM32F0 device

Question asked by Gates on Mar 19, 2015
Latest reply on Nov 25, 2015 by kaminski.gregorio


I am currently using STM32F030R8T8 for communication purpose (RS485).
The functions I wrote to communicate seems to be working fine but most of the time the communication stops and refuses to restart.

I implemented the "HAL_UART_ErrorCallback" callback function to understand the bug. When the debugger stops in this callback, uart status is the following : "HAL_UART_ERROR_FE".


The only way I found to make the communication work again is to power off and on the microcontroller but this is not acceptable for the system I am currently developping.


My question is the following : How can I reinitialize UART softwarly from the "HAL_UART_ErrorCallback" callback function ?


I have already tried the following solutions but any of them are working :


-         -  Setting the error code to "HAL_UART_ERROR_NONE"

-          - Setting the uart state to "HAL_UART_STATE_READY"

-          - Calling "HAL_UART_DeInit" and then "HAL_UART_Init" functions


About framing error :

My microcontrroller is communicating with another STM32F030R8T8 that has exactly the same program (and so, the same clocking configuration). I use internal oscillator with no PLL and the frequency is low. Can I resolve my framing error by activation the PLL to give my microcontroller more accurency (my uart baudrate is 9600) ?