|
我用stm32cubemx建的工程本来跑的挺好的,最近发现有bug。 我用uart1 在TIM3里边 1s定时发送数据,采用问答式通讯,对端收到了之后发送8个字节的应答。问题是跑了几十分钟之后或者一个小时多串口中断进不去了,我用两根线挂在总线上在电脑上用串口助手监听收发的数据,发送和应答的过程还在持续,其他功能也都正常只是cubemx的程序认为没有收到数据。很难定位是哪里的问题。我把定时器发送 和接收的代码贴在下边还有仿真的界面。 TIM3
æ¶å彿°
仿ç
|
微信公众号
手机版
版主你好。 为什么会发生溢出呢? 而且仿真时怎么确定是不是溢出呢?
不仿真的时候也这样,而且中断式接收的话跟超时应该没关系吧?
This bit is set by hardware when the word currently being received in the shift register is
ready to be transferred into the RDR register while RXNE=1. An interrupt is generated if
RXNEIE=1 in the USART_CR1 register. It is cleared by a software sequence (an read to the
USART_SR register followed by a read to the USART_DR register).
谢谢,问题已经找到是485的方向控制线有别的地方误操作
哈哈,我遇到的也是这个问题,感谢分享!