Skip to main content
Peter BENSCH
Technical Moderator
March 17, 2023
Solved

STM32CubeMX 6.8.0 and STM32CubeIDE 1.12.0: bug in the use of LL

  • March 17, 2023
  • 3 replies
  • 3965 views

Currently, STM32CubeMX 6.8.0, including the one used in CubeIDE, generates an incorrect comparison when using the low layer library (LL) for reset and clock control (RCC) in a project. This happens when you change the peripheral module RCC from HAL to LL in Project Manager > Advanced Settings by clicking on the relevant line and then selecting LL.

void SystemClock_Config(void)
{
 LL_FLASH_SetLatency(LL_FLASH_LATENCY_1);
 while(LL_FLASH_GetLatency()!= LL_FLASH_LATENCY_1)
 {
 }
 LL_PWR_SetRegulVoltageScaling(LL_PWR_REGU_VOLTAGE_SCALE***);
 while (LL_PWR_IsActiveFlag_VOS() == 0) // <-- to be corrected
 {
 }

Explanation:

LL_PWR_SetRegulVoltageScaling() sets bits VOS in PWR_CR1,

LL_PWR_IsActiveFlag_VOS() checks the corresponding bit VOSF in PWR_SR2:

Typically, the return value 0 stands for OK or HAL_OK, so LL_PWR_IsActiveFlag_VOS() returns the correct value, but STM32CubeMX inserts the wrong comparison so that the while loop is never exited on OK.

Temporary fix until this is corrected: after each generation of the code by STM32CubeMX, the mentioned comparison in SystemClock_Config() has to be corrected manually from == 0 to !=0 (line 8 in the snippet mentioned above).

We are very sorry if this is causing you any inconvenience at the moment. We will fix the problem as soon as possible.

This topic has been closed for replies.
Best answer by Diane POMABIA

Thank you all for your contributions and your detailed explanations.

Issue is reproduced and it has been reported to STM32CubeMX development team .

Internal tickets number: 147617 and 147621 (This is an internal tracking number and is not accessible or usable by customers).

Regards

Diane

3 replies

ST Employee
March 17, 2023

Hello @Peter BENSCH​ 

Can you give me more details about your Workspace (Compoment, Firmware package name and version )

Regards

Diane P

Senior II
March 17, 2023
Peter BENSCH
Technical Moderator
March 17, 2023

@t.decker​ Thanks for pointing out the other thread where it is already in progress.

Diane POMABIABest answer
ST Employee
March 17, 2023

Thank you all for your contributions and your detailed explanations.

Issue is reproduced and it has been reported to STM32CubeMX development team .

Internal tickets number: 147617 and 147621 (This is an internal tracking number and is not accessible or usable by customers).

Regards

Diane

jhgorse
Associate II
December 3, 2023

Diane,

When is the fix expected to be released?

How will you communicate status in the meanwhile?

Cheers,
Joe