Skip to content

cpu/stm32f1: add unified rtt configuration#13907

Merged
aabadie merged 1 commit intoRIOT-OS:masterfrom
fjmolinas:pr_stm32f1_rtt
Apr 24, 2020
Merged

cpu/stm32f1: add unified rtt configuration#13907
aabadie merged 1 commit intoRIOT-OS:masterfrom
fjmolinas:pr_stm32f1_rtt

Conversation

@fjmolinas
Copy link
Copy Markdown
Contributor

Contribution description

This PR is split from #13874. It unifies rtt configuration for stm32f1 and make the RTT_FREQYENCY configurable.

As in #13874 max and min values for the RTT are documented.

Testing procedure

  • tests/periph_rtt should still pass on stm32f1 boards with different frequencies

BOARD=iotlab-m3 make -C tests/periph_rtt flash test --no-print-directory -j3

main(): This is RIOT! (Version: 2020.07-devel-56-g42700-pr_rtt_enhancement)

RIOT RTT low-level driver test
This test will display 'Hello' every 5 seconds

Initializing the RTT driver
RTT now: 0
Setting initial alarm to now + 5 s (81920)
Done setting up the RTT, wait for many Hellos
Hello
Hello
Hello
Hello
Hello

CFLAGS+=-DRTT_FREQUENCY=1 BOARD=iotlab-m3 make -C tests/periph_rtt clean flash test --no-print-directory -j3

main(): This is RIOT! (Version: 2020.07-devel-56-g42700-pr_rtt_enhancement)

RIOT RTT low-level driver test
This test will display 'Hello' every 5 seconds

Initializing the RTT driver
RTT now: 0
Setting initial alarm to now + 5 s (5)
Done setting up the RTT, wait for many Hellos
Hello
Hello
Hello
Hello
Hello

Issues/PRs references

Split from #13874

@fjmolinas fjmolinas added Type: cleanup The issue proposes a clean-up / The PR cleans-up parts of the codebase / documentation Area: drivers Area: Device drivers labels Apr 20, 2020
@fjmolinas fjmolinas requested a review from aabadie April 20, 2020 10:33
@fjmolinas fjmolinas force-pushed the pr_stm32f1_rtt branch 4 times, most recently from 99b4f22 to f1deca1 Compare April 22, 2020 08:30
@fjmolinas
Copy link
Copy Markdown
Contributor Author

Re-worked to leave only RTT_FREQUENCY definition in periph_conf.h since it is a per board configuration. I kept the same configurations as before, but you can eventually override the default RTT_FREQUENCY at application level.

@fjmolinas fjmolinas added the CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR label Apr 22, 2020
Copy link
Copy Markdown
Contributor

@benpicco benpicco left a comment

Choose a reason for hiding this comment

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

Looks good to me, the math works out the same as before.

@fjmolinas
Copy link
Copy Markdown
Contributor Author

Seems there is a naming conflict..

@fjmolinas
Copy link
Copy Markdown
Contributor Author

Seems there is a naming conflict..

Oh no, its because those BOARDs do not have rtt feature but are still defining RTT_MAX_VALUE with this change.

@fjmolinas
Copy link
Copy Markdown
Contributor Author

Oh no, its because those BOARDs do not have rtt feature but are still defining RTT_MAX_VALUE with this change.

Seem like they both have a LSE oscilator. But I'll guard the definition against MODULE_PERIPH_RTT anyway.

@fjmolinas
Copy link
Copy Markdown
Contributor Author

Seem like they both have a LSE oscilator. But I'll guard the definition against MODULE_PERIPH_RTT anyway.

And add rtt in a follow-up.

@fjmolinas
Copy link
Copy Markdown
Contributor Author

And add rtt in a follow-up.

Actually, does it make sense enabling right away? the bluepill config already has CLOCK_LSE set to 1, and periph_rtc is already provideed by default for all stm32f1.

@fjmolinas fjmolinas removed the CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR label Apr 22, 2020
@fjmolinas
Copy link
Copy Markdown
Contributor Author

