RTS of RS485 doesn't get low at first time

UART5 of Colibri iMX6D is configured to support RS485. Here is what I have added to device tree.

/* UART_E */
&uart5 {
	pinctrl-names = "default";
	pinctrl-0 = <&pinctrl_uart5_dte>;
	fsl,dte-mode;
	fsl,uart-has-rtscts;
	status = "disabled";
};


uart5 {
		pinctrl_uart5_dte: uart5grp-dte { /* DTE mode */
			fsl,pins = <
				MX6QDL_PAD_CSI0_DAT14__UART5_RX_DATA 0x1b0b1
				MX6QDL_PAD_CSI0_DAT15__UART5_TX_DATA 0x1b0b1
				MX6QDL_PAD_CSI0_DAT18__UART5_CTS_B 0x1b0b1
				MX6QDL_PAD_CSI0_DAT19__UART5_RTS_B 0x1b0b1
			>;
		};
	};

&uart5 {
	status = "okay";
	linux,rs485-enabled-at-boot-time;
};

The below program is used to receive data on UART5. RTS of UART5(SODIMM 177) doesn’t get low when the program runs at first time. It gets low only if the programs runs twice and it is fine in following test. This is the code.

#include <stdio.h>
#include <string.h>
#include <unistd.h>
#include <fcntl.h>
#include <errno.h>
#include <termios.h>
#include <sys/ioctl.h>
#include <asm/ioctls.h>

#include <linux/serial.h>

int main(void)
{
   char dev[] = "/dev/ttymxc4";
   char toreceive[64];
   struct serial_rs485 ctrl485;
   int status;
   int fd;
   int i;
   struct termios ti;
   speed_t speed;

   /* Open the port */
   fd = open(dev, O_RDWR);
   if (fd < 0) {
      printf("%s: Unable to open.\n", dev);
      return -1;
   }

   /* Set the port in 485 mode */
   ctrl485.flags = SER_RS485_ENABLED | SER_RS485_RTS_ON_SEND;
   /* delay */
   /*ctrl485.delay_rts_before_send = 0;
   ctrl485.delay_rts_after_send = 0;*/

   status = ioctl(fd, TIOCSRS485, &ctrl485);
   if (status) {
      printf("%s: Unable to configure port in 485 mode, status (%i)\n", dev, status);
      return -1;
   }

   /* Set the port speed */
   speed = B115200;
   tcgetattr(fd, &ti);
   cfsetospeed(&ti, speed);
   cfsetispeed(&ti, speed);
   /* write/read character by character */
   cfmakeraw(&ti);
   /* read command timeout */
   ti.c_cc[VMIN] = sizeof(toreceive);
   ti.c_cc[VTIME] = 1;
   /* save configuration */
   tcsetattr(fd, TCSANOW, &ti);
   
   printf("read command\n");
   
   /* Read content to RS485 */
   status = read(fd, toreceive, sizeof(toreceive));
   
   printf("received string:\n");
   for(i = 0; i < status; i++)
	   printf("%c ",toreceive[i]);
   printf("\n");

   sleep(1);

   close(fd);

   return 0;
}

The RTS can get low on UART2 with the same program even at the first time.