LPUART Transfer empty flag 0 as soon as I try to send something

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 
已解决

LPUART Transfer empty flag 0 as soon as I try to send something

跳至解决方案
844 次查看
ping1
Contributor V

Dear support

I try to use LPUART_WriteBlocking() function to send some data out, but it hand in the status register check - the transfer empty flag in status register TDRE is 0, means full. I have checked the register before calling this function, and it is 1, not as soon as I call it, it hangs there forever, before this it is able to receive something, and it is the first time I call the function, could you help please?

Regards!

Ping

0 项奖励
回复
1 解答
817 次查看
jingpan
NXP TechSupport
NXP TechSupport

Hi @ping1 ,

When the transmit FIFO is enabled, TDRE is set when the number of datawords in the transmit FIFO is
equal to or less than the number indicated by WATER[TXWATER]. It is controlled by hardware of course.  If it is always 0, that means the data in FIFO isn't sent. Can you see something on TX line?

Regards,

Jing

在原帖中查看解决方案

0 项奖励
回复
3 回复数
830 次查看
jingpan
NXP TechSupport
NXP TechSupport

Hi @ping1 ,

Please refer to the lpuart_interrupt demo in SDK. It use LPUART_WriteBlocking()  too.

 

Regards,

Jing

0 项奖励
回复
828 次查看
ping1
Contributor V

Thanks for reply, Jing

Just wonder why it is blocked by the status flag - is it caused by hardware?

Ping

0 项奖励
回复
818 次查看
jingpan
NXP TechSupport
NXP TechSupport

Hi @ping1 ,

When the transmit FIFO is enabled, TDRE is set when the number of datawords in the transmit FIFO is
equal to or less than the number indicated by WATER[TXWATER]. It is controlled by hardware of course.  If it is always 0, that means the data in FIFO isn't sent. Can you see something on TX line?

Regards,

Jing

0 项奖励
回复