2021-08-31 12:29 PM
Let me see if I've understood. I'm using STM32CoreWL for LoRaWAN end-node implementation, where I need to insert my sensors. As specified on AN5406, the low power modes are activated by UTIL_SEQ_Idle(), when the sequencer has nothing to do.
So there are no active low power modes processes called by the sequencer (!?).
My sensor reading routine is called inside SendTxData(). I need a pulse with a defined duration. The routine sets the needed GPIO but it doesn't reset it at the right times like if the timer was ignored.
All work if I set #define LOW_POWER_DISABLE to 1. I'm using TIM16 for a resolution of uS.
Even reading (and reading again) the application notes regarding sequencer and low power modes, I'm not able to control my applications.
How to disable (or manage) temporally, for the time needed, the low power mode? I need help.
F.
2021-09-02 05:23 AM
No one can help me?
2021-09-02 06:38 AM
Looking that way..
Perhaps try your local ST sales office and FAE, they might be able to provide support, or a list of contractors providing paid support.
Couldn't you use a TIM in OPM (One Pulse Mode) to generate a one-shot pulse?
2021-09-07 05:24 AM
Hi @FRest.1 ,
By default, the application goes in stop2 mode when system is idle.
to disable stop2, you can indeed set #define LOW_POWER_DISABLE to 1. In this case, system will enter sleep mode when idle.
you may find relevant info at:
1- be aware that In stop2, all peripherals are not retained and may need reinitialization at stop2 exit,
2- Also, In stop2, the TIM16 will stop running, therefore the system will not wake up on a TIM16 interrupt. (LPTIM still run in stop2)
2021-09-07 07:13 AM
@YBOUV.1 , thank you for your reply. I've found the solution to my problem (at least I think so, I've to make more tests).
As you have guessed, my knowledge of STM21 architecture is poor.
In the end, I simply had to read the CPU's manual about low power mode and TIMx management (RM0453, RTFM, just 1461 pages, not all read, o course).
As you mentioned the TIM registers are not retained, so I've added a call to MX_TIM16_Init() on PWR_ExitStopMode() function to restore them.
I cannot use LPTIM because I need a uS timer for pulse duration measurement (or I'm wrong?).
If I'll have more info about that problem I'll post them.
F.