Skip to content

stm32_common: unified RTC driver#6448

Merged
aabadie merged 1 commit intoRIOT-OS:masterfrom
OTAkeys:pr/stm32_rtc
Jan 24, 2017
Merged

stm32_common: unified RTC driver#6448
aabadie merged 1 commit intoRIOT-OS:masterfrom
OTAkeys:pr/stm32_rtc

Conversation

@vincent-d
Copy link
Copy Markdown
Member

Hi,

This PR unify the stm32f0, f2, f3, f4 and l1 RTC driver.

The init behavior is changed a little bit to avoid resetting the counter if the RTC was already enabled.

According to this: http://www.st.com/content/ccc/resource/technical/document/application_note/7a/9c/de/da/84/e7/47/8a/DM00025071.pdf/files/DM00025071.pdf/jcr:content/translations/en.DM00025071.pdf
all these families share (almost) the same RTC.

Tested on f0 and f2 with tests/periph_rtc and default example. Compiled on f3, f4 and l1 (I modified some board to compile the RTC code) but as I don't have any board with these mcu I can't test.

@aabadie
Copy link
Copy Markdown
Contributor

aabadie commented Jan 20, 2017

Nice !

@PeterKietzmann PeterKietzmann added this to the Release 2017.04 milestone Jan 23, 2017
@PeterKietzmann PeterKietzmann added Type: cleanup The issue proposes a clean-up / The PR cleans-up parts of the codebase / documentation Area: drivers Area: Device drivers Type: enhancement The issue suggests enhanceable parts / The PR enhances parts of the codebase / documentation labels Jan 23, 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 good out there except a minor copyright thing. I'll try asap on the boards I have here and which cover most of the stm32 family.

* Copyright (C) 2016 OTA keys S.A.
* Copyright (C) 2015 Lari Lehtomäki
* 2016 Laksh Bhatia
* 2016 OTA keys S.A.
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.

Maybe 2016-2017 for OTA keys ?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Fixed

@aabadie
Copy link
Copy Markdown
Contributor

aabadie commented Jan 23, 2017

Tested tests/periph_rtc on a few boards:

  • any nucleo-f0xx : works
  • nucleo-f3xx : needs adaptation in boards/nucleo-f3xx (Makefile.dep and include/periph_conf.h)
  • nucleo-f103 : needs adaptation in boards/nucleo-f103 but doesn't build => link error that I don't understand
  • nucleo-f4** : couldn't try on-board but builds after adaptation of the boards config
  • nucleo-l1 : hard fault handler after initializing the rtc. This is reproducible in master. in stm32l1/periph/rtc.c: fixed 24-h clock format #6173 there's no problem.

@aabadie
Copy link
Copy Markdown
Contributor

aabadie commented Jan 24, 2017

I opened #6462 about the crash with the nucleo-l1 which is already in master.

#include "periph/rtc.h"
#include "periph_conf.h"

#if defined(CPU_FAM_STM32F0) || defined(CPU_FAM_STM32F2) || \
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.

Why not checking the stm32 F1 family ?

@aabadie
Copy link
Copy Markdown
Contributor

aabadie commented Jan 24, 2017

  • tested on nucleo-f446: works
  • re-tested on nucleo-f303: works

the stm32 F1 is not taken into account, why ?

@vincent-d
Copy link
Copy Markdown
Member Author

@aabadie the RTC is different on stm32f1 so this driver won't work

@aabadie
Copy link
Copy Markdown
Contributor

aabadie commented Jan 24, 2017

ok, it makes sense. For the nucleo-l1, we have #6462 for keeping track of the problem (not introduced by this PR).
Let me give an ACK then.

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.

ACK

@aabadie
Copy link
Copy Markdown
Contributor

aabadie commented Jan 24, 2017

and please squash ;)

@vincent-d
Copy link
Copy Markdown
Member Author

Squashed

@aabadie aabadie added the CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR label Jan 24, 2017
@kaspar030 kaspar030 added CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR and removed CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR labels Jan 24, 2017
@PeterKietzmann
Copy link
Copy Markdown
Member

@aabadie ACK holds? I see green lights!!!

@aabadie
Copy link
Copy Markdown
Contributor

aabadie commented Jan 24, 2017

So go !

@aabadie aabadie merged commit 46d2f26 into RIOT-OS:master Jan 24, 2017
@vincent-d vincent-d deleted the pr/stm32_rtc branch March 2, 2017 14:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Area: drivers Area: Device drivers CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR Type: cleanup The issue proposes a clean-up / The PR cleans-up parts of the codebase / documentation 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.

5 participants