cpu/stm32: Fix garbage on UART init [backport 2020.07] #14426#14529
Merged
miri64 merged 2 commits intoRIOT-OS:2020.07-branchfrom Jul 15, 2020
Merged
cpu/stm32: Fix garbage on UART init [backport 2020.07] #14426#14529miri64 merged 2 commits intoRIOT-OS:2020.07-branchfrom
miri64 merged 2 commits intoRIOT-OS:2020.07-branchfrom
Conversation
- 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)
- 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
Member
|
@maribu Since the format is different: do you know about |
Member
Author
No, I didn't. Thanks for the pointer! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Backport of #14426
Contribution description
cpu/stm32: Fix gpio_init() / gpio_int_af()
cpu/stm32: Fix uart_init()
Testing procedure
gpio_init()should still work for ST32F1 and STM32Fx (x != 1)Note: It should be sufficient to test with STM32F1 and one of the other STM32 not belonging to the STM32F1 family
Issues/PRs references
Fixes #8045