RT-Thread / RT-Thread/rt-thread

(RT-Thread串口设备驱动相关问题,问题可见说明)MCU为OK1052的设备驱动层串口配置函数中,需要重新打开串口中断并配置优先级,才能使串口正常接收数据

Open
#6,070 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

1.问题起因
外设调用PrivIoctl(adapter->fd, OPE_INT, &ioctl_cfg) (函数见下图第94行),该函数为串口配置函数,但发现只有将该函数注释掉之后串口接收才正常,否则接收不到数据
image
2.解决方案(添加如下图630-635行所示解决问题代码,即重新使能中断,重新配置优先级分组)
设备驱动层串口configure配置处理函数如下图所示(630-635行为后期添加最终解决问题)
1
3.疑问
RT-Thread在板级初始化的时候已经配置了串口,并且使能了串口中断,设置了中断优先级分组,但为什么再重新配置串口后,仍然要再重新使能中断,配置优先级分组才能解决问题?

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

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.