#347 Errors in STM32F0xx UART driver


The STM32 USARTv2 driver has various errors in hal/platforms/STM32/USARTv2/uart_lld.c:

1. Various bits in CR2 and CR3 can only be written while the UART is disabled. Therefore the order of updating CR1..CR3 in uart_start() needs to be reversed, to do CR1 last.

Some 16-bit values need to be 32-bit to reflect the underlying register sizes:

96: translate_errors() should probably take a 32-bit parameter

156: usart_start() - cr1 to be 32-bit

271: serve_usart_irq() - isr to be 32-bit

Possible coding efficiency:
177 usart_start() - should be no need to reset pending interrupts; done by disabling UART.

Annotated file attached


  • steve

    steve - 2012-11-23

    File as used by me - annotated

  • Giovanni Di Sirio

    • priority: 5 --> 4
    • status: open --> open-accepted
  • Giovanni Di Sirio

    Will be fixed in 2.5.1unstable, fixed in trunk.

  • Giovanni Di Sirio

    • summary: Errors in UART driver --> Errors in STM32F0xx UART driver
  • Giovanni Di Sirio

    • milestone: 953057 --> 2.4.0
    • status: open-accepted --> open-fixed
  • Giovanni Di Sirio

    Will be fixed in 2.4.3stable too, fixed in repository.

  • Giovanni Di Sirio

    • status: open-fixed --> closed-fixed

Log in to post a comment.

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:

No, thanks