i.MX RT1060 UART FIFO does not work

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

i.MX RT1060 UART FIFO does not work

跳至解决方案
5,355 次查看
Mark16
Contributor II

I want to send 120 bytes via UART1 with an i.MX RT1060 (MIMXRT1061CVJ5B) using the FIFO. I've set the TX FIFO to 256 bytes, but it's not working. Is this a processor bug?

0 项奖励
回复
1 解答
5,205 次查看
Mark16
Contributor II

Hello,
As I said, I can't do anything with these bloated examples,
because I need complete control over the module,
and many important functions aren't included in the API.

But I was able to solve it after all:
an important control bit "DREQ" wasn't set:

Mark16_0-1745993157494.png

Now it's running like crazy
It's a great machine, but the API is completely inadequate...
Thanks for your effort.
Regards, Mark

 

在原帖中查看解决方案

9 回复数
5,273 次查看
Mark16
Contributor II

That's a bit disappointing.

Now they've built this mega-machine,
with amazing features,
and then they're skimping on the UART FIFO.

Why is that?

Even my old LPC2478 had a larger UART FIFO of 16 bytes.

I want my money back

Then I guess I'll have to pump the data via eDMA...

 

0 项奖励
回复
5,246 次查看
mayliu1
NXP Employee
NXP Employee

Hi @Mark16 ,

Thanks for your reply.

The LPUART FIFO size of the RT1060 processor is also 16 bytes. Could you share with me the application requirements for a larger FIFO size?  and could you tell me your point of confusion? I can forward your requirements to the NXP internal team.

You mentioned that "using LPUART + DMA " is also an effective transmission method. The NXP SDK demos have  a lot of examples for you to use.

Best Regards

MayLiu

0 项奖励
回复
5,233 次查看
Mark16
Contributor II

Hello,
I'm not confused.
I just want to send 120 bytes over UART1 every 100ms,
with minimal overhead, i.e., without interrupts, etc.
With a 256-byte FIFO, this would be super easy.
With a 4-byte FIFO, it won't work without interrupts or polling.

I've been trying to solve it with the famous eDMA for 5 days now,
but I've completely failed.
I've read the relevant chapters in the manual several times,
but a lot remains unclear.

The example programs in the SDK and the drivers in "fsl_lpuart_edma,"
"fsl_edma," etc., are incredibly bloated, deeply nested,
and can only be used in a specific way.
They're useless for simple, straightforward applications.

I have 25 years of professional experience as an embedded programmer,
with a wide variety of processors,
but I've never experienced anything like this.

Please explain to me how to set the registers for UART1 and eDMA to easily send 120 bytes over UART1.
Please use "bare metal" style, e.g.:

LPUART1->CTRL = ?
etc...
DMA0->SERQ = ?
etc...
DMA0->TCD[0].SADDR = ?
etc...

0 项奖励
回复
5,213 次查看
mayliu1
NXP Employee
NXP Employee

Hi @Mark16 ,

 

Thanks for your reply.

The SDK demo provides  API functions that you can call directly, which is more convenient and quicker  than you set set the registers.
 
I did a test for you, I think you can refer to it. I have send detail information to you Email(
 
Due to NXP the latest policy, I can not send your code directly, but I can send you picture).
 

Wish it helps you.
If you still have question about it, please kindly let me know.

Wish you a nice day!

Best Regards
MayLiu

0 项奖励
回复
5,206 次查看
Mark16
Contributor II

Hello,
As I said, I can't do anything with these bloated examples,
because I need complete control over the module,
and many important functions aren't included in the API.

But I was able to solve it after all:
an important control bit "DREQ" wasn't set:

Mark16_0-1745993157494.png

Now it's running like crazy
It's a great machine, but the API is completely inadequate...
Thanks for your effort.
Regards, Mark

 

5,317 次查看
Mark16
Contributor II

Where can i set the value?

In the Config Tool?

0 项奖励
回复
5,329 次查看
mayliu1
NXP Employee
NXP Employee

Hi @Mark16 ,

Thank you so much for your interest in our products and for using our community.

Question: I want to send 120 bytes via UART1 with an i.MX RT1060 (MIMXRT1061CVJ5B) using the FIFO. I've set the TX FIFO to 256 bytes, but it's not working. Is this a processor bug?

Answer:

This is not a processor bug.

In IMXRT1060RM,   The maximum number of transmit/receive datawords that can be stored in the TXFIFOSIZE/RXFIFOSIZE.

https://www.nxp.com/webapp/Download?colCode=IMXRT1060RM&location=null

mayliu1_1-1745719711189.png

mayliu1_2-1745719917366.png

I run a  SDK demo on MIMXRT1060-EVK board for you to better understand.

The LPUART RXFIFOSIZE / TXFIFOSIZE  value are 4 datawords.  The value in RXWATER and TXWATER must be set to be less than the receive FIFO/buffer and transmit buffer/FIFO size

mayliu1_0-1745719605924.png

The value you set the TX FIFO to 256 bytes are not correct value, Please set the value based on the MIMXRT1060RM.

 

Wish it helps you.
If you still have question about it, please kindly let me know.

Wish you a nice day!

Best Regards
MayLiu

0 项奖励
回复
5,317 次查看
Mark16
Contributor II
Where can i set the value?
In the Config Tool?
0 项奖励
回复
5,311 次查看
mayliu1
NXP Employee
NXP Employee

Hi @Mark16 ,

Thanks for your updated information.

