-
Notifications
You must be signed in to change notification settings - Fork 1k
Define default pins for Cygnet/Swan Serial2/3 #2826
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
Conversation
Add default pins for Serial2 instance. Signed-off-by: Zachary J. Fields <[email protected]>
variants/STM32L4xx/L433C(B-C)(T-U)_L443CC(T-U)/variant_CYGNET.h
Outdated
Show resolved
Hide resolved
variants/STM32L4xx/L433C(B-C)(T-U)_L443CC(T-U)/variant_CYGNET.h
Outdated
Show resolved
Hide resolved
Thank you for the correction! I will get them fixed. I think I went wrong, because I tested this out on hardware, and it appeared to work correctly. 🤯 Can you explain why it "worked" even though I was wrong, and where should I be looking to know if the standard or I don't want to continue to make these errors as we evolve our product. Thank you again! |
Of course it work but with LPUART1 not USART2 as you expected 😉
To sum up a pin (GPIO) can have several peripherals and also several instance of one type of peripheral. You can find in the datasheet all alternate functions of one pin: The PeripheralPins.c simply list all possible values per features. Arduino_Core_STM32/variants/STM32L4xx/L433C(B-C)(T-U)_L443CC(T-U)/PeripheralPins_CYGNET.c Lines 129 to 130 in f1432b0
In this case we found the 2 possibilities for serial Tx and the required alternate function (AF): As you already defined a dedicated PeripheralPins for your boards, I advise to simply kept the instance you want: - {PA_2, LPUART1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF8_LPUART1)}, // - A2
- {PA_2_ALT1, USART2, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_USART2)}, // - A2
+ // {PA_2, LPUART1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF8_LPUART1)}, // - A2
+ {PA_2 , USART2, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_USART2)}, // - A2 |
variants/STM32L4xx/L433C(B-C)(T-U)_L443CC(T-U)/variant_CYGNET.h
Outdated
Show resolved
Hide resolved
variants/STM32L4xx/L433C(B-C)(T-U)_L443CC(T-U)/variant_CYGNET.h
Outdated
Show resolved
Hide resolved
Signed-off-by: Zachary J. Fields <[email protected]>
I've updated to use |
variants/STM32L4xx/L4R5Z(G-I)Y_L4R9Z(G-I)Y_L4S5ZIY_L4S9ZIY/variant_SWAN_R5.h
Outdated
Show resolved
Hide resolved
…iant_SWAN_R5.h Co-authored-by: Frederic Pillon <[email protected]> Signed-off-by: Zachary J. Fields <[email protected]>
Add default pins for Serial2 instance.
Pull Request template
Please, Make sure that your PR is not a duplicate.
Search among the Pull request before creating one.
IMPORTANT: Please review the CONTRIBUTING.md file for detailed contributing guidelines.
Thanks for submitting a pull request.
Please provide enough information so that others can review your pull request:
Summary
This PR fixes/implements the following bugs/features
Explain the motivation for making this change. What existing problem does the pull request solve?
Validation
Code formatting
Closing issues
Fixes #xxx