当前位置:网站首页>Idle interrupt cannot be cleared
Idle interrupt cannot be cleared
2022-06-28 04:43:00 【Shuanggu】
Debug environment
Single chip model :stm32F103RCT6
The exception code is as follows . When using the serial port assistant to send a byte , Always enter idle interrupt , And the idle interrupt flag bit cannot be cleared .
void USART2_IRQHandler(void)
{
if (UART_GET_FLAG(USART2, UART_FLAG_RXNE) != RESET)
{
fifoUart2.buf[fifoUart2.rcvCnt++] = USART2->DR;
UART_CLEAR_FLAG(USART2, UART_FLAG_RXNE);
}
if (UART_GET_FLAG(USART2, UART_FLAG_IDLE) != RESET)
{
fifoUart2.parseFlag = RT_TRUE;
UART_CLEAR_FLAG(USART2, UART_FLAG_IDLE);
rt_event_send(rcvEvent, RCV_EVENT_UART2);
}
}
Solution
Before clearing the idle terminal flag , Read it again DR Register value . From the description of this bit of the idle interrupt register in the manual, we can not see the principle .
void USART2_IRQHandler(void)
{
uint32_t dr = 0;
if (UART_GET_FLAG(USART2, UART_FLAG_RXNE) != RESET)
{
fifoUart2.buf[fifoUart2.rcvCnt++] = USART2->DR;
UART_CLEAR_FLAG(USART2, UART_FLAG_RXNE);
}
if (UART_GET_FLAG(USART2, UART_FLAG_IDLE) != RESET)
{
dr = USART2->DR;
fifoUart2.parseFlag = RT_TRUE;
UART_CLEAR_FLAG(USART2, UART_FLAG_IDLE);
rt_event_send(rcvEvent, RCV_EVENT_UART2);
}
}
边栏推荐
- filinCdc 的sql,多表的时候总报这个错,请问下该怎么解决呀
- Has anyone ever used CDC to synchronize to MySQL with a deadlock?
- What are the password requirements for waiting insurance 2.0? What are the legal bases?
- 27 years, Microsoft IE is over!
- Simple factory mode
- Password encryption MD5 and salt treatment
- Component splitting practice
- Resolve cross domain
- Multithreading and high concurrency V: detailed explanation of wait queue, executor and thread pool (key)
- How to traverse collections Ordereddict, taking it and forgetting items
猜你喜欢

2022-06-27:给出一个长度为n的01串,现在请你找到两个区间, 使得这两个区间中,1的个数相等,0的个数也相等, 这两个区间可以相交,但是不可以完全重叠,即两个区间的左右端点不可以完全一样。

【Matlab红绿灯识别】红绿灯识别【含GUI源码 1908期】

Web3来临时的风口浪尖

阿里P8倾情推荐,Fiddler抓包工具实战篇(一)

The company leader said that if the personal code exceeds 10 bugs, he will be dismissed. What is the experience?
![[small program practice series] e-commerce platform source code and function implementation](/img/a4/581d73c2ff5c190edc3d8438fa2122.png)
[small program practice series] e-commerce platform source code and function implementation

From zero to one, I will teach you to build a "search by text and map" search service (I)

论文详读:IMPROVING CONVOLUTIONAL MODELS FOR HANDWRITTEN TEXT RECOGNITION

June 27, 2022: give a 01 string with a length of N. now please find two intervals so that the number of 1 and the number of 0 in the two intervals are equal. The two intervals can intersect, but not c

Lingge leangoo agile Kanban tool adds the functions of exporting card documents and pasting shared brain map nodes
随机推荐
The SQL of filincdc always reports this error when there are multiple tables. How can I solve it
27 years, Microsoft IE is over!
抖音实战~关注博主
Lingge leangoo agile Kanban tool adds the functions of exporting card documents and pasting shared brain map nodes
Introversion, lying flat and midlife crisis
What are the password requirements for waiting insurance 2.0? What are the legal bases?
UI自动化测试框架搭建 —— 编写一个APP自动化
2022年中國音頻市場年度綜合分析
Oracledata installation problems
华为9年经验的软件测试总监工作感悟—写给还在迷茫的朋友
A bit of knowledge - online resources on Chinese Learning
TFTLCD display experiment of mini plate based on punctual atom stm32
Why are cloud vendors targeting this KPI?
A queue of two stacks
Another option for ERP upgrade, MES system
TACo:一种关于文字识别的数据增强技术
The coming wave of Web3
有关函数模板的那些小知识-.-
多线程实现 重写run(),怎么注入使用mapper文件操作数据库
If mysqlcdc sets multiple parallelism, will the incremental data repeat?