RT-Thread / RT-Thread/rt-thread
[Bug] sfud组件的wait_busy函数实现性能问题
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
v5.2.2
Hardware Type/Architectures
mcu
Develop Toolchain
GCC
Describe the bug
测试环境:
1、py25q128ha nor flash四线模式
2、在启用sfud组件后,执行sf bench yes
测试现象:
1、示波器测量QSPI的clk/(HOLD#/RESET#)管脚,出现约10ms一个的波形,会影响写入性能
2、将retry_delay_100us函数rt_thread_delay((RT_TICK_PER_SECOND * 1 + 9999) / 10000);改为rt_hw_us_delay(1);后性能会得到明显提升,但这样的改动会导致CPU阻塞在此,造成系统卡顿
Other additional context
No response
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.
Research direction
Locate the sfud component's wait_busy function and its retry_delay_100us path, then reproduce the behavior with sf bench yes on the stated QSPI NOR flash setup. Compare the timing and CPU impact of rt_thread_delay and rt_hw_us_delay; done means avoiding the observed performance loss without causing system stalls.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- c
- Domain
- embedded-iot, operating-systems, performance
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100