Skip to main content
PBogu.475
Associate
August 13, 2020
Solved

Bug: LL UART Generated code enables UART before calling LL_USART_SetTXRXSwap.

  • August 13, 2020
  • 2 replies
  • 1097 views

Steps to reproduce:

Enable asynchronous UART

Enable Tx and Rx pins swapping

Select LL driver instead of HAL.

Code generated at end of MX_UART4_Init:

LL_USART_Enable(UART4);
 LL_USART_SetTXRXSwap(UART4, LL_USART_TXRX_SWAPPED);

Reference manual states pins must be swapped before UART is enabled.

This topic has been closed for replies.
Best answer by Guenael Cadier

I confirm the issue, even while using 6.0.0 (my previous post was wrong).

Some initialisation parameters are taken into account prior calling LL_USART_Enable(UART4), but not all.

I will report the bug to STM32CubeMx team in order to solve it in next release.

Regards

2 replies

Guenael Cadier
ST Employee
August 14, 2020

Hello @PBogu.475​ 

What is your CubeMx version and on which STM32 are you working ?

I tried to reproduce your issue using CubeMx 6.0.0 on STM32G4, and I don't observe similar generated code than you (LL_USART_Enable() call is placed after TxRXswap setting).

Regarding the sequence, you're absolutely right : Tx/Rx setting should be done prior UE bit enabling.

If your are already using latest CubeMx version, please let me know your STM32 serie, and i will raise an internal error report, for solving this sissue.

Regards

PBogu.475
PBogu.475Author
Associate
August 14, 2020

I am not using the latest version. I'm using 5.6.1 with the STM32F745VETx.

Thank you,

Guenael Cadier
Guenael CadierBest answer
ST Employee
August 17, 2020

I confirm the issue, even while using 6.0.0 (my previous post was wrong).

Some initialisation parameters are taken into account prior calling LL_USART_Enable(UART4), but not all.

I will report the bug to STM32CubeMx team in order to solve it in next release.

Regards