Skip to main content
MShao.1
Associate III
August 2, 2021
Question

STM32L562, dynamically modify serial port configuration.

  • August 2, 2021
  • 2 replies
  • 1119 views

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.

This topic has been closed for replies.

2 replies

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

0693W00000D1H1oQAF.jpg

Tesla DeLorean
Guru
August 2, 2021

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 (See Profile) Up vote any posts that you find helpful, it shows what's working..