Actually, does it make sense enabling right away? the bluepill config already has CLOCK_LSE set to 1, and periph_rtc is already provideed by default for all stm32f1.

I wouldn't have any board to test though.

@fjmolinas
Copy link
Copy Markdown
Contributor Author

@MrKevinWeiss do you have some blxxxpill?

@jue89
Copy link
Copy Markdown
Contributor

jue89 commented Apr 23, 2020

Actually, does it make sense enabling right away? the bluepill config already has CLOCK_LSE set to 1, and periph_rtc is already provideed by default for all stm32f1.

I wouldn't have any board to test though.

I actually had a PR in the pipe line enabling periph_rtt on the blxxxpill. I would happily test your changes on the bluepill.

@fjmolinas
Copy link
Copy Markdown
Contributor Author

I actually had a PR in the pipe line enabling periph_rtt on the blxxxpill. I would happily test your changes on the bluepill.

I added RTT_FREQUENCY for the bluepill and enabled periph_rtt for all stm32f1, just as for periph_rtc, in that commit I removed FEATURES_PROVIDED += periph_rtt from stm32f1 boards, since its provided by the cpu.

@fjmolinas fjmolinas added the CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR label Apr 23, 2020
@fjmolinas fjmolinas 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 Apr 23, 2020
@fjmolinas
Copy link
Copy Markdown
Contributor Author

I added RTT_FREQUENCY for the bluepill and enabled periph_rtt for all stm32f1, just as for periph_rtc, in that commit I removed FEATURES_PROVIDED += periph_rtt from stm32f1 boards, since its provided by the cpu.

Seem that with the github issues, my comment got lost. I wanted to provide periph_rtt at cpu level, but then realized that at least 3 stm32f1 boards do not have CLOCK_LSE, so I just kept the original commit and split the blxxxchange into #13929.

@fjmolinas
Copy link
Copy Markdown
Contributor Author

Seems github issues got in the way here.

-- github reports HEAD of master as 341916cd307bb9fcacf8a457f1d5988528c6ca5c
fatal: unable to access 'https://github.com/RIOT-OS/RIOT.git/': The requested URL returned error: 504
--- creating merge commit ...
-- merging c0d1884813e1816b5cf445b21464fa5d7134da9f into 341916cd307bb9fcacf8a457f1d5988528c6ca5c
--- cloning base repo
git-cache: cloning from cache. tag=commit341916cd307bb9fcacf8a457f1d5988528c6ca5c
--- adding remotes
--- checking out merge branch
Switched to a new branch 'pull/341916cd307bb9fcacf8a457f1d5988528c6ca5c/c0d1884813e1816b5cf445b21464fa5d7134da9f'
--- fetching pr_stm32f1_rtt
remote: 
remote: 
remote: 
remote: 
502 Bad Gateway

@fjmolinas fjmolinas 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 Apr 23, 2020
@fjmolinas
Copy link
Copy Markdown
Contributor Author

Ajjj is starting to be more annoying than I though, because periph_cpu is included before periph_conf I can't have a default value there which is overridden per BOARD. Providing them only per BOARD is ok, but now rtc_rtt unit tests is complaining about RTT_MAX_VALUE missing, anyway this last one should make murdock happy, sorry for the force pushing.

@fjmolinas fjmolinas removed the CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR label Apr 23, 2020
@fjmolinas fjmolinas added the CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR label Apr 23, 2020
@fjmolinas fjmolinas removed the CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR label Apr 23, 2020
@fjmolinas fjmolinas added the CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR label Apr 24, 2020
@fjmolinas
Copy link
Copy Markdown
Contributor Author

@benpicco does your ACK still stand?

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.

Looks good to me now.

ACK

@aabadie aabadie merged commit 5b814db into RIOT-OS:master Apr 24, 2020
@fjmolinas
Copy link
Copy Markdown
Contributor Author

Thanks for the review!

@fjmolinas fjmolinas deleted the pr_stm32f1_rtt branch April 24, 2020 08:43
@miri64 miri64 added this to the Release 2020.07 milestone Jun 24, 2020
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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants