Skip to content

Fix dynamic baudrate UART issue by explicitly naming CSRs. #2406

Merged
enjoy-digital merged 2 commits intoenjoy-digital:masterfrom
helium729:master
Jan 29, 2026
Merged

Fix dynamic baudrate UART issue by explicitly naming CSRs. #2406
enjoy-digital merged 2 commits intoenjoy-digital:masterfrom
helium729:master

Conversation

@helium729
Copy link
Contributor

#2394 reported that enabling dynamic baudrate on UART caused transmission failure.

CSR objects were instantiated without explicit names, relying on automatic name extraction from variable names. This extraction can be fragile, especially with private attributes (starting with _) or in certain contexts (like EventManager).
When LiteXModule introspection logic changed (as noted in the issue referencing commit 1b5fc97), this implicit naming likely broke, causing the tuning_word CSR (required for dynamic baudrate) or rxtx CSR to be mishandled.

I reproduced the ValueError: Cannot extract CSR name in a standalone simulation script, confirming the fragility.
The fix involves explicitly passing name="..." to CSR, CSRStatus, and CSRStorage in RS232PHY, UART, and EventManager.
This ensures robust CSR generation and fixes the issue.

helium729 and others added 2 commits January 28, 2026 16:57
This commit addresses an issue where UART with dynamic baudrate failed to transmit data.
The cause was likely failure to extract CSR names for private attributes (`_tuning_word`, `_rxtx`, etc.) in some environments, leading to missing CSRs or incorrect mapping.
Explicitly providing names to `CSR`, `CSRStatus`, and `CSRStorage` ensures they are correctly handled by `LiteXModule`/`AutoCSR`.

Fixes enjoy-digital#2394.
Fix dynamic baudrate UART by adding explicit CSR names
@enjoy-digital
Copy link
Owner

Thanks @helium729! Let's merge. I'll still probably investigate further since there could be another underlying issue.

@enjoy-digital enjoy-digital reopened this Jan 29, 2026
@enjoy-digital enjoy-digital merged commit 1cb844a into enjoy-digital:master Jan 29, 2026
2 checks 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