Dear user,
do you use any of KV30 evaluation boards or your custom board? I'm sorry I'm not aware about any NXP evaluation board which uses RS485 bus driver connected on UART module.
Also, we have made no FreeMASTER tests with RS485 yet, so all my comments are just theoretical. I assume you have a RS485 two-wire communication. You can describe your hardware in more details in your reply.
Theoretically, the FreeMASTER driver which is available in MCUXpresso SDK is ready to support such direction switching. You only need to modify the EnableTransmit and EnableReceive methods of the low-level driver and make sure the low-level driver supports the EnableTransmitCompleteInterrupt properly.
For KV30, the low-level UART driver is (I think) the freemaster_serial_uart.c in drivers/mcuxsdk/serial directory. You will need to modify the _FMSTR_SerialUartEnableTransmit and _FMSTR_SerialUartEnableReceive methods.
You may notice there already is some "direction switching" code which is conditionally compiled when FMSTR_SERIAL_SINGLEWIRE is set. But note that this mode is NOT good in the RS485 case. This mode is used for internal single-wire operation as it is directly supported by the UART module.
Regards,
Michal
Thank you, sir
I enabled RXRTS, and used automatic RTS control referred from below link.
It works.