Skip to content

boards/stm32: introduce common timer configurations and use them where possible#11809

Merged
fjmolinas merged 10 commits intoRIOT-OS:masterfrom
aabadie:pr/boards/stm32_timer_conf_common
Aug 6, 2019
Merged

boards/stm32: introduce common timer configurations and use them where possible#11809
fjmolinas merged 10 commits intoRIOT-OS:masterfrom
aabadie:pr/boards/stm32_timer_conf_common

Conversation

@aabadie
Copy link
Copy Markdown
Contributor

@aabadie aabadie commented Jul 5, 2019

Contribution description

While working on some of my STM32 boards addition, I noticed the timer configuration were very often the same, certainly due to copy-paste. Some uses TIM2, some uses TIM5.

This PR is introducing 2 new common STM32 timer configurations: one with TIM2, which is adapted for several families (L0, L1 and L4) and one with TIM5, mostly used by F4 boards.

I tried to adapt all boards with these configuration.

The results is a lot of duplicated code in peripheral configurations being removed.

Testing procedure

  • Verify xtimer test applications still works
  • A green Murdock should also be a good indicator
  • Verify no obvious mistake is done in the code changes

Issues/PRs references

None

@aabadie aabadie added Type: cleanup The issue proposes a clean-up / The PR cleans-up parts of the codebase / documentation CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR Area: boards Area: Board ports labels Jul 5, 2019
@aabadie aabadie force-pushed the pr/boards/stm32_timer_conf_common branch 2 times, most recently from af7f0d3 to 96dee3c Compare July 5, 2019 18:55
@fjmolinas
Copy link
Copy Markdown
Contributor

@aabadie please rebase.

@aabadie aabadie force-pushed the pr/boards/stm32_timer_conf_common branch from 96dee3c to 927f283 Compare August 5, 2019 13:01
Copy link
Copy Markdown
Contributor

@fjmolinas fjmolinas left a comment

Choose a reason for hiding this comment

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

Code looks good. I'm running tests to verify nothing has been broken.

@fjmolinas fjmolinas added Reviewed: 1-fundamentals The fundamentals of the PR were reviewed according to the maintainer guidelines Reviewed: 2-code-design The code design of the PR was reviewed according to the maintainer guidelines Reviewed: 4-code-style The adherence to coding conventions by the PR were reviewed according to the maintainer guidelines Reviewed: 5-documentation The documentation details of the PR were reviewed according to the maintainer guidelines labels Aug 6, 2019
@fjmolinas
Copy link
Copy Markdown
Contributor

I ran the tests, seem like only expected to fail tests are failing, see details:

nucleo-f207zg/failuresummary.md
Failures during test:
- [tests/gnrc_ipv6_ext](tests/gnrc_ipv6_ext/test.failed)
- [tests/gnrc_rpl_srh](tests/gnrc_rpl_srh/test.failed)
- [tests/gnrc_sock_dns](tests/gnrc_sock_dns/test.failed)
- [tests/pkg_fatfs_vfs](tests/pkg_fatfs_vfs/test.failed)
nucleo-f303k8/failuresummary.md
Failures during test:
- [tests/cpp11_condition_variable](tests/cpp11_condition_variable/test.failed)
- [tests/driver_grove_ledbar](tests/driver_grove_ledbar/test.failed)
- [tests/driver_my9221](tests/driver_my9221/test.failed)
- [tests/pkg_fatfs_vfs](tests/pkg_fatfs_vfs/test.failed)
- [tests/pthread_cooperation](tests/pthread_cooperation/test.failed)
nucleo-f446re/failuresummary.md
Failures during test:
- [tests/driver_grove_ledbar](tests/driver_grove_ledbar/test.failed)
- [tests/driver_my9221](tests/driver_my9221/test.failed)
- [tests/gnrc_ipv6_ext](tests/gnrc_ipv6_ext/test.failed)
- [tests/gnrc_rpl_srh](tests/gnrc_rpl_srh/test.failed)
- [tests/gnrc_sock_dns](tests/gnrc_sock_dns/test.failed)
- [tests/pkg_fatfs_vfs](tests/pkg_fatfs_vfs/test.failed)
nucleo-l073rz/failuresummary.md
Failures during test:
- [tests/driver_grove_ledbar](tests/driver_grove_ledbar/test.failed)
- [tests/driver_my9221](tests/driver_my9221/test.failed)
- [tests/gnrc_ipv6_ext](tests/gnrc_ipv6_ext/test.failed)
- [tests/gnrc_rpl_srh](tests/gnrc_rpl_srh/test.failed)
- [tests/gnrc_sock_dns](tests/gnrc_sock_dns/test.failed)
- [tests/pkg_fatfs_vfs](tests/pkg_fatfs_vfs/test.failed)
nucleo-l152re/failuresummary.md
Failures during test:
- [tests/driver_grove_ledbar](tests/driver_grove_ledbar/test.failed)
- [tests/driver_my9221](tests/driver_my9221/test.failed)
- [tests/gnrc_ipv6_ext](tests/gnrc_ipv6_ext/test.failed)
- [tests/gnrc_rpl_srh](tests/gnrc_rpl_srh/test.failed)
- [tests/gnrc_sock_dns](tests/gnrc_sock_dns/test.failed)
- [tests/pkg_fatfs_vfs](tests/pkg_fatfs_vfs/test.failed)
- [tests/pkg_qdsa](tests/pkg_qdsa/test.failed)
nucleo-l432kc/failuresummary.md
Failures during test:
- [tests/driver_grove_ledbar](tests/driver_grove_ledbar/test.failed)
- [tests/driver_hd44780](tests/driver_hd44780/test.failed)
- [tests/driver_my9221](tests/driver_my9221/test.failed)
- [tests/gnrc_ipv6_ext](tests/gnrc_ipv6_ext/test.failed)
- [tests/gnrc_rpl_srh](tests/gnrc_rpl_srh/test.failed)
- [tests/gnrc_sock_dns](tests/gnrc_sock_dns/test.failed)
- [tests/pkg_fatfs_vfs](tests/pkg_fatfs_vfs/test.failed)
nucleo-f103rb/failuresummary.md
ERROR:nucleo-f103rb:Tests failed: 9
Failures during test:
- [tests/driver_grove_ledbar](tests/driver_grove_ledbar/test.failed)
- [tests/driver_hd44780](tests/driver_hd44780/test.failed)
- [tests/driver_my9221](tests/driver_my9221/test.failed)
- [tests/gnrc_ipv6_ext](tests/gnrc_ipv6_ext/test.failed)
- [tests/gnrc_rpl_srh](tests/gnrc_rpl_srh/test.failed)
- [tests/gnrc_sock_dns](tests/gnrc_sock_dns/test.failed)
- [tests/pkg_fatfs_vfs](tests/pkg_fatfs_vfs/test.failed)
- [tests/xtimer_periodic_wakeup](tests/xtimer_periodic_wakeup/test.failed)
- [tests/xtimer_usleep_short](tests/xtimer_usleep_short/test.failed)

