Skip to main content
Senior II
March 8, 2023
Solved

Update to CubeMX 6.8 adds non-working VOSRDY flag check to SystemClock_Config() on STM32F7 using LL drivers

  • March 8, 2023
  • 6 replies
  • 2967 views

Hi, I have a STM32F767 project I recently updated to new software release: CubeIDE 1.12, CubeMX6.8 (both from previous versions 1.11.x and 6.7). CubeMX code generator now adds a check for flag VOSRDY after setting regulator voltage scaling in SystemClock_Config():

LL_PWR_SetRegulVoltageScaling(LL_PWR_REGU_VOLTAGE_SCALE1);
while (LL_PWR_IsActiveFlag_VOS() == 0)
{
}

Before CubeMX 6.8 this was only the set function:

LL_PWR_SetRegulVoltageScaling(LL_PWR_REGU_VOLTAGE_SCALE1);

But the flag is never set at this stage. When I remove the check, my program runs fine again.

I also created an emtpy project based on my .ioc (just deactivated ETH, USB, FreeRTOS, TouchGFX, USB and lwIP). No additional code, just the CubeMX generated code: Same behaviour! I can provide the project when needed.

My observation of the PWR->CSR1->VOSRDY flag: It starts as 0 and gets only set to 1 later in the SystemClock_Config() function when calling

LL_RCC_PLL_Enable();

Can someone have a look at this please? ;)

This topic has been closed for replies.
Best answer by Ghofrane GSOURI

Hello all, @t.decker​ @FGerh.2​  @Piranha​  @Pavel A.​ 

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).

I will keep you posted with updates.

Thx

Ghofrane

6 replies

FGerh.2
Visitor II
March 9, 2023

Same thing happened to me on STM32L0 after updating to STM32Cube MCU Package for STM32L0 Devices v1.12.2.

After this update, when using LL driver for RCC, there is a change in SystemClock_Config() in main.c from

LL_PWR_SetRegulVoltageScaling(LL_PWR_REGU_VOLTAGE_SCALE1);

to

 LL_PWR_SetRegulVoltageScaling(LL_PWR_REGU_VOLTAGE_SCALE1);
 while (LL_PWR_IsActiveFlag_VOS() == 0)
 {
 }

I think this code is supposed to wait for the VOS flag in PWR_CSR which signalizes that the power regulator voltage range was successfully changed. However, according to the datasheet, the VOS flag is 1 while the voltage is changing and goes to 0 when the voltage range change is done.

Therefore, I believe the logic here is accidentally switched and the code should stay blocked while the VOS flag is 1 instead of 0.

t.deckerAuthor
Senior II
March 9, 2023

Hi FGerh.2,

according to the reference manual, logic is correct for the F7 family. But yes, for the L0 the level seems switched. The flag is also called differently (VOSF vs. VOSRDY).

In my case, the flag is just not set while waiting for it. For whatever reason this happens only later, when this check is skipped.

Maybe it's also not a good idea to call the LL API function LL_PWR_IsActiveFlag_VOS when the checked register flag has a different name?

Piranha
Principal III
March 12, 2023

RM0410 Rev 4

4.4.1 PWR power control register (PWR_CR1)

Bits 15:14 VOS[1:0]: Regulator voltage scaling output selection

These bits can be modified only when the PLL is OFF. The new value programmed is active only when the PLL is ON. When the PLL is OFF, the voltage scale 3 is automatically selected.

I'm saying it all the time - the HAL/Cube "developers" do not read the documentation...

Pavel A.
Super User
March 13, 2023

The really sad thing is that they miss regression testing.

Ghofrane GSOURI
Ghofrane GSOURIBest answer
Technical Moderator
March 15, 2023

Hello all, @t.decker​ @FGerh.2​  @Piranha​  @Pavel A.​ 

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).

I will keep you posted with updates.

Thx

Ghofrane

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.
WGend.15
Associate II
March 31, 2023

I am also experiencing the issue with a STM32F410, seems like not just the F7 is affected

Karnigen
Visitor II
April 3, 2023

Same problem with STM32F411