2023-03-17 05:36 AM
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.
Solved! Go to Solution.
2023-03-17 06:37 AM
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
2023-03-17 06:02 AM
Hello @Peter BENSCH
Can you give me more details about your Workspace (Compoment, Firmware package name and version )
Regards
Diane P
2023-03-17 06:17 AM
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
2023-03-17 06:21 AM
@t.decker Thanks for pointing out the other thread where it is already in progress.
2023-03-17 06:37 AM
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
2023-12-02 11:33 PM
Diane,
When is the fix expected to be released?
How will you communicate status in the meanwhile?
Cheers,
Joe
2023-12-04 12:18 AM
Your answer is actually not a solution. A solution is either the first post here, or an actual fix in the next version.