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
F4 timers not clocked at init #39
Comments
I had an application in which I had headache figuring out why it did not work. |
i'm thinking for timer initialization at reset, it is adequate to simply clock the timers and pause() (disable) the timer. my guess is that this should reduce power consumption somewhat since the timers are not running. i'm also thinking if we should try to be 'helpful' (e.g. setting TIMER_CR1_ARPE) or that we'd just leave it at the reset state but just disable the timers. i.e. TimerX.pause() The initialization configuration are useful but that it should probably be done in user codes since we'd not know ahead the application scenario that is relevant. i'd think timers probably can have more support functions in the library e.g. output control, the thing is sometimes timers are just used to run other peripherals and the user may not want output to go on the pins. But we can work those additional functions as we go along. i'm also thinking we'd clock the common timers e.g. TIM1, TIM2-5 and leave others unclocked. this could help save some power. and the availability of other timers tend to differ across socs |
hi while messing with the timers on F4. i found it strange that the timers registers did not retain their values. on tracing the codes in debug.
i found that timers are not initialized.
it turns out there is a return statement right at the beginning of the timers initialization.
https://github.com/stevstrong/Arduino_STM32/blob/master/STM32F4/cores/maple/boards.cpp#L125
any reasons for this codes, effectively by passing initialization?
in addition, i'd think we can leave the timers in the disabled state after they are initialized.
and let user codes start the timers if they need them. e.g. commenting or removing the timer.resume()
https://github.com/stevstrong/Arduino_STM32/blob/master/STM32F4/cores/maple/boards.cpp#L155
The text was updated successfully, but these errors were encountered: