cancel
Showing results for 
Search instead for 
Did you mean: 

Why TIMER takes time to start up?

FCamp.1
Associate III

Hi,

I have a F439ZI where i have set a simple timer (TIM10) to raise the the HAL_TIM_PeriodElapsedCallback every 1 millisecond.

The Bus APB2 for timers runs at 168 MHz so i set in the configuration 168 in the prescaler (result is 1Mhz) and the i set 1000 in the counter period.

In fact he callback is fired every millisecond as expected. Problem is that it takes around 6 seconds to fire for the first time.

Any idea why?

Thanks a in advance,

Filo

11 REPLIES 11

You can't add anything elaborate if you don't know *why* and *from where* was the function called.

As I've said many times already, I wouldn't care what Cube is and does. Folks will always have opinions on software, regardless of how good or bad it may be; and that's inevitable, as everybody sees it from a different standpoint. I would simply ignore the existence of Cube (and I mostly do), wouldn't ST's policy be that Cube is the sole source of examples (i.e. I have to crack it in order to understand some details which are not properly documented in the manuals); and also I am concerned about the fact that all the money (which they have from selling chips, i.e. it's also my money) ST puts on examples goes onto Cube, instead of proper documentation and proper examples.

JW

Why, you can walk the stack, find out where it was called from, and call longjmp() with an error code =)