2025-03-26 1:55 PM
Hi again, (posting twice today)
I am looking at the performance of my STM32H747 system to better understand it. I didn't think there were any problems because I am not visually seeing any artifacts, but I always like to check. As it turns out, my system's rendering times are abysmal.
I have many different screens in my application, and for this test the system cycles from one to another every 3 seconds. I used the Performance Measurement pins to measure VSYNC_FREQ, RENDER_TIME, FRAME_RATE, and MCU_ACTIVE.
VSYNC looks healthy, measured at 62,352HZ (set to ~62,4Hz).
The MCU appears to be barely active - there are 10ns or less blips occurring frequently.
Frame rate is a consistent 3 seconds (I don't know if that's normal).
But the rendering time is abysmal! The screens are 480x320 and some take hundreds of milliseconds to render when switching screens.
This is the system as it's switching screens:
This is system when there are no updates to render:
The simplest screen takes 25ms to render and it contains a 480x320 background image. The most complicated screen takes 218ms to render and it contains a 480x320 background image, 8 text areas (some contain wildcards), 3 flex buttons, and a few icons, (and one hidden background image that's not being used).
I sense that I am doing something very wrong, I wanted to ask if there are common places to look.
Things that come to mind for me,
Thanks!
Julia
2025-03-27 3:14 AM
Hello @jchernus-fikst ,
Here is a typical measurement from a random board with a regular UI:
Here is the example of measurement that you find on our documentation:
As you can see, they are very similar unlike your measurement.
The VSYNC gets high about 60 times per second (you do that right).
The render time starts when the VSYNC gets high (you do that right).
The framerate is the same as the VSYNC (not for you).
The MCU _ACTIVE starts when VSYNC gets high, aka we start rendering as soon as possible (this is not the case for you, perhaps your MCU is busy with something else).
Your framerate should be 60 per second like your VSYNC.
What happens if you try to change screen every second? Are you able to do that or did you set up your board to only be able to render every 3 seconds (I doubt that because there is a render time peak every 16ms)?
Your render time picks every 16ms showing that TouchGFX want to render something every 16ms but it is extremely fast to render, perhaps there is nothing to render as MCU_ACTIVE is not even getting a peak everytime.
Regarding the screenshot during the transition, we can see that the render starts (and last 200+ ms) and once it is finished it does not transfer directly, it waits for the next VSYNC to start a render and then transfer (because FrameRate changes). It is normal because to transfer we wait for VSYNC so we skip frames if the rendering takes too long.
However, we see that when the rendering finishes, the MCU is not even active so there is definitely something wrong.
You say that it takes 25ms to render a simple image in 480*320*2 bytes. That is way too much, perhaps you are right, this is a memory limitation if this asset is in external memory.
Can you test to put this asset in internal memory and see if it renders faster?
You can also try to just make a screen with boxes, circles, lines and other widgets that do not require to be stored in memory (this way the memory won't be used, only the rendering will be limiting).
It is recommended to disable DCache until you have a stable project.
If you have an image that is hidden by some other element(s), the hidden image will not impact the render time as long is the other element on top do not have an alpha value.
So if everything on top is RGB565 it will be fine, but if the element on top is ARGB8888 then we will do blit operations.
Vector font do increase render time but your render time is already abnormal for a simple image (25ms).
Note that texture mapper and VSG (including vector font but I think it depends on the size) takes quite some time to render.
Can you check the priority of your tasks? Perhaps there is something that has a way higher priority than TouchGFX and is taking all the RTOS's resources.
I hope you can investigate and try to change screen every tick (60 times per seconds) with a simple UI.
Regards,