diff options
-rw-r--r-- | os/hal/platforms/STM32/USARTv1/uart_lld.c | 2 | ||||
-rw-r--r-- | os/hal/platforms/STM32/USARTv2/uart_lld.c | 8 | ||||
-rw-r--r-- | os/hal/platforms/STM32/serial_lld.c | 4 | ||||
-rw-r--r-- | readme.txt | 1 |
4 files changed, 8 insertions, 7 deletions
diff --git a/os/hal/platforms/STM32/USARTv1/uart_lld.c b/os/hal/platforms/STM32/USARTv1/uart_lld.c index b64230463..90a59ac95 100644 --- a/os/hal/platforms/STM32/USARTv1/uart_lld.c +++ b/os/hal/platforms/STM32/USARTv1/uart_lld.c @@ -196,10 +196,10 @@ static void usart_start(UARTDriver *uartp) { else
cr1 = USART_CR1_UE | USART_CR1_PEIE | USART_CR1_TE | USART_CR1_RE |
USART_CR1_TCIE;
- u->CR1 = uartp->config->cr1 | cr1;
u->CR2 = uartp->config->cr2 | USART_CR2_LBDIE;
u->CR3 = uartp->config->cr3 | USART_CR3_DMAT | USART_CR3_DMAR |
USART_CR3_EIE;
+ u->CR1 = uartp->config->cr1 | cr1;
/* Starting the receiver idle loop.*/
set_rx_idle_loop(uartp);
diff --git a/os/hal/platforms/STM32/USARTv2/uart_lld.c b/os/hal/platforms/STM32/USARTv2/uart_lld.c index 276aa7e8d..e35b386c5 100644 --- a/os/hal/platforms/STM32/USARTv2/uart_lld.c +++ b/os/hal/platforms/STM32/USARTv2/uart_lld.c @@ -93,7 +93,7 @@ UARTDriver UARTD3; *
* @return The error flags.
*/
-static uartflags_t translate_errors(uint16_t isr) {
+static uartflags_t translate_errors(uint32_t isr) {
uartflags_t sts = 0;
if (isr & USART_ISR_ORE)
@@ -154,7 +154,7 @@ static void usart_stop(UARTDriver *uartp) { * @param[in] uartp pointer to the @p UARTDriver object
*/
static void usart_start(UARTDriver *uartp) {
- uint16_t cr1;
+ uint32_t cr1;
USART_TypeDef *u = uartp->usart;
/* Defensive programming, starting from a clean state.*/
@@ -183,10 +183,10 @@ static void usart_start(UARTDriver *uartp) { else
cr1 = USART_CR1_UE | USART_CR1_PEIE | USART_CR1_TE | USART_CR1_RE |
USART_CR1_TCIE;
- u->CR1 = uartp->config->cr1 | cr1;
u->CR2 = uartp->config->cr2 | USART_CR2_LBDIE;
u->CR3 = uartp->config->cr3 | USART_CR3_DMAT | USART_CR3_DMAR |
USART_CR3_EIE;
+ u->CR1 = uartp->config->cr1 | cr1;
/* Starting the receiver idle loop.*/
set_rx_idle_loop(uartp);
@@ -268,7 +268,7 @@ static void uart_lld_serve_tx_end_irq(UARTDriver *uartp, uint32_t flags) { * @param[in] uartp pointer to the @p UARTDriver object
*/
static void serve_usart_irq(UARTDriver *uartp) {
- uint16_t isr;
+ uint32_t isr;
USART_TypeDef *u = uartp->usart;
/* Reading and clearing status.*/
diff --git a/os/hal/platforms/STM32/serial_lld.c b/os/hal/platforms/STM32/serial_lld.c index 841b9b386..92ef8c5ef 100644 --- a/os/hal/platforms/STM32/serial_lld.c +++ b/os/hal/platforms/STM32/serial_lld.c @@ -222,11 +222,11 @@ static void usart_init(SerialDriver *sdp, const SerialConfig *config) { u->BRR = STM32_PCLK1 / config->sc_speed;
/* Note that some bits are enforced.*/
+ u->CR2 = config->sc_cr2 | USART_CR2_LBDIE;
+ u->CR3 = config->sc_cr3 | USART_CR3_EIE;
u->CR1 = config->sc_cr1 | USART_CR1_UE | USART_CR1_PEIE |
USART_CR1_RXNEIE | USART_CR1_TE |
USART_CR1_RE;
- u->CR2 = config->sc_cr2 | USART_CR2_LBDIE;
- u->CR3 = config->sc_cr3 | USART_CR3_EIE;
u->SR = 0;
(void)u->SR; /* SR reset step 1.*/
(void)u->DR; /* SR reset step 2.*/
diff --git a/readme.txt b/readme.txt index 03f4d8fae..e4b631a57 100644 --- a/readme.txt +++ b/readme.txt @@ -86,6 +86,7 @@ 3591321)(backported to 2.4.3).
- FIX: Fixed different redefinition for __main_stack_end__ symbol (bug
3591317)(backported to 2.4.3).
+- FIX: Fixed errors in STM32F0xx UART driver (bug 3589412).
- FIX: Fixed workaround for errata in STM32F4-A devices (bug 3586425)
(backported to 2.4.3).
- FIX: Fixed error in palWritePad() macro (bug 3586230)(backported to 2.2.10
|