Hello @S.A.M ,
Regarding the flickering, that sounds a lot like a memory bandwidth issue. it sounds like the DMA2D isn't getting enough bandwidth to perform the background rendering operation. I'm wondering if something is fundamentally wrong, like the main CPU clock is not configured correctly, or the memory cache is not enabled?
My colleague put some time into further optimizing this for you. I have copied her reply below:
I modified gx_circular_gauge_background_draw to make it work for multiple circular gauge case, see attachment.
Call _gx_icon_background_draw after call gx_display_driver_callback_assign to set wait function, so that needle rotation can be process while the hardware is drawing circular gauge background.
I also created a demo with 4 circular gauges for STM32H753I-EVAL board, see attachment.
- Use LCD refresh interrupt as timer source to increase frame rate of the animation.
- Replace gx_circular_gauge_background_draw with the modified version.
- gx_display_driver_callback_assign is NOT set, frame rate is around 49.4 frames/second
- gx_display_driver_callback_assign is set, frame rate is around 55.6 frames/second.
She found that the order of setting the display driver callback and drawing the background image was wrong (a bug), and fixed it in the attached gx_circular_gauge_background_draw.c. However as you can see, the difference between running the needle rotation code in parallel with background drawing is not dramatic, 49 fps to 55 fps. Either case is much better than the performance you are reporting, which again makes me wonder if something very fundamental is incorrect in your CPU/memory configuration. I copied links below for the modified source file and the example project which she created for STM32H753I eval board. This change will be in our next GUIX update release.
Modified GUIX lib source file: https://expresslogic.sharefile.com/d-s3b26ec2edbc64b4787859810230b3a85
Circular gauge test project: https://expresslogic.sharefile.com/d-sa9bdeffed18a47faa8a0c09aac531191
hi @S.A.M ,
15 FPS seems like a reasonable rate for updating a gauge. What target FPS are you wanting to see?
Yes but it's not only about frame-rate, It's running slow as well, several times slower than what it should be;
I need at least above 30 fps for smooth movements of the gauge I think.