AnsweredAssumed Answered

System freeze when using UART with DMA enabled

Question asked by Danyil Stas on May 6, 2019
Latest reply on May 7, 2019 by igorpadykov

Hi, we are trying to enable DMA for communication via UART in rs485 mode.

We are using IMX6ULL processor on a custom board. We have build the linux kernel (v4.20.x) from this repository GitHub - Freescale/linux-fslc at 4.20.x+fslc with SDMA firmware found in Linux Binary Demo Files provided here: i.MX Software | NXP (we also tried the firmware from here sdma\imx - kernel/git/firmware/linux-firmware.git - Repository of firmware blobs for use with the Linux kernel )

The DMA is enabled in device tree like this:

 

sdma: sdma@20ec000 {                                   
  compatible = "fsl,imx6ul-sdma", "fsl,imx6q-sdma",    
         "fsl,imx35-sdma";                             
  reg = <0x020ec000 0x4000>;                           
  interrupts = <GIC_SPI 2 IRQ_TYPE_LEVEL_HIGH>;        
  clocks = <&clks IMX6UL_CLK_SDMA>,                    
     <&clks IMX6UL_CLK_SDMA>;                          
  clock-names = "ipg", "ahb";                          
  #dma-cells = <3>;                                    
  fsl,sdma-ram-script-name = "imx/sdma/sdma-imx6q.bin";
};                                                    

 

uart4: serial@21f0000 {                         
  compatible = "fsl,imx6ul-uart",               
         "fsl,imx6q-uart";                      
  reg = <0x021f0000 0x4000>;                    
  interrupts = <GIC_SPI 29 IRQ_TYPE_LEVEL_HIGH>;
  clocks = <&clks IMX6UL_CLK_UART4_IPG>,        
     <&clks IMX6UL_CLK_UART4_SERIAL>;           
  clock-names = "ipg", "per";                   
  status = "disabled";                          
};                                             

 

&uart4 {
  pinctrl-names = "default";
  pinctrl-0 = <&pinctrl_uart4>;
  uart-has-rtscts;
    dmas = <&sdma 31 4 0>,
                 <&sdma 32 4 0>;
    dma-names = "rx", "tx";
  status = "okay";
};

 

It works fine for 10-20 minutes but then the UART or the whole system hangs without any special output to debug console.

 

We also tried to run our software on the demo image from Linux Binary Demo Files (i.MX Software | NXP ) for IMX6ULL  (fsl-image-validation-imx-imx6ul7d.sdcard) with u-boot-imx6ull14x14evk_sd.imx. But then the system hangs after the first time function tcdrain() is called.

 

Can anyone advice how can we solve this issue?

Outcomes