Skip to content

uart: fix threshold configuration loss when interrupts are disabled (IDFGH-17749)#18677

Open
AbanoubSalah wants to merge 1 commit into
espressif:masterfrom
AbanoubSalah:fix/uart-threshold-configuration-loss
Open

uart: fix threshold configuration loss when interrupts are disabled (IDFGH-17749)#18677
AbanoubSalah wants to merge 1 commit into
espressif:masterfrom
AbanoubSalah:fix/uart-threshold-configuration-loss

Conversation

@AbanoubSalah
Copy link
Copy Markdown

Description

Description: Fixes an asymmetric flaw in the UART driver where uart_set_rx_full_threshold and uart_set_tx_empty_threshold silently drop developer configuration updates and return ESP_OK if executed before the hardware interrupts are enabled.

Problem: Checking uart_hal_get_intr_ena_status inside setters prevents developer from setting-up initialization config. If a developer configures hardware thresholds before calling uart_driver_install or unmasking interrupts, the settings never reach HAL while the API reports ESP_OK. Meanwhile, uart_set_rx_timeout applies configurations unconditionally.

Solution: Refactored both functions to write directly to their respective HAL threshold registers unconditionally inside the critical section, aligning their architectural behavior with uart_set_rx_timeout.

Related

Fixes issue #13116

Testing

It compiles perfectly with v6.1-dev


Checklist

Before submitting a Pull Request, please ensure the following:

  • 🚨 This PR does not introduce breaking changes.
  • All CI checks (GH Actions) pass.
  • Documentation is updated as needed.
  • Tests are updated or added as necessary.
  • Code is well-commented, especially in complex areas.
  • Git history is clean — commits are squashed to the minimum necessary.

@github-actions github-actions Bot changed the title uart: fix threshold configuration loss when interrupts are disabled uart: fix threshold configuration loss when interrupts are disabled (IDFGH-17749) May 31, 2026
@espressif-bot espressif-bot added the Status: Opened Issue is new label May 31, 2026
@espressif-bot espressif-bot assigned Icarus113 and Bruce297 and unassigned Icarus113 Jun 1, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Status: Opened Issue is new

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants