Skip to content

HardwareTimer stuck when using refresh() #617

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

Closed
stas2z opened this issue Aug 28, 2019 · 2 comments · Fixed by #618
Closed

HardwareTimer stuck when using refresh() #617

stas2z opened this issue Aug 28, 2019 · 2 comments · Fixed by #618
Assignees

Comments

@stas2z
Copy link
Contributor

stas2z commented Aug 28, 2019

Using latest git snapshot to test hardware timer (trying to port SoftSerialIntAP to this core)
When i try to use resfresh() before resume() timers never start.

It's easy to reproduce it using timebase_callback example provided, just add refresh before resume in it
https://github.com/stm32duino/STM32Examples/blob/master/examples/Peripherals/HardwareTimer/Timebase_callback/Timebase_callback.ino

  • OS: linux 4.x
  • Arduino IDE version: 1.8.9
  • STM32 core version: 1.7.0 git
  • Upload method: STLink
  • Name: Nucleo 64 F103RE (RB chip burned, replaced with RE and added new variant for it)
@fpistm
Copy link
Member

fpistm commented Aug 29, 2019

Hi @stas2z ,
Thanks for reporting.
we will investigate this. Mainly @ABOSTM our expert 💪 😉

@ABOSTM
Copy link
Contributor

ABOSTM commented Aug 29, 2019

Hi @stas2z ,
In fact it is not possible to call refresh() before the fisrt call to resume() because timer (the hardware registers) will not be yet initialized.
And there is no reason to do so: refresh() is usefull only while timer is running, in case you modify some parameters like capture/compare to make sure value is taken into account immediately, otherwise value is taken into account at next update event (timer rollover).
So as a general rule call refresh() only after resume(). I will add a comment about that in source code.

ABOSTM added a commit to ABOSTM/Arduino_Core_STM32 that referenced this issue Aug 29, 2019
By the way fixo typo in setPrescaleFactor()

Fix stm32duino#617
ABOSTM added a commit to ABOSTM/Arduino_Core_STM32 that referenced this issue Aug 29, 2019
By the way fixo typo in setPrescaleFactor()

Fix stm32duino#617
fpistm pushed a commit that referenced this issue Aug 29, 2019
By the way fixo typo in setPrescaleFactor()

Fix #617
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants