cancel
Showing results for 
Search instead for 
Did you mean: 

STM32L071 comperator vrefint bug in HAL and Ref Manual

Tobias Wedell
Associate II
Posted on January 09, 2017 at 11:41

Hi,

I have found a bug for STM32L071xx series in using the comperators with vrefint in the actual Reference Manual V7.0 and the actual HAL STMCubeL0 V.1.7.0:

When selecting the the vrefint for the comperator minus input the comperator is not working as expected and triggers at random values.

In the Reference Manual is said (Page 325):

Note: If VREFINT or a fraction of VREFINT (using the scaler) is selected, then EN_VREFINT

bit must be set in the SYSCFG_CFGR3 register (see

Section 9.2.3: Reference control

and status register (SYSCFG_CFGR3)

).

But the EN_VREFINT is not set by the HAL in the function HAL_COMP_Init.

Further in the Reference Manual (Page 235):

Note: It is forbidden to configure both EN_VREFINT and ULP to 1 if the device is in Stop

mode or in Sleep/Low-power sleep mode (refer to

Section 6.4.1: PWR power control

register (PWR_CR)

for a description of the ULP bit). If the device is not in low-power

mode, VREFINT is always enabled whatever the state of EN_VREFINT and ULP.

This is not correct. In my test the VREFINT is not enabled for the comperator when the MCU is in RUN Mode.

As a workaround I enabled the the EN_VREFINT bit manually with:

SET_BIT(SYSCFG->CFGR3, 1);

 

 

Now the comperator is working as expected with VREFINT as minus input (only tested COMP2).

Additionally the bit 29 in SYSCFG_CFGR3 is set to 1. But don't now what it means because the bit name is 'Res.'.

Be aware that you reset the EN_VREFINT bit before entering stop mode otherwise the power consumption in stop mode is much higher. Setting the ULP bit in PWR_CR Register is not working for me. But it has to be set to get the a low power consumption in stop mode.

Please check this and confirm.

Best regards,

Tobias Wedell

#vrefint #bug #reference-manual-error #hal-bug #stm32l071
12 REPLIES 12
Imen.D
ST Employee
Posted on January 13, 2017 at 12:11

Dear

Wedell.Tobias

‌,

Thank you for posting this issue and how you fixed it.

This reported problem isconfirmed and will be fixed in next releases of HAL driver.

We apologize for any inconvenience this may cause and thank you for your understanding.

Regards

ImenD

When your question is answered, please close this topic by clicking "Accept as Solution".
Thanks
Imen
Posted on January 13, 2017 at 12:25

And what about the issue with the reference manual Tobias mentioned in the second part of his post?

Documentation first, please.

JW

Tobias Wedell
Associate II
Posted on January 23, 2017 at 13:13

Hi,

is this issue fixed in the new STMCubeL0 V1.8.0 release?

Regards

Tobias Wedell

Posted on January 30, 2017 at 14:18

Hi

Wedell.Tobias

‌,

This issue is reported after release of the STM32CubeL0 V1.8.0 (25 November 2016).

It will be fixed in the coming version of L0 HAL driver.

Regards

Imen

When your question is answered, please close this topic by clicking "Accept as Solution".
Thanks
Imen
Posted on March 17, 2017 at 04:36

I just burnt a whole lot of time on this issue!  I also found that setting bit 0 in SYSCFG->CFGR3 enabled the regulator.  Can someone please clarify for me if this bit can or cannot be left set in stop mode?  I want the reference enabled in stop mode so I can use the comparator to wake up.

Thanks

Ashley

Schmid.M.
Senior
Posted on September 21, 2017 at 16:50

This Bug has just cost us one full day of engineering hours. We are using the latest HAL V1.10 and still nothing is fixed. thank you ST.

Posted on September 21, 2017 at 17:31

 ,

 ,

https://community.st.com/0D70X000006SsXtSAK

 ,
Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
Posted on January 08, 2018 at 15:27

Hi Imen,

do you have any plan when the issue will be fixed? I'm waiting for it to upgrade my project to the latest firmware.

Best regards

Posted on January 09, 2018 at 14:52

Hello,

After check with the development team, we would inform you that EN_VREFINT bit will be reintroduced in SYSCFG_CFGR3 register in the next release of STM32L0 Firmware package.

Just keep an eye out for the next update!

Best Regards,

Imen

When your question is answered, please close this topic by clicking "Accept as Solution".
Thanks
Imen