Skip to main content
eng23
Senior
June 27, 2019
Question

Using TIM2 with TouchGFX

  • June 27, 2019
  • 11 replies
  • 2238 views

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.

This topic has been closed for replies.

11 replies

Martin KJELDSEN
Principal III
June 28, 2019

Hi @eng23​,

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

Thanks,

/Martin

eng23
eng23Author
Senior
June 28, 2019

Hi @Martin KJELDSEN​ ,

Of course, here is the screenshot:

0690X000009XheLQAS.png

If I disable TouchGFX Middleware TIM2 is available to use.

Regards.

Anderson

eng23
eng23Author
Senior
July 2, 2019

Hi @Martin KJELDSEN​ ,

Any guess about this issue?

Regards,

Anderson

Martin KJELDSEN
Principal III
July 3, 2019

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
Principal III
July 3, 2019

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
eng23Author
Senior
July 3, 2019

Hi @Martin KJELDSEN​ ,

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

Regards,

Anderson

Martin KJELDSEN
Principal III
July 4, 2019

Okay, let me know how it goes!

DWeie
Associate III
October 28, 2019

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

eng23
eng23Author
Senior
October 30, 2019

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

DWeie
Associate III
November 5, 2019

Thanks for the reply. I've been able to make use of TIM2 as well.

Best,

Don