不是有参考工程吗? https://canaan-docs.100ask.net/Application/CommunicationPeripherals/01-UARTUSerGuide.html#_2-uart的进阶使用