RT-Thread / RT-Thread/rt-thread

[Bug] finsh线程一直占用cpu,导致低优先级任务无法执行

Open
#10,573 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
C
Stars
12.2k
Forks
5.4k
Avg merge
4d 12h
Merged PRs (30d)
40

Description

RT-Thread Version

5.2.1

Hardware Type/Architectures

at32

Develop Toolchain

Other

Describe the bug

1.at32驱动里选择DMA方式
2.串口驱动选serial v2
3.finsh启动后,优先级更低的线程无法被调度
4.目前初步分析原因,finsh调用read系统调用获取串口数据,read是非阻塞的,导致问题发生。
5.现在read调用后,如果无数据,则增加rt_thread_mdelay(1).

Other additional context

No response

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce the issue on AT32 with DMA enabled and the serial v2 driver, then trace the finsh thread's read path when no serial data is available. Confirm that lower-priority threads are scheduled normally after the fix, including the no-input case described in the report.

Written by the indexing model from the issue text.

Assessment

Tech stack
c
Domain
embedded-iot, operating-systems
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.