Page 1 of 2

stm32l4 lptim1/2 support

Posted: Thu Jun 08, 2017 9:14 am
by vrollei
Hi,

I have added support for stm32l4 lptim1/2. Is it possible to merge changes with main code?

Re: stm32l4 lptim1/2 support

Posted: Thu Jun 08, 2017 1:51 pm
by Giovanni
Hi,

Moving this topic in "small changes".

Giovanni

Re: stm32l4 lptim1/2 support

Posted: Fri Aug 25, 2017 11:35 pm
by geoffrey.brown
Have you used this in tickless mode for the system counter ? I have an application with extremely low power requirements and want to use tickless with one of the low-power stop modes in the idle thread hook. I can live with 32khz tick resolution, since all of the sleep times are on order of milliseconds.

Any advice would be welcome on how to proceed.

Geoffrey

Re: stm32l4 lptim1/2 support

Posted: Sat Aug 26, 2017 9:21 am
by vrollei
Hi, Geoffrey!

Check out ST based on RTC.
and power module.

Re: stm32l4 lptim1/2 support

Posted: Sat Aug 26, 2017 1:16 pm
by geoffrey.brown
Thanks ! Your RTC code gave me a pretty clear idea about how to proceed. It's clear a general solution on power management is complex, but fortunately my application is simple enough that I can forgo that pain and use the idle thread hooks.

Geoffrey

Re: stm32l4 lptim1/2 support

Posted: Sun Sep 24, 2017 4:15 pm
by Giovanni
Hi,

The patch does not apply on trunk.

In general, when adding data in registry:

1) It must be added to all devices in the same registry file.
2) It must be added to all registries or drivers would get "undefined macro".

Giovanni

Re: stm32l4 lptim1/2 support

Posted: Sun Sep 24, 2017 5:12 pm
by vrollei
Hi,

ok, will fix it.

Re: stm32l4 lptim1/2 support

Posted: Sun Sep 24, 2017 5:38 pm
by Giovanni
Just a note, I merged the changes to stm32_tim.h, no need to redo that.

Giovanni

Re: stm32l4 lptim1/2 support

Posted: Mon Sep 25, 2017 12:19 pm
by vrollei
Hi,

STM32F7 has LPTIM1 but without dedicated interrupt vector (use EXTI line).
What is the best way to define this type of LPTIM in registry file?

Re: stm32l4 lptim1/2 support

Posted: Mon Sep 25, 2017 12:52 pm
by Giovanni
Hi,

Uhm, good question...

What about having on all platforms:

#define STM32_LPTIM1_HANDLER Vectorxx
#define STM32_LPTIM1_NUMBER yy

On those that require an EXTI initialization add:

#define STM32_LPTIM1_EXTI_LINE zz

The drivers can check for STM32_LPTIM1_EXTI_LINE presence and initialize EXTI before enabling the NVIC vector. This could be used in general for all peripherals connected to EXTI.

Giovanni