[Bug] [HPM] [uart_v2] 驱动判断 TX 中断时混用了“中断 ID”和“中断使能掩码”
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 72/100
- Issue type
- Bug
- Clarity
- Clearly specified
- Activity status
- Quiet
- Tech stack
- c
- Domain
- embedded-iot, operating-systems
Research direction
Inspect libraries/drivers/drv_uart_v2.c around lines 763-767 and trace how UART interrupt IDs and status masks are handled for hpm6364. Reproduce the UART6 configuration with TX_BUFSIZE=0; done when an RX line-status interrupt is no longer treated as a TX interrupt or causes an assertion on an absent serial_tx.
Written by the indexing model from the issue text.
Description
RT-Thread Version
master
Affected area
Board Support Package (BSP)
Hardware/BSP vendor
HPMicro
Architecture
RISC-V
Board and hardware details
hpm6364
Develop Toolchain
GCC
Describe the bug
错误代码位于 libraries/drivers/drv_uart_v2.c:763:
if ((irq_id & uart_intr_tx_slot_avail) &&
(stat & uart_stat_tx_slot_avail)) {
irq_id 应与 uart_intr_id_tx_slot_avail 比较:
if ((irq_id == uart_intr_id_tx_slot_avail) &&
(stat & uart_stat_tx_slot_avail)) {
当前 UART6 配置为 TX_BUFSIZE=0,RT-Thread 会采用轮询发送,不创建 serial_tx。当 UART 接收线出现状态中断时:
- uart_intr_id_rx_line_stat = 0x6
- uart_intr_tx_slot_avail 掩码值包含 0x2
- 0x6 & 0x2 != 0
于是 RX line status 被误判为 TX 中断,随后在 libraries/drivers/drv_uart_v2.c:767 对空的 serial_tx 触发断言。
Other additional context
@helloeagleyang 是佬在负责这块吗
- Dominant language
- C
- Stars
- 12.2k
- Forks
- 5.4k
- Avg merge
- 5d 15h
- Merged PRs (30d)
- 49
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from RT-Thread/rt-thread
-
BSP BSP: Loongson bug RT-Smart
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
-
in progress
-
Arch: RISC-V enhancement Kernel
Difficulty 5/5 Over a week Newbie friendliness 35/100
-
bug Component component: drivers
Difficulty 3/5 1-2 days Newbie friendliness 72/100
All issues in RT-Thread/rt-thread
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
-
level/task module/gcp type/bug
Difficulty 2/5 1-3 hours Newbie friendliness 85/100
-
Difficulty 1/5 Under an hour Newbie friendliness 86/100
hapostgres/pg_auto_failover#1190 ·
-
docs
Difficulty 1/5 Under an hour Newbie friendliness 85/100
-
P3 sonic-vpp
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
sonic-net/sonic-buildimage#29662 ·