Skip to content

cpu/stm32: fix RTC init and disable outputs#7326

Closed
vincent-d wants to merge 2 commits intoRIOT-OS:masterfrom
OTAkeys:pr/stm32_rtc_fix
Closed

cpu/stm32: fix RTC init and disable outputs#7326
vincent-d wants to merge 2 commits intoRIOT-OS:masterfrom
OTAkeys:pr/stm32_rtc_fix

Conversation

@vincent-d
Copy link
Copy Markdown
Member

This PR fixes a delay each time the mcu boots.

If the RTC is powered with a V_bckp, there was ~800ms lost in the RTC counter at each power on.

The RTC alternate function outputs are also disabled, to make PC13 usable as gpio.

@vincent-d vincent-d added the Platform: ARM Platform: This PR/issue effects ARM-based platforms label Jul 6, 2017
@aabadie aabadie modified the milestone: Release 2017.10 Jul 12, 2017
@aabadie aabadie added the Type: enhancement The issue suggests enhanceable parts / The PR enhances parts of the codebase / documentation label Aug 18, 2017
Copy link
Copy Markdown
Contributor

@aabadie aabadie left a comment

Choose a reason for hiding this comment

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

Changes look valid here. Do you have any advice for testing this (I have a L0 board with me) ?

/* Configure the RTC PRER */
RTC->PRER = RTC_SYNC_PRESCALER;
RTC->PRER |= (RTC_ASYNC_PRESCALER << 16);
/* Set 24-h clock */
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

According to the datasheet, this should be done after prescaler configuration.

@vincent-d
Copy link
Copy Markdown
Member Author

Do you have any advice for testing this

You need a board with Vbackup connected, and do some power down / power up cycles (reboot command is not enough from my experience. You really need to power down).

Copy link
Copy Markdown
Contributor

@haukepetersen haukepetersen left a comment

Choose a reason for hiding this comment

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

Except the indention the code looks valid to me.

@vincent-d
Copy link
Copy Markdown
Member Author

Except the indention

What's wrong with it?

@haukepetersen
Copy link
Copy Markdown
Contributor

nothing, my bad - the diff played a trick no me. So never mind -> ACK

@vincent-d
Copy link
Copy Markdown
Member Author

Closing as #7504 is reworking the driver in a better way

@vincent-d vincent-d closed this Aug 24, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Platform: ARM Platform: This PR/issue effects ARM-based platforms Type: enhancement The issue suggests enhanceable parts / The PR enhances parts of the codebase / documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants