cancel
Showing results for 
Search instead for 
Did you mean: 

How do i configure Landscape orientation for STM32F429I-DISC1 (native portrait) ?

DM?�l.11
Associate II

Hello,

I tried a project created by @Mon2​ in this post. I've converted the SW4STM32 project to Atollic one and build it with arm-atollic-eabi-gcc and arm-atollic-eabi-g++ (gcc -v 6.3.1). Everything worked fine so i swapped the resolution in *.touchgfx file to make it landscape, edited the screen and generated code. Then i added the line

HAL::getInstance()->setDisplayOrientation(ORIENTATION_LANDSCAPE);

to main.cpp (just before start of kernel) and suitable include. Rebuild the project and uploaded it to the board. After these steps the UI components like buttons (except flex button), sliders and some others does not render correctly (pic bellow), but function normaly.

So my question is - What am i doing wrong? Or is this some bug in TouchGFX? (found similar issue here but for STemWin)

 Edit:

added zip with project

0690X000009XdygQAC.png0690X000009XdzFQAS.jpg

1 ACCEPTED SOLUTION

Accepted Solutions
DM?�l.11
Associate II

Thank you for your quick answer.

From link you have provided this part was the problem:

To summarize, the rotate90 flag must be applied to your asset generation if one of the following is true:

  • Your application is in portrait mode and the display is natively in landscape mode, or
  • Your application is in landscape mode and the display is natively in portrait mode.

so changes i made in config/gcc/app.mk are

BEFORE
# Settings for image converter screen orientation (empty string =
# default value, -rotate90 rotates the image 90 degrees)
screen_orientation :=
 
AFTER
# Settings for image converter screen orientation (empty string =
# default value, -rotate90 rotates the image 90 degrees)
screen_orientation := -rotate90

View solution in original post

3 REPLIES 3
Mon2
Senior III

Hi @Dominik Müller​ , agree with the results that you are observing and we saw the same when we were writing the referenced documentation.

Please review the following which may help:

https://touchgfx.zendesk.com/hc/en-us/articles/203563972-Display-Orientation

We just ran out of time to give this topic the proper attention. Suspecting that something simple was missed.

@Martin KJELDSEN​ is the guru and developer of the TouchGFX toolchain who will know best. As a suggestion, consider to post your (basic) project for a review and additional feedback. If you do find a fix, please post your solution.

DM?�l.11
Associate II

Thank you for your quick answer.

From link you have provided this part was the problem:

To summarize, the rotate90 flag must be applied to your asset generation if one of the following is true:

  • Your application is in portrait mode and the display is natively in landscape mode, or
  • Your application is in landscape mode and the display is natively in portrait mode.

so changes i made in config/gcc/app.mk are

BEFORE
# Settings for image converter screen orientation (empty string =
# default value, -rotate90 rotates the image 90 degrees)
screen_orientation :=
 
AFTER
# Settings for image converter screen orientation (empty string =
# default value, -rotate90 rotates the image 90 degrees)
screen_orientation := -rotate90

Martin KJELDSEN
Chief III

So happy you guys worked it out together!

Generally, about display orientation in TouchGFX. What we're doing here with this configuration change is tell the image converter in TouchGFX to generate all the images rotated 90 because we haven't changed the hardware configuration of the display. It's still projecting pixels as if it was in landscape mode. This is why you saw the circle work fine (because it supports display orientation in source code), but your images looked wrong (dimensions okay).

It's a software solution to rotation.

Every time you see these vertical lines in TouchGFX applications it has something to do with offset problems (which this kind of is - you're rendering an image that is not rotated).

Best regards,

Martin