cancel
Showing results for 
Search instead for 
Did you mean: 

STM32CubeMX UART LL Driver issues

Rajeev Arora
Senior

Hello,

I had earlier raised the concern on STM32CubeH7 GitHub page ( https://github.com/STMicroelectronics/STM32CubeH7/issues/69 ). However they asked me to raise the concern on this forum.

I am observing following function calls missing from MX_UART8_Init() function, even when ClockPrescaler, FIFO Mode Disabled, etc. are defined:

UART_InitStruct.PrescalerValue = LL_USART_PRESCALER_DIV10;
LL_USART_SetTXFIFOThreshold(UART8, LL_USART_FIFOTHRESHOLD_1_8);
LL_USART_SetRXFIFOThreshold(UART8, LL_USART_FIFOTHRESHOLD_1_8);
LL_USART_DisableFIFO(UART8);

Please refer to attached snippet which shows settings used in STM32CubeMX.

Please help with a fix.

Thanks,

Rajeev

8 REPLIES 8

Does UART8 support those features?​

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

Hello @Community member​ 

I am sure the FIFO Enable and Disable are supported.

I am sure TXFIFO and RXFIFO thresholds are supported.

The UART7 HAL driver does use Clock Divider and hence it must also be supported by UART8 LL Driver.

Regards,

Rajeev

Ok,

So CubeMX GUI allows options to be set for UART8

The LL code generator in CubeMX fails to output those specific options.

When you manually add the missing LL code in the project builds completely and functions as desired.​

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

Hello Rajeev Arora (CRC-Evans, Houston, Texas),

Thanks for your post.The issue has been detected. I have raised your feedback internally to be reviewed and treated accordingly to the priority. We will give you an update as soon as possible.

Thanks for your contribution.

Regards,

Khouloud.

TDK
Guru

Just as a note, the LL libraries are relatively new and way more untested than HAL. You're likely to keep running into issues like this. I used LL for a bit and ended up coming to the conclusion that it's simpler to just use direct register access. Using LL requires that you understand what is happening at the register level anyway. Up to you, of course.

If you feel a post has answered your question, please click "Accept as Solution".

In the below chain ST did confirm that this is an issue.

The issue may be visible when FIFO is enable.

Similarly it depends on the LL driver how it will calculate the baudrate, there can be occasions wherein the use of Prescaler for the divider is a must.

Hello @TDK​ 

I am using a third party provided library for STM32H753. The problem is that the certain exposed / codable functions need me to make changes to the CR1. CR2, etc. registers and add pieces of code to the UART / USART IRQ. Hence the only solution is to use the LL Driver.

Besides we prefer to use ST Tested code rather than coming up with new code. We think using the LL driver might help us move to a different processor (if need be) more easily.

Regards,

Rajeev

I would not assume any of this is rigorously tested. The SPL for the STM32 and STR9 prior, was written by a group much more tightly coupled with the IC design group.

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