STMicroelectronics / STM32CubeL0

STM32Cube MCU Full Package for the STM32L0 series - (HAL + LL Drivers, CMSIS Core, CMSIS Device, MW libraries plus a set of Projects running on all boards provided by ST (Nucleo, Evaluation and Discovery Kits))
Other
103 stars 57 forks source link

Introduction of LL_PWR_IsActiveFlag_VOS() call in SystemClock_Config is causing freeze on start #31

Closed gospawel closed 1 year ago

gospawel commented 1 year ago

Setup - custom PCB using STM32L011G4 micro. IDE - 1.12.0 STM32CubeMX V6.8.0 STM32Cube FW_L0 V1.12.1

With latest upgrade using MX while I was changing size of the heap I was asked if I want to migrate the to latest STM32Cube firmware (6.8.0 I guess) and the code suddenly stopped working in debug. I found that it is forever locked in SystemClock_Config function in below line:

while (LL_PWR_IsActiveFlag_VOS() == 0) { }

I then checked that this line is not present if I re-generate the code using .ioc from previous commit which is using 6.7.0 version without migrating it.

I am using LL drivers for everything.

attached below is the the offending function generated by V6.8.0:

/**

gospawel commented 1 year ago

Update: The process is like this: the code changes the internal regulator voltage to 1.8V in line: LL_PWR_SetRegulVoltageScaling(LL_PWR_REGU_VOLTAGE_SCALE1);

processor reacts by doing what it needs and in the next line we have waiting for a confirmation that the change has taken place: while (LL_PWR_IsActiveFlag_VOS() == 0) { }

problem is that LL_PWR_IsActiveFlag_VOS() is returning the value of the flag VOSF - and this one is set to '1' on change and then drops back to '0' when hardware gets the stable voltage. Therefore - waiting while the flag is '0' will cause what I have - permanent stop.

HBOSTM commented 1 year ago

Hello @gospawel ,

The issue you reported has been logged into an internal bug tracker, it will be managed by the development team. A similar issue has also been previously reported by another user. Nevertheless, this issue is related to the CubeMX generation problem and not to the firmware published in this repository. Issues related to the CubeMx tool are rather treated at the STM32CubeMX dedicated the page of the ST Community. With regards,

Best Regards,

HBOSTM commented 1 year ago

ST Internal Reference: 148076

TOUNSTM commented 1 year ago

Hi @gospawel,

Thank you for your contribution. You are absolutely right about this point. Actually, the point you raised has already been dealt and fixed internally. The fix will be made available in the frame of a future release of CubeMX.

Unfortunately we don't treat aspect related to CubeMX tool in our GitHub repositories. They are rather treated at the STM32CubeMX dedicated page of the ST Community.

Since this issue is not directly related to the STM32Cube firmware but rather to our ecosystem, please allow me then to close this thread. Thank you for your comprehension.

With regards,

jjx591 commented 1 year ago

@gospawel Hello, I have the same problem as you and want to know how you solved it in the end?

Best Regards,

gospawel commented 1 year ago

@jjx591 - the only way I found to work around is to manually comment out the offending part of the function - every time I re-generate the code from .ioc file I just comment out manually these 3 lines of void SystemClock_Config(void) function:

while (LL_PWR_IsActiveFlag_VOS() == 0) { }

jjx591 commented 1 year ago

@gospawel Thank you, I just found a temporary solution given by ST company, you can refer to it https://community.st.com/s/question/0D53W00002BefFcSAJ/stm32cubemx-680-and-stm32cubeide-1120-bug-in-the-use-of-ll