2017-03-02 03:55 AM
Hello,
I'm developing my application based on the STM32L475.
One of my goals is power consumption so I will set the STM32 to Stop1 mode.
I have to work with UART and I2C so, to work in Stop1 mode I need the HSI16 to be setup with these peripherals to work at this low power mode.
Is it required to calibrate this HSI16 (X-CUBE-RC-CALIB) or is it enough with calibration that already comes with the micro?
I have LSE and HSE availables in my prototype, altough I think HSE will not be used if I want to get optimal power consumption figures.
Any other useful information related to this low power mode and clocks will be well wellcome.
Best regards.
#hsi16 #stop-mode #calibration #stm32l42017-03-02 08:38 AM
Hi Daniel,
The MSI and the HSI16 RC oscillators are factory-calibrated by ST to have an accuracy of [min -0.75 %, max 0.5 %] at TA = 30 °C.
After reset, the factory calibration value is automatically loaded in the internal calibration bits.But it is possible to fine-tune the frequency of the internal RC oscillators in order to achieve better accuracy with wider temperature and supply voltage ranges.The trimming bits are used for this purpose.Look at
to know more about this topic.In order to get more details about low power modes on STM32L4, please refer to
(STM32L4 ultra-low-power features overview).-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.
2017-03-03 03:41 AM
,
,
Hello,
First of all, thank you so much for your answer.
Furthermore, and being in the following situation (as described above):
, , , , , , , - Stop1 mode
, , , , , , , - I2C with HSI working
, , , , , , , - UART with HSI working
, , , , , , , , , , , , , ,- RTC periodic wake up
The aim is to save as much power as possible. For this we set micro to be at stop1 mode and it should wake up in the following situations:
, , , , , , , , , , , , , ,- Every 31,25ms, that is the time set for RTC to periodically wake up
, , , , , , , , , , , , , ,- If I2C or UART interruption is received
After having initialized all peripherals, I proceed in the following way, but it does not work... Any suggestion?
/* Ensure that HSI is wake-up system clock */
,
__HAL_RCC_WAKEUPSTOP_CLK_CONFIG(RCC_STOP_WAKEUPCLOCK_HSI),,
,
/* USER CODE END 2 *//* Infinite loop */
,
/* USER CODE BEGIN WHILE */,
,
while (1),
{,
/* USER CODE END WHILE */,
,
// Es realitzen les tasques adients i anem a dormir,
Tasques(),,
,
/* Enter STOP 1 mode =>, Mode de molt baix consum (treballem amb RTC) */,
/* Si estem en mode debug no dormim*/,
♯ ifndef EN_DEBUG,
if(T_equip.EstatMesuraVbat<,=AGR_VCC_MICRO_SETUP) //L'ADC no ha d'estar actiu per poder anar a dormir,
{,
HAL_RTCEx_DeactivateWakeUpTimer(&,H_RTC),,
HAL_RTCEx_SetWakeUpTimer_IT(&,H_RTC, 0x0040, RTC_WAKEUPCLOCK_RTCCLK_DIV16),,
,
HAL_I2CEx_EnableWakeUp(&,H_i2c1),,
,
HAL_PWREx_EnterSTOP1Mode(PWR_STOPENTRY_WFI),,
SYSCLKConfig_STOP(),,
},
♯ endif,
,
,
/* USER CODE BEGIN 3 */}
Best regards.