cancel
Showing results for 
Search instead for 
Did you mean: 

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

Peter BENSCH
ST Employee

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.

In order to give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.
1 ACCEPTED SOLUTION

Accepted Solutions
Diane POMABIA
ST Employee

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

View solution in original post

6 REPLIES 6
Diane POMABIA
ST Employee

Hello @Peter BENSCH​ 

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

Regards

Diane P

t.decker
Senior II

This behaviour was already mentioned in this topic: Update to CubeMX 6.8 adds non-working VOSRDY flag check to SystemClock_Config() on STM32F7 using LL drivers

When this account seems to be inactive, try @tdecker2 - ST can't change mail addresses, so I had to create a new account.

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

In order to give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.
Diane POMABIA
ST Employee

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

Diane,

When is the fix expected to be released?

How will you communicate status in the meanwhile?

Cheers,
Joe

Your answer is actually not a solution. A solution is either the first post here, or an actual fix in the next version.