UART4 DMA on K66

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 
2,025件の閲覧回数
alexstefan
Contributor III

Hi,

Am using a Kinetis K66 on a custom board where the UART we want to use is routed to PTC14 and PTC15 (UART4). Data is transmitted asynchronously, so it means both TX and RX could be active at the same time. While writing the firmware I noticed that DMA only has one trigger source for UART4 that's common for both TX and RX. I am not very experienced with DMA, but from my understanding of things, I won't be able to receive data at the same time as I'm sending it, presuming I use DMA for both TX and RX. Any way I could get around this?

Thank you,

Alex

ラベル(2)
0 件の賞賛
1 解決策
1,711件の閲覧回数
mjbcswitzerland
Specialist V

Hi Alex

Unfortunately you can use DMA on either tx or rx, and not both on UART4 of the K66.
If you connect the source to a DMA channel with both rx and tx DMA triggers enabled either of them will trigger a DMA transfer, which means that rx will disturb tx and tx will disturb rx.

On the K64 both UARTs 4 and 5 have this restriction!

The K66 does in fact have a free (marked reserved) DMA source number that could have been used for UART4 receive due to the fact that its 6th UART is a LPUART, which has its own rx and tx source elsewhere. Presumably giving UART4 its own rx source would have disrupted the standard MUX layout in some way and it was decided to keep it shared (for compatibility), which is a shame in your case. I think that you will need to decide on the direction to use DMA on and use interrupt on the other.

Regards

Mark

UARTs: http://www.utasker.com/docs/uTasker/uTaskerUART.PDF

uTasker developer and supporter (+5'000 hours experience on +60 Kinetis derivatives in +80 product developments)
Kinetis: http://www.utasker.com/kinetis.html

元の投稿で解決策を見る

0 件の賞賛
2 返答(返信)
1,712件の閲覧回数
mjbcswitzerland
Specialist V

Hi Alex

Unfortunately you can use DMA on either tx or rx, and not both on UART4 of the K66.
If you connect the source to a DMA channel with both rx and tx DMA triggers enabled either of them will trigger a DMA transfer, which means that rx will disturb tx and tx will disturb rx.

On the K64 both UARTs 4 and 5 have this restriction!

The K66 does in fact have a free (marked reserved) DMA source number that could have been used for UART4 receive due to the fact that its 6th UART is a LPUART, which has its own rx and tx source elsewhere. Presumably giving UART4 its own rx source would have disrupted the standard MUX layout in some way and it was decided to keep it shared (for compatibility), which is a shame in your case. I think that you will need to decide on the direction to use DMA on and use interrupt on the other.

Regards

Mark

UARTs: http://www.utasker.com/docs/uTasker/uTaskerUART.PDF

uTasker developer and supporter (+5'000 hours experience on +60 Kinetis derivatives in +80 product developments)
Kinetis: http://www.utasker.com/kinetis.html

0 件の賞賛
1,712件の閲覧回数
alexstefan
Contributor III

Thanks a lot, Mark! Your contributions to the community are very helpful, I've learned a lot about the DMA functioning on the Kinetis and solutions to various use cases, from the messages you've posted.

Fortunately, we've been able to find an easy way to swap the pins with a debug UART that was assigned to UART0 and where we only need TX functionality.

Alex

0 件の賞賛