LPUART TXFIFOSIZE/RXFIFOSIZE size is fixed, you can not modify it.

The value in RXWATER and TXWATER must be set to be less than the receive FIFO/buffer and transmit buffer/FIFO size, it means the value in RXWATER and TXWATER must be set to be less than 4  datawords.

Best Regards
MayLiu

0 项奖励
回复
%3CLINGO-SUB%20id%3D%22lingo-sub-2087539%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3Ei.MX%20RT1060%20UART%20FIFO%20%E4%B8%8D%E5%B7%A5%E4%BD%9C%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2087539%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3E%E6%88%91%E6%83%B3%E4%BD%BF%E7%94%A8%20FIFO%20%E9%80%9A%E8%BF%87%20UART1%20%E5%92%8C%20i.MX%20RT1060%EF%BC%88MIMXRT1061CVJ5B%EF%BC%89%E5%8F%91%E9%80%81%20120%20%E4%B8%AA%E5%AD%97%E8%8A%82%E3%80%82%E6%88%91%E5%B7%B2%E5%B0%86%20TX%20FIFO%20%E8%AE%BE%E7%BD%AE%E4%B8%BA%20256%20%E5%AD%97%E8%8A%82%EF%BC%8C%E4%BD%86%E5%AE%83%E4%B8%8D%E8%B5%B7%E4%BD%9C%E7%94%A8%E3%80%82%E8%BF%99%E6%98%AF%E5%A4%84%E7%90%86%E5%99%A8%E9%94%99%E8%AF%AF%E5%90%97%EF%BC%9F%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2088044%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%E5%9B%9E%E5%A4%8D%EF%BC%9Ai.MX%20RT1060%20UART%20FIFO%20%E4%B8%8D%E5%B7%A5%E4%BD%9C%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2088044%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3E%E8%BF%99%E6%9C%89%E7%82%B9%E4%BB%A4%E4%BA%BA%E5%A4%B1%E6%9C%9B%E3%80%82%3C%2FP%3E%3CP%3E%E7%8E%B0%E5%9C%A8%E4%BB%96%E4%BB%AC%E5%BB%BA%E9%80%A0%E4%BA%86%E8%BF%99%E4%B8%AA%E5%B7%A8%E5%9E%8B%E6%9C%BA%E5%99%A8%EF%BC%8C%3CBR%20%2F%3E%E5%85%B7%E6%9C%89%E4%BB%A4%E4%BA%BA%E6%83%8A%E5%8F%B9%E7%9A%84%E5%8A%9F%E8%83%BD%EF%BC%8C%3CBR%20%2F%3E%E7%84%B6%E5%90%8E%E4%BB%96%E4%BB%AC%E5%9C%A8%20UART%20FIFO%20%E4%B8%8A%E8%8A%82%E7%9C%81%E5%BC%80%E6%94%AF%E3%80%82%3C%2FP%3E%3CP%3E%E8%BF%99%E6%98%AF%E4%B8%BA%E4%BB%80%E4%B9%88%EF%BC%9F%3C%2FP%3E%3CP%3E%E5%8D%B3%E4%BD%BF%E6%88%91%E7%9A%84%E6%97%A7%20LPC2478%20%E4%B9%9F%E5%85%B7%E6%9C%89%E6%9B%B4%E5%A4%A7%E7%9A%84%2016%20%E5%AD%97%E8%8A%82%20UART%20FIFO%E3%80%82%3C%2FP%3E%3CP%3E%E6%88%91%E8%A6%81%E5%9B%9E%E6%88%91%E7%9A%84%E9%92%B1%20%3CLI-EMOJI%20id%3D%22lia_winking-face%22%20title%3D%22%3Awinking_face%3A%22%3E%3C%2FLI-EMOJI%3E%3C%2FP%3E%3CP%3E%E9%82%A3%E4%B9%88%E6%88%91%E6%83%B3%E6%88%91%E5%BF%85%E9%A1%BB%E9%80%9A%E8%BF%87%20eDMA%20%E6%9D%A5%E4%BC%A0%E8%BE%93%E6%95%B0%E6%8D%AE......%3C%2FP%3E%3CBR%20%2F%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2087699%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%E5%9B%9E%E5%A4%8D%EF%BC%9Ai.MX%20RT1060%20UART%20FIFO%20%E4%B8%8D%E5%B7%A5%E4%BD%9C%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2087699%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3E%E6%88%91%E5%8F%AF%E4%BB%A5%E5%9C%A8%E5%93%AA%E9%87%8C%E8%AE%BE%E7%BD%AE%E8%AF%A5%E5%80%BC%EF%BC%9F%3C%2FP%3E%3CP%3E%E5%9C%A8%E9%85%8D%E7%BD%AE%E5%B7%A5%E5%85%B7%E4%B8%AD%EF%BC%9F%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2087698%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%E5%9B%9E%E5%A4%8D%EF%BC%9Ai.MX%20RT1060%20UART%20FIFO%20%E4%B8%8D%E5%B7%A5%E4%BD%9C%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2087698%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%E6%88%91%E5%8F%AF%E4%BB%A5%E5%9C%A8%E5%93%AA%E9%87%8C%E8%AE%BE%E7%BD%AE%E8%AF%A5%E5%80%BC%EF%BC%9F%3CBR%20%2F%3E%E5%9C%A8%E9%85%8D%E7%BD%AE%E5%B7%A5%E5%85%B7%E4%B8%AD%EF%BC%9F%3C%2FLINGO-BODY%3E