These fail because of XTIMER_BACKOFF, unrelated to this PR, also fails in master.

- [tests/xtimer_periodic_wakeup](tests/xtimer_periodic_wakeup/test.failed)
- [tests/xtimer_usleep_short](tests/xtimer_usleep_short/test.failed)
nucleo-f091rc/failuresummary.md
Failures during test:
- [tests/driver_grove_ledbar](tests/driver_grove_ledbar/test.failed)
- [tests/driver_hd44780](tests/driver_hd44780/test.failed)
- [tests/driver_my9221](tests/driver_my9221/test.failed)
- [tests/gnrc_ipv6_ext](tests/gnrc_ipv6_ext/test.failed)
- [tests/gnrc_rpl_srh](tests/gnrc_rpl_srh/test.failed)
- [tests/gnrc_sock_dns](tests/gnrc_sock_dns/test.failed)
- [tests/pkg_fatfs_vfs](tests/pkg_fatfs_vfs/test.failed)
  • [tests/ssp]: puts board in un-flashable state but succeeds

For stm32f7 is seems that there are a lot failing test same one as shown in #11800. Although a big issue, it isn't related to this PR.

nucleo-f7/failuresummary.md Failures during test: ``` - [tests/bloom_bytes](tests/bloom_bytes/test.failed) - [tests/float](tests/float/test.failed) - [tests/gnrc_ipv6_ext](tests/gnrc_ipv6_ext/test.failed) - [tests/gnrc_rpl_srh](tests/gnrc_rpl_srh/test.failed) - [tests/gnrc_sock_dns](tests/gnrc_sock_dns/test.failed) - [tests/libfixmath_unittests](tests/libfixmath_unittests/test.failed) - [tests/pkg_cn-cbor](tests/pkg_cn-cbor/test.failed) - [tests/pkg_lora-serialization](tests/pkg_lora-serialization/test.failed) - [tests/pkg_ubasic](tests/pkg_ubasic/test.failed) - [tests/rng](tests/rng/test.failed) - [tests/unittests](tests/unittests/test.failed) ```

@fjmolinas fjmolinas added the Reviewed: 3-testing The PR was tested according to the maintainer guidelines label Aug 6, 2019
Copy link
Copy Markdown
Contributor

@fjmolinas fjmolinas left a comment

Choose a reason for hiding this comment

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

Although I found out there are some failing tests with nucleo-boards. These are unrelated to the PR. ACK

@fjmolinas fjmolinas merged commit b8cd3c0 into RIOT-OS:master Aug 6, 2019
@aabadie aabadie deleted the pr/boards/stm32_timer_conf_common branch August 6, 2019 17:04

#define TIMER_0_ISR isr_tim2

#define TIMER_NUMOF (sizeof(timer_config) / sizeof(timer_config[0]))
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.

@aabadie I didn't realize #11865 had been merged, could you provide a PR to replace this by ARRAY_SIZE

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

It was addressed in #11865 :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Area: boards Area: Board ports CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR Reviewed: 1-fundamentals The fundamentals of the PR were reviewed according to the maintainer guidelines Reviewed: 2-code-design The code design of the PR was reviewed according to the maintainer guidelines Reviewed: 3-testing The PR was tested according to the maintainer guidelines Reviewed: 4-code-style The adherence to coding conventions by the PR were reviewed according to the maintainer guidelines Reviewed: 5-documentation The documentation details of the PR were reviewed according to the maintainer guidelines 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.

3 participants