In our case the serial port receives data before it is initialized correctly (baudrate, etc.). This is usually solved with a
tcsetattr(). But with the current BSP2.8 kernel there still seems to be bogus data in the FIFO. Shouldn’t
lpuart_flush_buffer() in the fsl_lpuart device driver flush the UART FIFO buffers?
writeb(UARTCFIFO_TXFLUSH | UARTCFIFO_RXFLUSH, sport->port.membase + UARTCFIFO);