I am currently running into the problem that the UART DMA for receiving bytes sometimes does not receive any bytes even though they are received by the hardware.
We are using the microcontroller MK66FN2M0VLQ18 with all the drivers from SDK_2.3.0_FRDM-K66F. Our code follows the code of the K66F evaluation board from the driver examples called edma_transfer. The UART interface is used to communicate with a display module where it acts as a "serial slave".
We also have a bootloader in place that is called upon start. If new firmware is present to the bootloader, it updates the Flash of the microcontroller and informs the user during the update process with the display module by showing an image and some text. This is done by the simple UARTBlocking write and read commands because the bootloader is not time critical. As soon as the bootloader finishes updating the application, it jumps to the application. Inside the application we then use the UART EDMA transfer because we have a time critical system and the functions should be all non-blocking.
In the initialization of the display module a startup image is shown on the screen with UART commands. Every command send to the display module is acknowledged by the display module with the byte pattern 0x06.
Now it sometimes happens that the updating process gets stuck because the microcontroller does not receive the ACK from the screen and the application stops. After inspection I found out, that the signals on the UART line appear as expected (measuring with an oscilloscope) but they are not received by the DMA. If I try to find the problem inside the driver, I see that the DMA receive interrupt is triggered but the buffer to store the receive variables is filled with zero. Afterwards, I even try to abort the current transfer and resend the commands, but it still does not fill the buffer. I also tried to reset the communication port by reinitializing again:
We only run into the problem when we call the UARTBlocking read and write functions during the bootloader step and the problem also does not occur consistently (maybe every third time). I transferred the bootloader part that communicates with the display module to the application to get rid of all the unknown parameters from the bootloader. This also allows me to debug the code better. The problem still occurs as described before so it has to do something with calling the UART Blocking functions and afterwards the UART EDMA functions.
Because I do not want to touch the drivers from the SDK and expect them to be working I am asking for your help here.
Has someone had problems with the DMA RX line before and can maybe help me? Or is this problem known to NXP?
Thank you for your time and I am looking forward to hear from you.