mixing UART and UART DMA driver KSDK 2.4 ?

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

mixing UART and UART DMA driver KSDK 2.4 ?

835 Views
thomas_kopp
Contributor I

Hello everyone,

Is it possible to configure an UART by mixing the UART and UART DMA driver in order to activate DMA only for transfering datas and receiving without DMA ? (with KSDK 2.4). Can someone give an example ? Or should i do it without using KSDK ? If someone did it can he send the code used ?

Also in the UART example it seems that there is only one callback function for both RX and TX ?  Isn't it possible to install callback for RX and TX ? (Replacing of UART_DRV_InstallCallback function in KSDK 1.3).Also now i don't see how to specify that i want an interrupt for every bytes Received. How should i proceed for that ?

Thank you in advance for your answer,

Regards,

Labels (1)
0 Kudos
6 Replies

649 Views
thomas_kopp
Contributor I

hello mjbcswitzerland,

Thank you for your answer,

I also tried µTasker and added a source file with some functions/tasks. I followed (i think) all the steps to add a task to the OS. I tried to initialise a PIT timer and to toggle a led of the FRDM-KV31F when an interrupt occurs. But my program doesn't work and is reset by the watchdog.

Even by compiling the last version of the project (where you added the FRDM-KV31F target) and without modification (only config.h, change the makefile for the target with the KV_512_96.ld and link the compiler), the MCU is reset by the watchdog. Did i miss something ?

PS : compiling by using the Makefile from the GNU_Kinetis folder with gcc-arm-none-eabi-7-2018-q2-update and KBOOT on the board.

Thanks in advance for your answer,

Regards,

Thomas

0 Kudos

649 Views
mjbcswitzerland
Specialist V

Hi Thomas

You write that you have KBOOT installed on the board. Since the KV31 doesn't have KBOOT in ROM I am assuming that you mean that you have installed a KBOOT version in Flash and you use it to load new binary files with.

If this is the case you will need to use the linker script file KV_512_96_BM.ld instead and possibly/probably adjust the start address in it to match the one that your KBOOT version uses.

In case of complications please contact me directly and I can step through the process with you on a Skype remote desktop session and resolve anything that is standing in the way.

Regards

Mark

0 Kudos

649 Views
thomas_kopp
Contributor I

Hello Mark,

I am sorry i made a mistake, i don't use the KBOOT but the OpenSDA interface which allow me to flash the uTasker_XXX.bin file.

Regards,

Thomas

0 Kudos

649 Views
jorge_a_vazquez
NXP Employee
NXP Employee

Hi thomas kopp 

What MCU are you using? there should not be any problem to use UART_Tx with DMA and UART_Rx without it as long as the DMA supports independent DMA requests, for example in K64F

pastedImage_1.png

The UART_DMA example that is in the SDK uses only one callback because it manages both RX and TX with DMA, but if you remove the code that enables the DMA_Rx channel, then the driver should only create a handler for the Tx part.

Hope this helps
Have a great day,
TIC

-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

0 Kudos

649 Views
thomas_kopp
Contributor I

Hello Jorge,

Thanks for your help,

I am currently working on a FRDM_KV31F board.

I can't make it work with using the examples in the KSDK path (2.4). I tried many things but i think i miss a step.

I need to use RX with an interrupt every byte,  and the tx with the dma to send datas (all in non blocking mode).

If you see how to do it can you send me an example ?

Thanks in advance,

Have a great day,

Regards,

Thomas

0 Kudos

649 Views
mjbcswitzerland
Specialist V

Thomas

Rx DMA and Rx interrupt modes are very similar so if you just clear the RDMAS flag in UARTx_C5 it will switch a RX DMA setup to use interrupt instead. Then you just need to handle the interrupt in the interrupt routine (the DMA part may be set up will not do anything).

Regards

Mark


Kinetis: http://www.utasker.com/kinetis.html
Kinetis KV31:
- http://www.utasker.com/kinetis/TWR-KV31F120M.html
- http://www.utasker.com/kinetis/FRDM-KV31F.html

UART user's guide: http://www.utasker.com/docs/uTasker/uTaskerUART.PDF


For less questions and faster, cheaper developments: try uTasker for Kinetis

0 Kudos