2025-09-11 7:25 AM
Hello i'm using touch GFX with STM32H7RS-DK And i need to evaluate for a future product if display rotation is possible.
I tried this implementation but drawCacheEnabled isn't reconize by software so i removed it and the widget is working but the screen flicker betwen 0 and 180° . Is there a more actual way of rotate a screen .
// Force redrawing entire screen
virtual void draw(Rect& rect)
{
if (drawCacheEnabled)
{
// Invalidate entire screen instead of requested rect.
Rect r(0, 0, HAL::DISPLAY_WIDTH, HAL::DISPLAY_HEIGHT);
Application::draw(r);
}
else
{
// Use original rect if we are *actually* drawing and not just invalidating.
Application::draw(rect);
}
}
Thanks
Solved! Go to Solution.
2025-09-23 6:01 AM
Hello @Hamady,
You are welcome, the project doesn't contain such a button, but it's implementation will mainly consist of a bypassing all the additional code (as rotations can be done in realtime). If the project answers your question, please mark it as best answer so other users can access it easily.
BR,
2025-09-11 7:58 AM
Hello @Hamady,
We do not support 180 rotation, usually for a product, the whole screen itself is rotated. Also some screen support rotation by setting some bits.
It's possible to achieve rotation, by rotating a copy of the framebuffer that you then send to the screen. You can use the GPU to do that with better performances.
May I ask, how did you come up with this code, I dont see how you can have a rotation with just that ?
BR,
2025-09-11 11:36 PM
Hello,
Thanks for the quick response
I got the code from here : https://community.st.com/t5/stm32-mcus-touchgfx-and-gui/repost-change-lcd-orientation-in-180-degree/m-p/376534
Do you have a sampling code or a tuto to achieve this via GPU.
Thanks !
2025-09-12 2:27 AM - edited 2025-09-12 2:28 AM
Hello @Hamady,
This code is from an old version, that is why the "drawCacheEnabled" wasn't working.
I can guide you on how this can be achieved but,I need to know what are the specs for your custom board project (screen resolution, amount of ram, ...) ?
BR,
2025-09-12 2:38 AM
Thanks @LouisB
Screen :https://newhavendisplay.com/3-5-inch-ips-tft-without-touchscreen/
Interface RGB 24bit (No acces to rotation pin and command like GRAM screen i suppose )
Resolution 320x240
Ram 256MB (same as DK board).
Thanks for the help.
2025-09-12 3:47 AM
And the chip will be the same as DK board ?
2025-09-12 4:26 AM
exactly the same !
2025-09-15 3:06 AM
Hello,
@LouisB any news about the solution for the GPU2D
Thanks !
2025-09-17 4:12 AM
Hello @Hamady,
We are working on a solution internally that uses GPU2D, I will get back to you when I have something.
BR,
2025-09-22 2:02 AM
Hello @Hamady,
Here's an example of 180 degrees rotation with GPU2D to summarize we use the NemaGFX to produce a rotated image that is updated, only in the requested areas (it doesn't invalidate the whole screen every frames). I provide a PowerPoint with some additional explanations.
Feel free to ask questions,
BR,