cancel
Showing results for 
Search instead for 
Did you mean: 

Using TIM2 with TouchGFX

eng23
Senior

Hello,

I tried to use tim2 in my firmware but in CubeMX when TouchGFX is enabled tim2 is disabled..

In TGFX tab there is a parameter "Timer for Instrumentation" where I can choose between timer 1, 3, 5, 8 and 12, but is it doesn't affect tim2.

Is possible to use tim2 when I'm using TouchGFX?

"Timer for Instrumentation" is used for what?

Regards.

11 REPLIES 11
Martin KJELDSEN
Chief III

Hi @eng23​,

Can you show me a screenshot of that? It's not disabled for me (F7 based project).

Thanks,

/Martin

eng23
Senior

Hi @Martin KJELDSEN​ ,

Of course, here is the screenshot:

0690X000009XheLQAS.png

If I disable TouchGFX Middleware TIM2 is available to use.

Regards.

Anderson

eng23
Senior

Hi @Martin KJELDSEN​ ,

Any guess about this issue?

Regards,

Anderson

Martin KJELDSEN
Chief III

Hi @eng23​,

I see what you mean now. I'm pretty sure i've been able to select it in earlier versions, but i cannot in recent ones. CubeMX does suggest that it's already in use by some other component in TouchGFX, but it's not something i can make sense of. I'll try to dig deeper.

Martin KJELDSEN
Chief III

The only Timer we use from CubeMX is for MCU instrumentation and this is set to 1 by default (For F7). And i still cannot enable TIM2 for anything. I think this may be a bug in CubeMX.

/Martin

eng23
Senior

Hi @Martin KJELDSEN​ ,

Ok thanks for feedback. I will try implement manually and verify if it works.

Regards,

Anderson

Martin KJELDSEN
Chief III

Okay, let me know how it goes!

DWeie
Associate III

Sorry to revive an old issue. I am just starting to dig into this exact problem and was wondering if there was any new information regarding it. I've been able to verify that after calling touchgfx::touchgfx_init(); that there is a change to the TIM2 ARR register. It is set to 0xFFFFFFFF. No other register is changed however and after allowing TouchGFX to run for sometime and pausing execution I can see that the ARR register is set to 0 again. It seems strange but it also seems as if the timer is not in use by TouchGFX and should be fine to use. Do you have any thoughts on this @Martin KJELDSEN​ ?

Thanks!

Don

Hi @DWeie​ 

I'm using TIM2 to other things. It is not possible to init TIM2 by Cube, because TouchGFX doesn't allow, but in fact TouchGFX doesn't use TIM2.

So the solution is init TIM2 manually.

Regards