Hello Evgeny Erenburg,
I don't know what the board and kinetis chip you are using, and how you configure your uart module.
Actually, you can refer to our official code, there has a lot of uart code for kinetis, you can refer to the KSDK sample code which can be downloaded from this link:
Welcome to MCUXpresso | MCUXpresso Config Tools
SDK Builder, choose the board or chip which you are using, generate the code and download it.
Take KL25 as an example, you can find the uart code in folder:SDK_2.2_FRDM-KL25Z\boards\frdmkl25z\driver_examples\uart
Please refer to our official code at first.
If you still have question after you refer to it, please let me know!
Have a great day,
Kerry
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------