Rotate screen issue - v6.0 - ILI9341


I’m trying to rotate the screen with modification some parameters as you can see below;

// lv_conf.h
#define LV_HOR_RES_MAX (320)
#define LV_VER_RES_MAX (240)

// tft.h
#define TFT_HOR_RES 320
#define TFT_VER_RES 240

// tft.c
disp_drv.rotated = 1;

Also, I have changed some parameters to rotate and mirror the screen on TFT parameters. Furthermore, I have changed the synchronization parameters of the TFT in order to scan the screen at the exact time.

Moreover, I have swapped the touchscreen X and Y coordinates in order to adapt to the new rotated screen objects’ coordinates.

But, I have already a problem as you can see in the picture. The label shows X and Y coordinates of the middle left of the screen. So, the screen data is still sent as portrayed mode (X:240, Y:320).

How can I fix this issue or What should I do to change the screen buffer as landscape mode (320x240).




Please test what coordinates you get in flush_cb. When it runs at the first time it should get the full width (in landscape mode x1 = 0; x2 = 319).


All dimensions of the littlevGL and LCD driver set to 320x240 and rotated = 0, I can get in flush_cb, x2 = 319. The screen data is also true. But as you have mentioned before this problem is LCD driver problem not because of littlevGL. May be there is timing or, sync problem I dont know.

F469 Discovery version uses OTM8009A driver and there is some parameters for landscape mode in it. So when using littlevGL on F469, you can switch the screen between portrait and landscape mode with changing some parameter in the driver also in littlevGL tft.c file.

So, I agree with your opinion about the problem because of LCD driver.

If anyone can solve the ILI9341 landscape mode configuration or find any solution please share with us.

thanks @kisvegabor.


If I remember correctly, you can change ILI9341 init sequence to select portrait/landscape on the hardware itself.

Maybe you haven’t seen it already, there is this command in the data sheet of ILI9341:
8.2.29. Memory Access Control (36h)

I have already seen that bit. But it is equal to 0 (zero) in the code.

I guess there is an error on the datasheet. MV != Vertical Refresh Bit. So, if this is ML(Vertical refresh bit) this is already = 0. If this is MV(Row/Column Exchange) bit, this have to be = 1 to rotate the screen. May be this info try to explain us, “if you should send more data, it will be overwright when row/column exchange bit = 1”.

So, in my driver configuration, MV = 1, ML = 0.

I suppose you have tried other configs too to see if something happens.

Hi muratze,
I am exactly wwhere you were in july, I try to rotate the screen on my STM32F429,
Have you solved this isseue, if yes I will appreciate if you can share how to fix it ?

Best regards,


I am using stm32f429 discovery. I have the same problem. I changed the value of register 0x36 to 0xA8. I also changed the HOZ and VER values for both lv_conf and tft.h but it did not show the width horizontally. help me.

Search for this on this forum.
[Littlevgl STM32F429 ILI9341 Rotate Landscape Solved]
Best regards