Skip to main content
Associate III
September 11, 2025
Solved

LTDC Rotation 180 degres

  • September 11, 2025
  • 12 replies
  • 1212 views

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

Best answer by LouisB

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,

12 replies

Visitor II
October 10, 2025

Hi @LouisB ,

Thanks for your answer. I adapted it with 32bpp as I didn't see the NEMA_RGB24 option, and used the ARGB888 format. I will make the modifications to avoid wasting RAM. My dsign is also based on a STM32H7R/S, and the 24bpp TouchGFX example. Maybe the solution is to use the GFXMMU to expose 24bpp virtual buffers based on the 32bpp calculated buffers?

I now face another problem: my display is 800x480, but is used in portait mode (so with a 90° rotation in TouchGFX designer). It works well when a full redraw is performed, but I have some strange behaviours with partial redraws: usually the first partial redraw after a full refresh is OK, but the subsequent ones are not OK. Part of the new redraw is OK, but with strange effect located on the first partial redraw.

I tried to investigate a little deeper but now I'm not really sure how the format and coordinates are handled between LTDC (setup with 800x480) and TouchGFX rectangle objects. Do you know how to translate the different coordinates? Or maybe is it related to the cache management?

I can share my project with you if you want to evaluate the problem, or we can even setup a call as I suspect we both are in France.

Thanks for your help

ST Employee
October 15, 2025

Hello @bluespark ,

 

1) Yes, H7R/S doesnt support 24bits, you have to use GFXMMU so the 32bits is mocked as a 24bits.

2) This has to be an issue with the coordinates, I dont think the cache is the problem and I dont know direct translation trial and error is my best bet. 

3) In the forum we only offer free support but if you'd like to have a more complete support, you can also escalade the thread and be contacted by us.
Could you open a new thread ? There you share your project to me and I can take a look.

Br,