MQX RTOS v4.0.2 doesn't give UART driver with dma. It gives support for polling and interrupt method. I can see MQX RTOS v4.2 give UART driver using dma. How can I use MQX v4.2 dma UART driver in MQX v4.0? Is it possible?
Hi Sammer:
UART driver updated to use the eDMA was introduced in MQX 4.1.0, it is for TWR-VF65GS10. However this driver is not fully tested on Kinetis and even not documented in IO user guide. I would suggest you write your own driver for MQX.
Our customer implemented the UART with DMA at register programming level. I think it is very help to you. You can ported to MQX 4.0
Please refer to the following link.
https://community.nxp.com/message/584042?commentID=584042#comment-584042
I hope it helps.
Have a nice day!
Regards
Daniel
Hi Daniel ,
Thanks for your comment. I refer your below link and have few queries
In link DMA is implemented for UART using 2 methods :
1. Without driver - register programming level (Refer to folder - K60D100_MQX4.1_UART_DMA_withoutDriver)
2.Using MQX(K60D100_MQX4.1_UART_DMA).
You can find both folders in attachment in your link(https://community.nxp.com/message/584042?commentID=584042#comment-584042 ).
1. Without driver - register programming level
A) I was able to receive data(On UART 2) using DMA at register programming level. When I send data from terminal, data is copied testDMA[240] buffer. Now, I want to send some data as well through my application.
How same code can be modified such that it will send data using DMA keeping receiving functionality as well? Please suggest.
I tried to configure another DMA channel i.e. channel 1 for transmitting data, but program does not work. Any suggestion?
B) Another question I have in receiving mode, When I send 240 bytes from terminal(From PC) it copied to testDMA[240] buffer, however after 240 byte it stops filling data in buffer. I want to modify code such that 240 byte copy from UART data register to testDMA[240] buffer then again for next 240 bytes it should copy data from UART data register to testDMA[240] buffer. How I can modify your program for this application?
C) What does below field indicates? Does it mean DMA transfer 1 byte at time from Data register to testDMA[240] buffer? What if I changed this to 5 bytes?
/* Transfer size */
DMA_TCD0_NBYTES_MLNO = 1; //1 byte
2.Using MQX driver:
A) I need to port DMA driver to v4.0.2, However it is available in 4.2. I tried to work this driver in MQX 4.2 examples(UART example - Hello). However code is not compiled. Because following structure parameter(edma_devif) is undefined in given file.
const DMA_DEVIF_LIST my_dma_devif_list[] =
{
{ &edma_devif, (void *) 0, 16 },
{ NULL, NULL, 0 }
};
How to create instance for this parameter and get code compiled and work?
Because I wanted to port it to v4.0.2, before that just wanted to confirm to work it on v4.2. After that it is easy to port on v4.0.2.
Please suggest.
Thanks in advance.