cancel
Showing results for 
Search instead for 
Did you mean: 

STM32L562, dynamically modify serial port configuration.

MShao.1
Associate III

Excuse me, how to gracefully and effectively change the TX pin "inversion" of usart3 during the operation of MCU program?

In addition, can I ask questions in Chinese? Every question needs the cooperation of translation software. I'm afraid there will be some inappropriate wording.

2 REPLIES 2
MShao.1
Associate III
__HAL_UART_DISABLE(&huart3);
USART3->CR2 |= (1 << 17);
__HAL_UART_ENABLE(&huart3);

0693W00000D1H1oQAF.jpg

Yes, you need to clear the UE bit in CR1 to change change critical settings, like this or baud rate (BRR). But be careful when you do this, make sure you're not in the middle of sending a byte, etc.

>>In addition, can I ask questions in Chinese?

You're going to get relatively limited responses/participation. But Yes, post in your own language first, translation software is getting a lot better and most experts here are comfortable using it. Similarly expect responses in the native language of the responder.

The more thoroughly you can describe your problem, context and situation in your native language the easier it will be to pick through the translation.

If you provide your own translation following the native text, this might help understand the information that gets conveyed.

Thankfully we don't have any grammar/spelling police here, so don't worry about if the exact spelling and word usage are wrong or awkward.

Having English in the Title/Summary will help those scanning posts.

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..