[riot-notifications] [RIOT-OS/RIOT] boards/b-l072z-lrwan1: use LSE and provide periph_rtt feature (#11266)

Alexandre Abadie notifications at github.com
Mon Mar 25 17:37:45 CET 2019

The RIOT community cares a lot about code quality.
Therefore, before describing what your contribution is about, we would like
you to make sure that your modifications are compliant with the RIOT
coding conventions, see https://github.com/RIOT-OS/RIOT/wiki/Coding-conventions.

### Contribution description

This PR improves the situation on stm32l0 when using an LSE with RTT:
- it provides and configure the periph_rtt features on b-l072z-lrwan1
- it enables LSE on b-l072z-lrwan1 because without it the RTT is very inaccurate (LSI clock speed is at 37kHz and prescalers used by the RTT driver are expecting 32.768kHz as a base)
- it fixes the tests/periph_rtt when using LSE as clock source for the RTT: the alarm interrupt is raised right after setting the alarm because the timer counter is still 0. The idea of the fix is just to wait a bit before exiting the init function. I'm not sure it's the best fix but I found nothing to configure in the reference manual that could avoid this.

The 3 changes are provided in separate commits to simplify the review.

Put here the description of your contribution:
- describe which part(s) of RIOT is (are) involved
- if it's a bug fix, describe the bug that it solves and how it is solved
- you can also give more information to reviewers about how to test your changes

### Testing procedure

The testing procedure can be done on the boards provided by IoT-LAB (assuming your account is in the LoRa group, if not you can ask me, I'll add it):
- Start an experiment on IoT-LAB:
$ iotlab-experiment -n test -d 60 -l 1,site=saclay+archi=st-lrwan1:sx1276
$ iotlab-experiment wait
- Build/flash/test the `tests/periph_rtt` application:
$ make BOARD=b-l072z-lrwan1 IOTLAB_NODE=auto-ssh -C tests/periph_rtt flash test
The test should succeed.
- Build/flash/test the `tests/periph_rtc` application:
$ make BOARD=b-l072z-lrwan1 IOTLAB_NODE=auto-ssh -C tests/periph_rtc flash test
The test should also succeed (since CLOCK_LSE is now enabled, this test is also impacted).

Details steps to test your contribution:
- which test/example to compile for which board and is there a 'test' command
- how to know that it was not working/available in master
- the expected success test output

### Issues/PRs references


Examples: Fixes #1234. See also #5678. Depends on PR #9876.

Please use keywords (e.g., fixes, resolve) with the links to the issues you
resolved, this way they will be automatically closed when your pull request
is merged. See https://help.github.com/articles/closing-issues-using-keywords/.

You can view, comment on, or merge this pull request online at:


-- Commit Summary --

  * stm32_common/rtt: wait a bit after starting the timer
  * boards/b-l072z-lrwan1: provide and configure rtt peripheral
  * boards/b-l072z-lrwan1: enable LSE

-- File Changes --

    M boards/b-l072z-lrwan1/Makefile.features (1)
    M boards/b-l072z-lrwan1/include/periph_conf.h (12)
    M cpu/stm32_common/periph/rtt.c (6)

-- Patch Links --


You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.riot-os.org/pipermail/notifications/attachments/20190325/d727067e/attachment.html>

More information about the notifications mailing list