-
Notifications
You must be signed in to change notification settings - Fork 2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
boards/nucleo-l432k: provide three periph_timer instances #19677
Conversation
The assumption that all STM32 timers have exactly four channels no longer holds. E.g. the STM32L4 has the following general purpose timers: - TIM2: 32 bit, 4 channels - TIM15: 16 bit, 2 channels - TIM16: 16 bit, 1 channel Hence, a new field is added to the timer configuration to also contain the number of timer channels. Due to alignment the `struct` previously was padded by 16 bit, so adding another 8 bit field doesn't increase its size. For backward compatibility, a value of `0` is considered as alias for `TIMER_CHANNEL_NUMOF` (or 4), so that the number of timer channels only needs to be set when the timer is different from the typical 4 channel timer. This helps backward compatibility.
This adds the three general purpose timers on STM32L4 boards in a central place so that STM32L4 boards can just include it. Some other families may also have TIM15 and TIM16 and could use this, but likely some generalization is needed to use this for other families as well. This can be added later on.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ACK
bors merge
19677: boards/nucleo-l432k: provide three periph_timer instances r=aabadie a=maribu ### Contribution description - `cpu/stm32/periph_timer`: Generalize to also work with timers that do not have 4 channels - `boards/common/stm32`: Add timer config for three timers based on TIM2, TIM15, and TIM16 (the three general-purpose timers of the STM32L4) - `boards/nucleo-l432kc`: Make use of the new timer config Co-authored-by: Marian Buschsieweke <marian.buschsieweke@ovgu.de>
Build failed: |
bors merge (failed due to CI glitch) |
19677: boards/nucleo-l432k: provide three periph_timer instances r=maribu a=maribu ### Contribution description - `cpu/stm32/periph_timer`: Generalize to also work with timers that do not have 4 channels - `boards/common/stm32`: Add timer config for three timers based on TIM2, TIM15, and TIM16 (the three general-purpose timers of the STM32L4) - `boards/nucleo-l432kc`: Make use of the new timer config 19681: sys/xtimer: improve documentation r=maribu a=maribu ### Contribution description - Add a warning that xtimer is deprecated, so that new code hopefully starts using ztimer - Add a hint that `ztimer_xtimer_compat` can be used even after `xtimer` is gone Co-authored-by: Marian Buschsieweke <marian.buschsieweke@ovgu.de>
bors cancel |
Canceled. |
19677: boards/nucleo-l432k: provide three periph_timer instances r=maribu a=maribu ### Contribution description - `cpu/stm32/periph_timer`: Generalize to also work with timers that do not have 4 channels - `boards/common/stm32`: Add timer config for three timers based on TIM2, TIM15, and TIM16 (the three general-purpose timers of the STM32L4) - `boards/nucleo-l432kc`: Make use of the new timer config 19678: gnrc_sixlowpan_iphc: fix NULL pointer dereference r=maribu a=miri64 19681: sys/xtimer: improve documentation r=maribu a=maribu ### Contribution description - Add a warning that xtimer is deprecated, so that new code hopefully starts using ztimer - Add a hint that `ztimer_xtimer_compat` can be used even after `xtimer` is gone Co-authored-by: Marian Buschsieweke <marian.buschsieweke@ovgu.de> Co-authored-by: Martine Lenders <m.lenders@fu-berlin.de>
Build failed (retrying...): |
19677: boards/nucleo-l432k: provide three periph_timer instances r=maribu a=maribu ### Contribution description - `cpu/stm32/periph_timer`: Generalize to also work with timers that do not have 4 channels - `boards/common/stm32`: Add timer config for three timers based on TIM2, TIM15, and TIM16 (the three general-purpose timers of the STM32L4) - `boards/nucleo-l432kc`: Make use of the new timer config 19683: cpu/sam0_eth: clean up init() r=dylad a=benpicco Co-authored-by: Marian Buschsieweke <marian.buschsieweke@ovgu.de> Co-authored-by: Benjamin Valentin <benjamin.valentin@ml-pa.com>
bors cancel |
Canceled. |
19677: boards/nucleo-l432k: provide three periph_timer instances r=maribu a=maribu ### Contribution description - `cpu/stm32/periph_timer`: Generalize to also work with timers that do not have 4 channels - `boards/common/stm32`: Add timer config for three timers based on TIM2, TIM15, and TIM16 (the three general-purpose timers of the STM32L4) - `boards/nucleo-l432kc`: Make use of the new timer config 19683: cpu/sam0_eth: clean up init() r=dylad a=benpicco Co-authored-by: Marian Buschsieweke <marian.buschsieweke@ovgu.de> Co-authored-by: Benjamin Valentin <benjamin.valentin@ml-pa.com>
C'mon... |
Canceled. |
Build succeeded! The publicly hosted instance of bors-ng is deprecated and will go away soon. If you want to self-host your own instance, instructions are here. If you want to switch to GitHub's built-in merge queue, visit their help page. |
Thx :) |
Contribution description
cpu/stm32/periph_timer
: Generalize to also work with timers that do not have 4 channelsboards/common/stm32
: Add timer config for three timers based on TIM2, TIM15, and TIM16 (the three general-purpose timers of the STM32L4)boards/nucleo-l432kc
: Make use of the new timer configTesting procedure
make BOARD=nucleo-l432kc -C tests/periph/timer flash test
Issues/PRs references
None