2017-04-25 12:42 AM
Posted on April 25, 2017 at 09:42
I configured TIM7 as time base timer using HAL_TIM libs as indicated in this post:
https://community.st.com/0D50X00009XkYJ6SAN
At interruption callback I increase a counter var in order to get multiples of 100us timings for different tasks. But first I started trying and testing with toggle led every 500ms (I know is a low freq but i need to see it with my eyes).
The fact is that when app runs in debug mode, it seems to start correctly: every 100 counts of cnt register one interruption is activated and counter increases unity. This ocurres until counter reaches once 11 or 12, but the number of the last attended interruption is about 12. After this, cnt counter runs and restarts correctly. But no interruption is activated, thread didn't pass to the irqhandler neither elapsedtimeinterruption callback.
Which could be the cause of this behavior?
Could be the cause on HAL library that is disabling updates or interruptions?
Solved! Go to Solution.
2017-04-27 06:05 AM
I must say that I solved it. I was debugging and after 12 aprox interruptios pc counters went to unkown part. I put a breakpoint at while (1) and thread never passed throught that point. When stopped I can see that was in startup_stm32l476xx.s file at SysTick_Handler line in a inifinit loop:
SysTick_Handler PROC
EXPORT SysTick_Handler [WEAK] B . ENDPI don't know exactly what is it. I know systick handler is a handler of 1ms ticks system clock for your system if you choose the systick as a source clock. But I didn't choose it. Anyways, as I see this tag: [WEAK] I started to think that it could be an user issue to implement this function or to declarate it, somewhere at user code. So, I don't understand too much why my system needs it, but it works.
I put as I saw in other examples:
void SysTick_Handler(void)
{ HAL_IncTick();}at stm32l4xx_it.c file.
After this, there were no more lost pc counter neither no lost interruptions.
2017-04-27 06:05 AM
I must say that I solved it. I was debugging and after 12 aprox interruptios pc counters went to unkown part. I put a breakpoint at while (1) and thread never passed throught that point. When stopped I can see that was in startup_stm32l476xx.s file at SysTick_Handler line in a inifinit loop:
SysTick_Handler PROC
EXPORT SysTick_Handler [WEAK] B . ENDPI don't know exactly what is it. I know systick handler is a handler of 1ms ticks system clock for your system if you choose the systick as a source clock. But I didn't choose it. Anyways, as I see this tag: [WEAK] I started to think that it could be an user issue to implement this function or to declarate it, somewhere at user code. So, I don't understand too much why my system needs it, but it works.
I put as I saw in other examples:
void SysTick_Handler(void)
{ HAL_IncTick();}at stm32l4xx_it.c file.
After this, there were no more lost pc counter neither no lost interruptions.