Skip to content

[Enhancement] Implement RTC Seconds Interrupt for STM32F1xx #42

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 12 commits into from

Conversation

josh-gaby
Copy link

@josh-gaby josh-gaby commented Sep 24, 2020

Implement the built-in Seconds interrupt functionality

Currently working for stm32f1xx only as the core code is already in place. I would like to implement this feature for all variants but the core HAL drivers for each variant would need to be updated to enable the seconds interrupt.

Requires core > 1.9.0 so that rtc.h and rtc.c are included from this library.

EDIT
It looks like this interrupt is not available on other variants.
For all variants that don't support the Seconds Interrupt, this could be implemented using AlarmB since its not currently accessible, might need to be able to choose between enable Seconds Interrupts or enable AlarmB to make it safe on these variants if AlarmB is going to be implemented in a future version though?

Using RTC in F0, F2, F3, F4 and L1 App note AN3371

Josh added 2 commits September 24, 2020 18:34
Implement built-in RTC Seconds Interrupt
Only enable Seconds interrupt on stm32f1xx
@josh-gaby josh-gaby changed the title [Enhancement] Add RTC Seconds Interrupt [Enhancement] Implement RTC Seconds Interrupt for STM32F1xx Sep 24, 2020
Only available on core version > 1.9.0
@josh-gaby josh-gaby marked this pull request as ready for review September 24, 2020 09:50
@josh-gaby
Copy link
Author

@fpistm
What do you think about the idea of implementing a seconds interrupt using alarm B on other variants?

@fpistm
Copy link
Member

fpistm commented Oct 2, 2020

Well second interrupt for all should be fine for all series but to keep genericity this should not be dependent of a dedicated alarm.
And it is planned to support second alarm for all supported mode.

@josh-gaby
Copy link
Author

I'm fairly certain that only the F1xx series actually has a seconds interrupt, that's why I was thinking about using the unused alarm.

I went through a number of the other series in STM32CubeMX configuration and only the F1xx series seemed to have the seconds interrupt available.

If it isn't available would it be best to only put support in for seconds interrupts on the F1xx series?

@fpistm
Copy link
Member

fpistm commented Oct 2, 2020

Right, I'm thinking about the periodic auto-wakeup which can be used for this. But maybe I'm wrong.

@josh-gaby
Copy link
Author

You may be onto something there, I ignored that option initially because I was thinking it only triggered an interrupt on PC13 but it seems that may be an optional feature. I'll look into using the PWUT to implement this feature for other variants.

@josh-gaby
Copy link
Author

I've only got a few different STM32F1xx based boards at the moment so can't test the Periodic wakeup timer, I'm waiting for some new dev boards to arrive in the mail before I can continue with this, might be a couple of weeks

Josh added 2 commits November 1, 2020 10:24
Disable check for STM32F1XX variants
@fpistm fpistm added the enhancement New feature or request label Nov 11, 2020
@fpistm fpistm added this to the 1.1.0 milestone Nov 11, 2020
@fpistm fpistm requested a review from FRASTM January 5, 2021 10:13
Copy link
Member

@fpistm fpistm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Astyle change have to be fixed.

josh-gaby and others added 7 commits January 25, 2021 21:51
Co-authored-by: Frederic Pillon <frederic.pillon@st.com>
Co-authored-by: Frederic Pillon <frederic.pillon@st.com>
Co-authored-by: Frederic Pillon <frederic.pillon@st.com>
Co-authored-by: Frederic Pillon <frederic.pillon@st.com>
Co-authored-by: Frederic Pillon <frederic.pillon@st.com>
Co-authored-by: Frederic Pillon <frederic.pillon@st.com>
@fpistm fpistm modified the milestones: 2.0.0, 2.x.x Apr 22, 2021
@fpistm fpistm modified the milestones: 1.1.1, 1.2.0 Oct 1, 2021
@fpistm fpistm requested a review from FRASTM November 18, 2021 08:50
Copy link
Contributor

@FRASTM FRASTM left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

else LGTM
Do we have a test application to demonstrate this (for ex a simple LED on and off on each 1second interrupt

@FRASTM
Copy link
Contributor

FRASTM commented Nov 25, 2021

please have a look at https://github.com/FRASTM/STM32RTC/tree/seconds_int
including a simple example to display the Seconds Callback function
for the STM32F1

@fpistm fpistm added the duplicate This issue or pull request already exists label Dec 15, 2021
@fpistm
Copy link
Member

fpistm commented Dec 15, 2021

This one has been superseded by #57.

@fpistm fpistm closed this Dec 15, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
duplicate This issue or pull request already exists enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants