cancel
Showing results for 
Search instead for 
Did you mean: 

Integrating a Timer Interrupt with TouchGFX Graphics

TLahr.1
Associate III

I'm working with the STM32F769I-DISCO board.

I initialized a timer with an interrupt in main.cpp and I put an infinite while(1) loop before all the TouchGFX graphics initialization functions. The interrupt works fine, toggling an LED every second.

However, when I let the graphics initialize, the interrupt doesn't seem to be working. The LED just remains in it's initial state. Is this because the TouchGFX runs in another thread? Is there a way I can have the timer interrupt working to toggle the LED while the TouchGFX graphics are running?

Thank you

2 REPLIES 2
Martin KJELDSEN
Chief III

Hi @TLahr.1​,

It may be because of the priority of your interrupt in the NVIC settings. TouchGFX uses 2-3 interrupts, primarily, which are configured to have the same priority. In your case DSI, LTDC, DMA2D.

You should be able to toggle an LED from an interrupt while TouchGFX is running. We do it all the time - E.g. all our LTDC interrupt handlers are instrumented with calls to a GPIO class that toggles an led on VSYNC, RENDER_TIME, etc, to make performance visible.

/Martin

I tried setting the priority of the timer to different values... I tried greater than, less than, and equal to the priority of the DSI, LTDC, DMA2D.

The timer interrupt still doesn't seem to be working while the TouchGFX is running in any of the above cases.

Is there a particular spot I have to initialize the timer?