Cannot enter stm32l4's low-power modes

2022-06-14 Thread Jesse Jensen
Hello,

I am using the STM32L4 (nucleo-l476rg board) and am attempting to enter the
mcu's low-power modes (i.e. Stop1, Stop2, Standby). Within stm32_idle.c
under PM_IDLE, I send the "wfi" command to send the device into sleep.
However, when measuring the current draw of the mcu, I can see that the
device is drawing much more power than it should be from any of the
low-power modes. It appears that it is either not entering the low-power
modes or is quickly woken out of them. I have enabled Tickless OS using its
interval timer to prevent scheduler interrupts that would bring the device
out of lp modes. Is there something that I am missing?

Below are my configurations that seemed relevant to the problem at hand.

CONFIG_STM32L4_TIM2=y
CONFIG_STM32L4_TIM5=y

#
# Timer Configuration
#
CONFIG_STM32L4_ONESHOT=y
CONFIG_STM32L4_FREERUN=y
CONFIG_STM32L4_TICKLESS_ONESHOT=2
CONFIG_STM32L4_TICKLESS_FREERUN=5
CONFIG_STM32L4_ONESHOT_MAXTIMERS=1

#
# Clocks and Timers
#
CONFIG_ARCH_HAVE_TICKLESS=y
CONFIG_SCHED_TICKLESS=y
# CONFIG_SCHED_TICKLESS_ALARM is not set
CONFIG_SCHED_TICKLESS_LIMIT_MAX_SLEEP=y
CONFIG_USEC_PER_TICK=1
# CONFIG_SYSTEM_TIME64 is not set
# CONFIG_ARCH_HAVE_TIMEKEEPING is not set
# CONFIG_JULIAN_TIME is not set
CONFIG_START_YEAR=2018
CONFIG_START_MONTH=1
CONFIG_START_DAY=1
CONFIG_PREALLOC_TIMERS=4

#
# Buffering
#
# CONFIG_DRVR_WRITEBUFFER is not set
# CONFIG_DRVR_READAHEAD is not set
# CONFIG_ARCH_HAVE_SDIO is not set
# CONFIG_ARCH_HAVE_SDIOWAIT_WRCOMPLETE is not set
# CONFIG_ARCH_HAVE_SDIO_PREFLIGHT is not set
# CONFIG_MMCSD is not set
# CONFIG_MODEM is not set
# CONFIG_MTD is not set
# CONFIG_EEPROM is not set
# CONFIG_EFUSE is not set
# CONFIG_PIPES is not set
CONFIG_PM=y
CONFIG_PM_NDOMAINS=1
CONFIG_PM_GOVERNOR_GREEDY=y
# CONFIG_PM_GOVERNOR_ACTIVITY is not set

#
# Governor options
#
CONFIG_SERIAL_PM_ACTIVITY_DOMAIN=0
CONFIG_SERIAL_PM_ACTIVITY_PRIORITY=6

As a side note, I noticed that the tickless OS interval and freerunning
timers for the nucleo-l476rg seems to only support TIM channels, and not
LPTIM. As the TIM channels are not operational during low-power modes, will
I be unable to use the tickless OS interval timer without rewriting the
code that is done to set up the tickless oneshot timer?

Any support on this would be greatly appreciated,

Jesse Jensen (he, him, his)
Geotab

Embedded Engineer

Direct
Toll-free

Visit

+1 (702) 409-1041
+1 (800) 397-7102
www.geotab.com

Twitter  | Facebook
 | YouTube
 | LinkedIn



Complementary PWM channels on stm32f7

2022-06-14 Thread Roberto Bucher

Hi

Did somebody already an implementation of the complementary PWM channels 
on stm32f7 systems?


Thanks in advance

Roberto


Re: Article: Build an IoT App with Zig and LoRaWAN

2022-06-14 Thread Tomek CEDRO
On Tue, Jun 14, 2022 at 6:56 AM Lee, Lup Yuen wrote:
> This article explains how I created a LoRaWAN App with Zig and NuttX:
> https://lupyuen.github.io/articles/iot

Wow! Congratz! Mesh networks will soon be more than essential when all
telco goes down..

I got ASR6501 LoRaWAN868 M5 kit recently (UART+AT), hope to play with
it one day ;-)

-- 
CeDeROM, SQ7MHZ, http://www.tomek.cedro.info