fix(uart): hal_uart_init() doesn't force a reset edge or configure RX/TX pull state #120
Labels
No labels
Category
App
Category
Documentation
Category
Firmware
Category
Hardware
Category
Qms
PR_Size
L
PR_Size
M
PR_Size
S
PR_Size
XL
PR_Size
XS
Priority
Critical
Priority
High
Priority
Low
Priority
Medium
Priority
Very Low Priority
Size
Epic
Size
Feature
Size
Task
Status
Blocked
Status
Draft
Status
Needs-review
Team
Board
Team
Dev
Team
Management
Type
Bug
Type
Capa
Type
Improvement
Type
New-feature
Type
Regulatory
Type
Usability
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
opendutchsolutions.public/hal_awr6843#120
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Found while debugging a real-hardware "UART doesn't work" report on a downstream consumer project (
awr6843_mss_barebones_example), by diffinghal_uart_init()against a hardware-confirmed sibling driver (AWR6xxx_Toolchain'sUniversal_hal,uart_iwr68xx.c, itself ported from the mmWave SDK'sUartSci_open()).Two gaps:
No explicit reset-then-release.
hal_uart_init()writesSCIGCR0.RESET = 1directly. If the module was already out of reset (RESET already 1), this write is a no-op -- no 0->1 edge, so the module's internal state machines/shift registers/stale GCR1/BAUD config from before this call are never actually cleared. This matters concretely on this hardware: the SCI instance this example uses (MSS_SCIA) is the same "Application/User UART" the board's own SBL/flash tool (UniFlash) uses to receive the flashed image before ever jumping to the application -- soRESETmay well already be 1, with the bootloader's own stale config in place, when this driver'shal_uart_init()runs. The reference driver explicitly doesSCIGCR0 = 0thenSCIGCR0 = 1.RX/TX pull state left at whatever the pad's default happens to be.
SCIPIO7/SCIPIO8(pull-disable / pull-select) are never written. Per this project's own register header comments, both registers' reset values are documented as "pin/pad default-dependent... not a guaranteed reset value" -- i.e. genuinely unknown without explicit configuration, not just "defaults to 0". The reference driver explicitly enables pull control and selects pull-up on both RX and TX (idle-high, the correct idle state for UART).Fix: reset-then-release
SCIGCR0, and explicitly writeSCIPIO7/SCIPIO8for pull-enable + pull-up on RX/TX, matching the SDK reference driver.