Hello,
We developed a communication module using IMX6U processor.For a current project, we need to make the communication module communicate with an industrial machine through RS232 bus. The communication protocol of the machine uses MARK and SPACE check (note: MARK means parity bit =1;SPACE for parity bit =0), but we found that the IMX processor does not support this option.What we do:
1. We found that the universal serial port driver of Linux implements MARK/SPACE check by utilizing the mandatory parity selection function provided by the SP in bit 5 of the UART_LCR register (address offset 0x0C) of the standard UART.However, we also found that IMX UART does not have the same option to provide this functionality in UART_UCR2 register.
2. We note that the IMX processor provides a 9-bit frame function called RS485 mode. Using this mode (UMCR=1), we modify the imx_set_termios function of the driver/tty/serial/ imx.c to enable the RS485 function when MARK/SPACE is selected through tcsetattr entry in Linux.We found that we could send the data frame with MARK and SPACE check correctly, but we could not receive the response frame from the machine (the machine did send the correct response frame), because the RS485 reception of the IMX processor limited the first byte to be MARK check (it defined it the address byte).But the response frame from our machine is SPACE parity format.So the data was ignored.
3. We tried to use RS485 mode when sending data frames and RS232 mode when receiving data, but we still could not receive data. Of course, the reason is that RS232 mode cannot provide SPACE parity check.
As above, is there any other solution to solve our problem?
Looking forward to your reply.Thanks!