I am using all UARTS on kinetis K64F to control several peripherals. I created a baremetal drivers based on KSDS 1.2 to handle the uarts. This lib initializes uarts that have eDMA channels using fsl_uart_edma_driver.h just like the uart_edma_non_blocking_example_frdmk64f example.
There are a few changes though. I replaced the RX Interruption Handler function, and I changed the interruption priority to avoid conflict with the RTOS timer.
All the UARTs sends data fine using the KSDK functions, but only uart 0 receives data from the peripheral. And I don't see a reason for that, since I am initializing all the UARTs the same way and making sure the indexes and variables are correct for each UART.
Bellow is the important part of the initiation code.
The Global Variables are declared on an external config file, but the general types can be seen bellow. All the Arrays have the same number of positions as there are UARTs on the microcontroller.
The PinConfigTable declares how to initialize the Port Mux, the PortConfig included de configuration of baud and etc, Port Instance has the UART Instance.
At the initialization code, PortId is used as an index for my configuration tables, while the portInstance is the instance of device UART. On the code bellow I initialize the UART with EDMA.
Here is the part where I configure the RX pin. First the PortMux is enabled and configured, and than my callback is used to replace the KSDK one so I can handle the incoming data on my way. After setting the channel priority I start the receiving process.
It works fine for all the TX channels, and for the UART 0 RX, but the other RX channels do not work. As I checked, changing the priority and not installing the callback does not affect the result. The eDMA RX interruptions simply dont fire.
Any guess on what might be causing this behavior?
I just edited the KSDK example mentioned above to work with UART1, and I have exactly the same behavior. Even using the FRDM K64F, with no changes on clock, interruptions, and any other configurations, the RX do not work.
Edited the KSDK example to work with UART 2 and eDMA and it worked fine on both the FRDM board and on my prototype. I believe its some clock configuration that is not working properly. I use the clock configuration bellow declared on system_MK64F12.h version 2.5.
0 ... Default part configuration
Multipurpose Clock Generator (MCG) in FEI mode.
Reference clock source for MCG module: Slow internal reference clock
Core clock = 20.97152MHz
Bus clock = 20.97152MHz
Does this affect the DMA?