How to rotate display 180degree in iMX6ULL

Dear. Toradex Engineers.

Hi I am Jin and beginer in embedded linux

I am trying to use 3.5" LCD panel with Colibri iMX6ULL.

I could display qt demo of Colibri iMX6ULL on the LCD.

I did setting about LCD resolution by using Device Tree Customization(code is below)

and I want to rotate the display at 180degree

How to that? more the using Device Tree Customization? or Do I have to edit uEnv.txt ?

help me. thank you

&lcdif {
display = <&display0>;

    status = "okay";

    display0:lcd-display {
            bits-per-pixel = <16>;
            bus-width = <18>;

            display-timings {
                    native-mode = <&timing_qvga>;

                   /* Standard QVGA timing */
                    timing_qvga: 320x240 {
                            clock-frequency = <6500000>;
                            hactive = <320>;
                            vactive = <240>;
                            hback-porch = <68>;
                            hfront-porch = <19>;
                            vback-porch = <18>;
                            vfront-porch = <3>;
                            hsync-len = <1>;
                            vsync-len = <1>;

                            de-active = <0>;
                            hsync-active = <0>;
                            vsync-active = <0>;
                            pixelclk-active = <0>;



You could try this

You can rotate your virtual framebuffers using fbcon. 0 through 3 to represent the various rotations:

0 - Normal rotation
1 - Rotate clockwise
2 - Rotate upside down
3 - Rotate counter-clockwise

These can be set from the command line by putting a value into the correct system file. Rotate the current framebuffer:

echo 1 | sudo tee /sys/class/graphics/fbcon/rotate

Hi @LeeSeongJin

Did the suggestion of adrian help?

Best regards,

Thanks adrian for your answer.

I tried your comment using command ‘echo 1 | sudo tee /sys/class/graphics/fbcon/rotated’ at some different word.
I could see a variable(/sys/class/graphics/fb0/rotate) in my board at Colibri iMX6ULL and I command ‘echo 2 > /sys/class/graphics/fb0/rotate’. I saw rotate is ‘2’ by using ‘cat’. but the display was not rotated immediately. So I rebooted. The display was not changed and I checked the ‘rotate’. It is ‘0’.

I am using image ‘Qt fot demo 5.15.1’
so I think it is different LXDE for iMX6ULL supplied by Toradex site.

Colud you help me? I don’t know why it didn’t rotate a display…

Do you know the why using to edit ‘uEnv.txt’ file in image file before install image.
I have rotated the RasspberryPi 4 display at this way that write ‘lcd_rotate = 2’ in ‘config.txt’ file.
or I think rotate command to put In Device Tree. But I don’t know where and how to put the command in *.dtsi file…

Greetings @LeeSeongJin!

Since you’re using BSP 2.8, you can also try rotating the screen using xrandr, e.g. xrandr --rotate inverted.

Do you intend to use a Qt application? If so, I’d suggest using Qt’s own rotating functions to do so when developing your application.
Since the iMX6ULL doesn’t have any graphics acceleration, any framebuffer or X rotation you might do will result in higher CPU usage.