Skip to content

Fixes baudrate with CPU Freq < 80MHz #6037

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

Merged
merged 3 commits into from
Dec 21, 2021
Merged

Conversation

SuGlider
Copy link
Collaborator

Summary

This PR fixes an issue with UART when CPUFreq is lower than 80MHz (APB Freq)

Impact

No impact beside the fix.

Related links

Fix #6032

@SuGlider SuGlider added this to the 2.0.2 milestone Dec 17, 2021
@SuGlider SuGlider self-assigned this Dec 17, 2021
// baudrate must be multiplied when CPU Frequency is lower than APB 80MHz
uint32_t _get_effective_baudrate(uint32_t baudrate)
{
uint32_t Freq = getCpuFrequencyMhz();
Copy link
Member

@P-R-O-C-H-Y P-R-O-C-H-Y Dec 19, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe more clearer if you use getApbFrequency() which is related to UART.
But it will return frequency in Hz, not in MHz.

Just an idea, will work the same.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agreed here :)

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, it gets better and clear. DONE. Thanks.

@me-no-dev me-no-dev merged commit c3d41c9 into espressif:master Dec 21, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

setCpuFrequencyMhz() changes Serial bauds if frequency<80Mhz
3 participants