cancel
Showing results for 
Search instead for 
Did you mean: 

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

PBogu.475
Associate

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.

1 ACCEPTED SOLUTION

Accepted Solutions

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

View solution in original post

3 REPLIES 3
Guenael Cadier
ST Employee

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
Associate

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

Thank you,

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