cancel
Showing results for 
Search instead for 
Did you mean: 

Where should GPIO set and clear functions be called in TouchGFX

jung
Associate

I understand that when the gpio set/clear functions are called, it's possible to check the values of VSYNC_FREQ, RENDER_TIME, FRAME_RATE, and MCU_ACTIVE.

  1. Where is RENDER_TIME called? While I have confirmed that VSYNC_FREQ is explicitly called in HAL_LTDC_LineEventCallback, RENDER_TIME seems to be called by the library, and I am uncertain about the specific calling location.
  2. Where should FRAME_RATE and MCU_ACTIVE be called? It appears that FRAME_RATE and MCU_ACTIVE are not called automatically, so the user may need to specify the calling location. Can Frame rate be placed in TouchGFXHAL::beginFrame and TouchGFXHAL::endFrame?
2 REPLIES 2

Hello @jung ,

Those pins that you mentioned (VSYNC_FREQ, RENDER_TIME, FRAME_RATE, and MCU_ACTIVE) are already activated and implemented for usage in the TouchGFX core. So, you just need to assign some pins in your STM32CubeMX project to represent these signals, therefore, you don't need to call them yourself. Then, you can start seeing the performance by connecting the pins to an oscilloscope or logic analyser.
You can read more about those pins here:
https://support.touchgfx.com/docs/development/touchgfx-hal-development/scenarios/scenarios-measure-performance#performance-metrics

I hope this helps you

Good luck

Mohammad MORADI
ST Software Developer | TouchGFX

I have a similar question and I didn't find the provided answer to my satisfaction. I'm using the STM32H735G-DK development board and I have modified the project to work without FreeRTOS (I've attached my oswrappers). It works, but I noticed only MCU_ACTIVE is NOT set by TouchGFX. If I set it while backPorchExited is being called, then MCU_ACTIVE behaves exactly the same as RENDER_TIME. If I check the documentation I see something different:
https://support.touchgfx.com/docs/development/touchgfx-hal-development/scenarios/scenarios-measure-performance#performance-metrics

MCU_ACTIVE can become low during parts of the RENDER_TIME in this example.

I use isVSyncAvailable() and when false I run my own code in the loop. Only when isVSyncAvailable is true I call backPorchExited (during which I set MCU_ACTIVE). Higher priority "tasks" are run in a timer interrupt (and they quickly finish in a few cycles) or peripheral interrupt.

taskYield and taskDelay are not called. But I did notice that if I push a button takeFrameBufferSemaphore is waiting for a semaphore to be available. If I clear MCU_ACTIVE there and call my own idle function I get the same pattern as in the example (I also added an MCU_IDLE signal during this waiting time). However I still wonder why this is happening inside the library.

So my questions are:

 

  1. why is it waiting for the buffer to be available again? Is it copying graphics using a DMA? Is it waiting for some type of interrupt? Obviously it's waiting for something without using the MCU core.
  2. when is the LTDC writing to the display? Is this during the high or the low part of the VSYNC_FREQ?
  3. I noticed the following article talks about hooks that are available at different stages of rendering. I didn't find those anywhere. Where can I get access to these hooks? https://support.touchgfx.com/docs/development/touchgfx-hal-development/touchgfx-al-development-introduction

 

TouchGFX_timing2.png

Kudo posts if you have the same problem and kudo replies if the solution works.
Click "Accept as Solution" if a reply solved your problem. If no solution was posted please answer with your own.