stm32l4 lptim1/2 support

Use this forum for requesting small changes in ChibiOS. Large changes should be discussed in the development forum. This forum is NOT for support.
vrollei
Posts: 121
Joined: Sun Nov 13, 2016 8:44 am
Been thanked: 8 times

stm32l4 lptim1/2 support

Postby vrollei » Thu Jun 08, 2017 9:14 am

Hi,

I have added support for stm32l4 lptim1/2. Is it possible to merge changes with main code?
Attachments
lptim.tar.gz
(7.49 KiB) Downloaded 109 times
Vitaly

User avatar
Giovanni
Site Admin
Posts: 13019
Joined: Wed May 27, 2009 8:48 am
Location: Salerno, Italy
Has thanked: 748 times
Been thanked: 621 times
Contact:

Re: stm32l4 lptim1/2 support

Postby Giovanni » Thu Jun 08, 2017 1:51 pm

Hi,

Moving this topic in "small changes".

Giovanni

geoffrey.brown
Posts: 69
Joined: Thu May 07, 2015 9:47 pm
Has thanked: 3 times
Been thanked: 11 times

Re: stm32l4 lptim1/2 support

Postby geoffrey.brown » Fri Aug 25, 2017 11:35 pm

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

vrollei
Posts: 121
Joined: Sun Nov 13, 2016 8:44 am
Been thanked: 8 times

Re: stm32l4 lptim1/2 support

Postby vrollei » Sat Aug 26, 2017 9:21 am

Hi, Geoffrey!

Check out ST based on RTC.
and power module.
Vitaly

geoffrey.brown
Posts: 69
Joined: Thu May 07, 2015 9:47 pm
Has thanked: 3 times
Been thanked: 11 times

Re: stm32l4 lptim1/2 support

Postby geoffrey.brown » Sat Aug 26, 2017 1:16 pm

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

User avatar
Giovanni
Site Admin
Posts: 13019
Joined: Wed May 27, 2009 8:48 am
Location: Salerno, Italy
Has thanked: 748 times
Been thanked: 621 times
Contact:

Re: stm32l4 lptim1/2 support

Postby Giovanni » Sun Sep 24, 2017 4:15 pm

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

vrollei
Posts: 121
Joined: Sun Nov 13, 2016 8:44 am
Been thanked: 8 times

Re: stm32l4 lptim1/2 support

Postby vrollei » Sun Sep 24, 2017 5:12 pm

Hi,

ok, will fix it.
Vitaly

User avatar
Giovanni
Site Admin
Posts: 13019
Joined: Wed May 27, 2009 8:48 am
Location: Salerno, Italy
Has thanked: 748 times
Been thanked: 621 times
Contact:

Re: stm32l4 lptim1/2 support

Postby Giovanni » Sun Sep 24, 2017 5:38 pm

Just a note, I merged the changes to stm32_tim.h, no need to redo that.

Giovanni

vrollei
Posts: 121
Joined: Sun Nov 13, 2016 8:44 am
Been thanked: 8 times

Re: stm32l4 lptim1/2 support

Postby vrollei » Mon Sep 25, 2017 12:19 pm

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?
Vitaly

User avatar
Giovanni
Site Admin
Posts: 13019
Joined: Wed May 27, 2009 8:48 am
Location: Salerno, Italy
Has thanked: 748 times
Been thanked: 621 times
Contact:

Re: stm32l4 lptim1/2 support

Postby Giovanni » Mon Sep 25, 2017 12:52 pm

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


Return to “Small Change Requests”

Who is online

Users browsing this forum: No registered users and 4 guests