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

Fix ESP32 UART configuration for ESP-IDF >= 5.0 #953

Merged
merged 1 commit into from
Nov 19, 2023

Conversation

tovam
Copy link
Contributor

@tovam tovam commented Nov 19, 2023

Include source_clk field in the uart_config_t struct for ESP-IDF >= 5.0 to address compatibility error.

The issue arises due to a missing source_clk field in the uart_config_t struct in uart_driver_create_port.
In versions prior to ESP-IDF 5.0, this field was not required (tested against 4.4.6), but its absence in later versions leads to the following error at runtime : uart: uart_param_config(748): Invalid src_clk.
The choice of UART_SCLK_DEFAULT was made to allow for automatic selection of the appropriate clock source.

Open to feedback or suggestions for any improvements or alternative approaches.

These changes are made under both the "Apache 2.0" and the "GNU Lesser General
Public License 2.1 or later" license terms (dual license).

SPDX-License-Identifier: Apache-2.0 OR LGPL-2.1-or-later

Copy link
Collaborator

@bettio bettio left a comment

Choose a reason for hiding this comment

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

Looks good. Let's add an entry to the changelog CHANGELOG.md file and we can merge it.

Something like "Fixed invalid src_clk error on ESP-IDF >= 5.0" or something like that, under the Fixed section for [0.6.0-alpha.2]

Please, add this entry to the changelog by just amending your commit (so we can keep the git history clean).

Include 'source_clk' field in the 'uart_config_t' struct for ESP-IDF >= 5.0
to address compatibility error.

Signed-off-by: tovam <tovam@users.noreply.github.com>
@tovam
Copy link
Contributor Author

tovam commented Nov 19, 2023

Great, done

@bettio bettio merged commit 4828e69 into atomvm:master Nov 19, 2023
1 check passed
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.

2 participants