-
Notifications
You must be signed in to change notification settings - Fork 7.7k
fix(uart): always applies the user selected UART Clock Source #11747
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
base: master
Are you sure you want to change the base?
Conversation
The problem affects more often SoC that supports REF_TICK UART Clock source (ESP32 and ESP32-S2). The implementation has an issue retated to when the user doesn't set any specific UART source clock and the UART changes its baudrate from lower than 250,000 to higher (ESP32/ESP32-S2). The bug is about not changing the clock source to something faster (APB) in order to get correct clock resolution in order to reach closer enough to the new baudrate selection. The new behaviour (which was working before) is that is the application doesn't set any specific UART clock rate, it shall follow a rule: ESP32/ESP32-S2 will use REF_TICK whenever baudrate is lower than 250,000. Other SoC will use XTAL. ESP32/ESP32-S2 will change UART Clock Source to APB when baudrate is higher than 250,000 for a better final result. If the user application explicitaly changes the UART Clock Source using `setClockSource()`, this new clock source will be used always, independently from the target SoC and selected baudrate (overriding the rule above).
👋 Hello SuGlider, we appreciate your contribution to this project! 📘 Please review the project's Contributions Guide for key guidelines on code, documentation, testing, and more. 🖊️ Please also make sure you have read and signed the Contributor License Agreement for this project. Click to see more instructions ...
Review and merge process you can expect ...
|
Test Results 76 files 76 suites 13m 17s ⏱️ Results for commit 374e2d4. |
Memory usage test (comparing PR against master branch)The table below shows the summary of memory usage change (decrease - increase) in bytes and percentage for each target.
Click to expand the detailed deltas report [usage change in BYTES]
|
Description of Change
The problem affects more often SoC that supports REF_TICK UART Clock source (ESP32 and ESP32-S2).
The implementation has an issue retated to when the user doesn't set any specific UART source clock and the UART changes its baudrate from lower than 250,000 to higher (ESP32/ESP32-S2).
The bug is about not changing the clock source to something faster (APB) in order to get correct clock resolution in order to reach closer enough to the new baudrate selection.
The new behaviour (which was working before) is that is the application doesn't set any specific UART clock rate, it shall follow a rule:
ESP32/ESP32-S2 will use REF_TICK whenever baudrate is lower than 250,000. Other SoC will use XTAL. ESP32/ESP32-S2 will change UART Clock Source to APB when baudrate is higher than 250,000 for a better final result.
If the user application explicitaly changes the UART Clock Source using
setClockSource()
, this new clock source will be used always, independently from the target SoC and selected baudrate (overriding the rule above).Test Scenarios
Using ESP32 / ESP32-S2 and setting Debug Level to Verbose - Checking the logs about UART_1 Clock Source.
Related links
Closes #11721