cancel
Showing results for 
Search instead for 
Did you mean: 

STM32L433: Low level driver and Comparator startup time

Paolo Andreuzza
Associate II
Posted on November 16, 2017 at 15:19

Hallo. I'm working in a STM32L433 and I'm using CubeMX tool to generate the initialization code.

I have a question regarding the comparators' Low level driver.

Although I'm using both comparator input pin (In+ and In-) connected to external port, and so I don't use the internal voltage reference, the  low level driver keep the time wait for voltage scaler stabilization, but the internal voltage reference is off and the 'SCALEN' bit in 'COMP1_CSR' register is set to 0.

This is a low power application so I have should return in standby mode as quickly as I can, so I shouldn't wait this startup time if it weren't neccessary.

Am I doing something wrong or it is a kind of bug in low level driver? Is there any configuration to inform CubeMX to not add the wait cycle?

How can I bypass the issue and, eventually, how can I give feedbak about this bug (If it were).

Sorry for my english and thank you in advance.

Paolo

This is the generated code block:

void MX_COMP1_Init(void)

...cut...

 /* Wait loop initialization and execution */

 /* Note: Variable divided by 2 to compensate partially CPU processing cycles */

 __IO uint32_t wait_loop_index = 0;

  wait_loop_index = (LL_COMP_DELAY_VOLTAGE_SCALER_STAB_US * (SystemCoreClock / (1000000 * 2)));

  while(wait_loop_index != 0)

  {

    wait_loop_index--;

  }

  LL_EXTI_DisableEvent_0_31(LL_EXTI_LINE_21);

  LL_EXTI_DisableIT_0_31(LL_EXTI_LINE_21);

}

2 REPLIES 2
Amel NASRI
ST Employee
Posted on November 30, 2017 at 15:40

Hi

paolo.andreuzza

‌,

Thanks for sharing your case.

I will report the error to our CubeMX team who should make a deeper analysis and provide the needed fix for generated code in coming versions.

-Amel

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.

Posted on December 01, 2017 at 08:52

Many thanks, Amel.

It's great to see a company actively monitoring their forums for issues and suggestions.

Paolo