RTC driver and EXTI->PR Topic is solved

ChibiOS public support forum for topics related to the STMicroelectronics STM32 family of micro-controllers.

Moderators: barthess, RoccoMarco

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

RTC driver and EXTI->PR  Topic is solved

Postby vrollei » Sun Mar 17, 2019 12:45 pm

Hi,

What is the best place to define correct EXTI->PRx register for RTC driver / alarm line?

For example:
STM32L1 uses EXTI->PR register
and
STM32L4 uses EXTI->PR1

RTC and EXTI driver in version 19.1 support only EXTI->PR1 register

Thanks in advance!
Vitaly

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

Re: RTC driver and EXTI->PR

Postby Giovanni » Sun Mar 17, 2019 1:33 pm

Hi,

The PAL driver does it this way:

Code: Select all


/*===========================================================================*/
/* Driver local definitions.                                                 */
/*===========================================================================*/

/* Handling a difference in ST headers.*/
#if defined(STM32L4XX) || defined(STM32L4XXP)
#define EMR     EMR1
#define IMR     IMR1
#define PR      PR1
#define RTSR    RTSR1
#define FTSR    FTSR1
#endif


The same is also in stm32_exti.h:

Code: Select all


/* Handling differences in ST headers.*/
#if !defined(STM32L4XX) && !defined(STM32L4XXP)
#define EMR1    EMR
#define IMR1    IMR
#define PR1     PR
#define RTSR1   RTSR
#define FTSR1   FTSR
#endif


Probably it should only be in EXTI and other drivers should use it. I am looking into this.

Giovanni

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

Re: RTC driver and EXTI->PR

Postby Giovanni » Sun Mar 17, 2019 2:17 pm

Hi,

Fixed as bug #1022.

It should be fine in trunk and 19.1.x now, could you check?

Giovanni

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

Re: RTC driver and EXTI->PR

Postby vrollei » Sun Mar 17, 2019 5:43 pm

Hi,

thanks a lot!

I will check it.
Vitaly

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

Re: RTC driver and EXTI->PR

Postby vrollei » Sun Mar 17, 2019 8:11 pm

Hi,

it seems STM32L1xx/stm32_registry.h does not contain:

#define STM32_RTC_TAMP_STAMP_HANDLER
#define STM32_RTC_WKUP_HANDLER
#define STM32_RTC_ALARM_HANDLER
#define STM32_RTC_TAMP_STAMP_NUMBER
#define STM32_RTC_WKUP_NUMBER
#define STM32_RTC_ALARM_NUMBER
#define STM32_RTC_ALARM_EXTI
#define STM32_RTC_TAMP_STAMP_EXTI
#define STM32_RTC_WKUP_EXTI
#define STM32_RTC_IRQ_ENABLE()
Vitaly

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

Re: RTC driver and EXTI->PR

Postby vrollei » Sun Mar 17, 2019 8:29 pm

Code: Select all

#define STM32_RTC_TAMP_STAMP_HANDLER        Vector48
#define STM32_RTC_WKUP_HANDLER              Vector4C
#define STM32_RTC_ALARM_HANDLER             VectorE4
#define STM32_RTC_TAMP_STAMP_NUMBER         3
#define STM32_RTC_WKUP_NUMBER               1
#define STM32_RTC_ALARM_NUMBER              2
#define STM32_RTC_ALARM_EXTI                17
#define STM32_RTC_TAMP_STAMP_EXTI           19
#define STM32_RTC_WKUP_EXTI                 20
Vitaly

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

Re: RTC driver and EXTI->PR

Postby Giovanni » Sun Mar 24, 2019 8:35 am

Hi,

Fixed as bug #1023.

There were some other things missing too.

Giovanni


Return to “STM32 Support”

Who is online

Users browsing this forum: No registered users and 3 guests