RT-Thread / RT-Thread/rt-thread
(RT-Thread串口设备驱动相关问题,问题可见说明)MCU为OK1052的设备驱动层串口配置函数中,需要重新打开串口中断并配置优先级,才能使串口正常接收数据
Nobody has claimed this yet.
- Dominant language
- C
- Stars
- 12.2k
- Forks
- 5.4k
- Avg merge
- 4d 12h
- Merged PRs (30d)
- 40
Description
1.问题起因
外设调用PrivIoctl(adapter->fd, OPE_INT, &ioctl_cfg) (函数见下图第94行),该函数为串口配置函数,但发现只有将该函数注释掉之后串口接收才正常,否则接收不到数据

2.解决方案(添加如下图630-635行所示解决问题代码,即重新使能中断,重新配置优先级分组)
设备驱动层串口configure配置处理函数如下图所示(630-635行为后期添加最终解决问题)

3.疑问
RT-Thread在板级初始化的时候已经配置了串口,并且使能了串口中断,设置了中断优先级分组,但为什么再重新配置串口后,仍然要再重新使能中断,配置优先级分组才能解决问题?
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
Start with the device-driver serial configure handler and the PrivIoctl(adapter->fd, OPE_INT, &ioctl_cfg) call described in the issue. Compare this path with the OK1052 board initialization that enables the serial interrupt and configures priority grouping; done means explaining why reconfiguration changes reception and confirming that serial data is received reliably.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- c
- Domain
- embedded-iot, operating-systems
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 35/100