Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cpu/stm32: Fix garbage on UART init #14426

Merged
merged 2 commits into from
Jul 15, 2020
Merged

Commits on Jul 15, 2020

  1. cpu/stm32: Fix gpio_init() / gpio_int_af()

    - Do not set an intermediate mode, prepare correct mode settings in a temporary
      variable
    - Consistently enabled the GPIO periph in gpio_init_af()
        - Previously, STM32 F1 did not require a separate call to gpio_init() prior
          to a call of gpio_init_af(), but other STM32 families did
        - Now, gpio_init_af() can be used without gpio_init() consistently
    - STM32 F1: Do not touch ODR for non input pins
        - For input pins, this enables / disabled pull up resistors. For outputs,
          this register should remain untouched (according to API doc)
    maribu committed Jul 15, 2020
    Configuration menu
    Copy the full SHA
    73c9161 View commit details
    Browse the repository at this point in the history
  2. cpu/stm32: Fix uart_init()

    - Make use of the fact that gpio_init_af() does not need prior call to
      gpio_init() for all STM32 families anymore and drop call to gpio_init()
    - Initialize the UART periph first, before initializing the pins
        - While uninitialized, the UART periph will send signal LOW to TXD. This
          results in a start bit being picked up by the other side.
        - Instead, we do not connect the UART periph to the pins until it is
          initialized, so that the TXD level will already be HIGH when the pins
          are attached.
        - This results in no more garbage being send during initialization
    maribu committed Jul 15, 2020
    Configuration menu
    Copy the full SHA
    aec9eb7 View commit details
    Browse the repository at this point in the history