Real Time UART driver for FRDMk64f

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

Real Time UART driver for FRDMk64f

1,189件の閲覧回数
tzahimanistersk
Contributor I

Hi.

 

I'm using the FRDMK64F.

My application requers a transport of UART bytes.

There is no assumptions of bytes values and timming.

Therere should be 100% dlivery with minimum latency.

I need an example of using the UART EDMA.

And with a proven performance.

 

Please help

ラベル(1)
0 件の賞賛
6 返答(返信)

514件の閲覧回数
EarlOrlando
Senior Contributor II

Hello Tzahi,

The uart_edma_non_blocking example which is located in the path C:\Freescale\KSDK_1.2.0\examples\frdmk64f\driver_examples\uart\uart_edma_non_blocking once you installed Kinetis SDK, does what you need. Please take a look into it!

The eDMA satisfies without any problem the UART latency.

Best regards,

Earl.

0 件の賞賛

514件の閲覧回数
tzahimanistersk
Contributor I

I got it.

The examples can indeed demonstrate that a rx and rx of a single charecter can work.

But they had failed in delivering 100% of the bytes.

Doing so occupied about 40% CPU.

The UART EDMA blocking example discard the entire rx bytes on timeout. ( see UART_DRV_EdmaReceiveDataBlocking())

I need to deliver 3 UART interfaces at 115200 - and other APP tasks (using FreeRTOS for example)

The bytes are splitted into mesegaes at a not defined length and data. length of 6 to 200 bytes.

I speculate that for minimize CPU load, 100% of data delivery and mimum delay -

The HW should store rx bytes and interrupt only of a reception of an idle charecter (and of bytes rx)

Is there a tested example for recieving  6 to 200 (continuous) bytes - at a single task switch?

0 件の賞賛

514件の閲覧回数
EarlOrlando
Senior Contributor II

Hello Tzahi,

I am afraid there is not an example doing what you are asking for, it is part of your application. The UART Peripheral Driver in the Kinetis SDK support only a fixed amount of bytes reception with the eDMA. An interrupt only when an idle character is received is not supported even by the MCU (I suppose that "an idle character" means that the line is in idle for more than one bit time). My suggestion is that you receive a large amount of data where the messages are separated by special characters (i.e. the null character).

I hope it helps.

Best regards,

Earl.

0 件の賞賛

514件の閲覧回数
tzahimanistersk
Contributor I

I tried use the basic UART driver for copy te recived bytes from the Driver's ISR callback - to a cyclic buffer.

So I've managed to get all the data from an application task but the interrupt rate (once per 0.1 msec) cased the RTSC IP stack mailfunction (even ping)

I've seen the edma example,

Is it possible to use the eDMA scatter/gather/loop modes for fill a cyclic buffer with no interrupt?

0 件の賞賛

514件の閲覧回数
EarlOrlando
Senior Contributor II

Hello Tzahi,

Sure! You can use the eDMA to transfer the received data from the UART buffer to an array, however, you need to choose a fixed amount of data to receive. The examples that I mentioned in the above messages should work for you, don't they?

Please let me know if any other questions arise.

Regards,

Earl.

0 件の賞賛

514件の閲覧回数
wyflsxy
Contributor II

hello ,I have a  problem about UART ISR

I used to compile environment is KDS3.0

Using a KSDK1.2 and MQX4.2,and my board is frdmk64f

I want to rec data form uart with ISR

but when I install the uart0 isr,

the Interrupt handler is constantly triggered, whatever I have to send or receive data from UART0

I don't know what's the problem

Is it because UART0 is the default input port?

In addition, I want to know why  the code “printf("\ncounter = %d\n", g_isr_data.COUNTER);could output data to uart0

how can I change it output to uart1?

0 件の賞賛