M5Stack blank screen

Thanks for testing it, I will update the menuconfig so the correct options get chosen automatically.

Regards
Carlos

Hi @mair.swartz, Just to let you know that I have updated the menuconfig, now when you choose the M5Stack display configuration the backlight control should be enabled and is set to active high by default, the options don’t appear on the menu, they are set to the correct values in the “background”.

Could you test it and let me know if it works as expected? You will need to pull the latest master.

@Carlos_Diaz I did a

git pull --recurse-submodules

I tried it again but unfortunately I still needed to set the pins and the back-light.

Let me know if you would like me test it in a different way

Hi,

I haven’t set the pin assignments to be automatic yet, I will do that in the following days, maybe tonight.

To test the backlight enable and active level you must be on the master branch and then do a pull, something like this:
$ git checkout master
$ git pull origin master

Then do:
$ idf.py menuconfig
And choose the M5Stack predefined display configuration and the menu should look like this:
new_m5

You can tell the backlight control and active level options “dissapeared”, thats how the menuconfig set them automatically on the background.

Set the correct pins and save the configuration.

$ idf.py build
$ idf.py flash

Regards and thanks for the help testing this :slight_smile:

@Carlos_Diaz yes, pin assignment is not automatically changed when selecting predefined display.

Will fix that once i get home, I’m at work right now (don’t tell my boss)

Regards

Confirmed. It works except the pin assignment

Hello @Carlos_Diaz boss, I will tell you that he’s active on forum at work :rofl:

Also, the correct orientation for M5Stack, or at least M5Stack Fire that I have is in landscape mode.
so the correct value for MADCTL register is 0x08 instead of 0x68.

https://github.com/littlevgl/lv_port_esp32/blob/master/components/lvgl_esp32_drivers/lvgl_tft/ili9341.c#L120

Will add options to set the orientation of different displays, will include this one.

I’ve updated the menuconfig, now when you choose a predefined display (ie M5Stack) the menu Display pin assignments will not be available and the correct pins will be assigned automatically. Can you test it?

I didn’t had time to add code for the orientation of the display, but i will keep it in mind.

Regards
Carlos

Hi @tjstyle and @Carlos_Diaz
I tried to set this value but I get the following


It seems the right hand side is incorrect.

Hi @mair.swartz,

Do you mean you tried this?

Also, the correct orientation for M5Stack, or at least M5Stack Fire that I have is in landscape mode.
so the correct value for MADCTL register is 0x08 instead of 0x68 .

If so i think we also need to update the height and width of the display, but I’m not sure. If you want/can test it before me edit this file lv_port_esp32/components/lvgl_esp32_drivers/lvgl_tft/Kconfig

Before:

config LVGL_DISPLAY_WIDTH
int “TFT display width in pixels.” if LVGL_PREDEFINED_DISPLAY_NONE
default 240 if LVGL_PREDEFINED_DISPLAY_M5STACK
default 480 if LVGL_PREDEFINED_DISPLAY_ERTFT0356 || LVGL_PREDEFINED_DISPLAY_ADA_FEATHERWING
default 320
config LVGL_DISPLAY_HEIGHT
int “TFT display height in pixels.” if LVGL_PREDEFINED_DISPLAY_NONE
default 320 if LVGL_PREDEFINED_DISPLAY_M5STACK || LVGL_PREDEFINED_DISPLAY_ERTFT0356 || LVGL_PREDEFINED_DISPLAY_ADA_FEATHERWING
default 240

After

config LVGL_DISPLAY_WIDTH
int “TFT display width in pixels.” if LVGL_PREDEFINED_DISPLAY_NONE
default 320 if LVGL_PREDEFINED_DISPLAY_M5STACK
default 480 if LVGL_PREDEFINED_DISPLAY_ERTFT0356 || LVGL_PREDEFINED_DISPLAY_ADA_FEATHERWING
default 320
config LVGL_DISPLAY_HEIGHT
int “TFT display height in pixels.” if LVGL_PREDEFINED_DISPLAY_NONE
default 240 if LVGL_PREDEFINED_DISPLAY_M5STACK || LVGL_PREDEFINED_DISPLAY_ERTFT0356 || LVGL_PREDEFINED_DISPLAY_ADA_FEATHERWING
default 240

Let me know if that solve it.

Carlos

Works Beautifully :partying_face:

Great, I will try to add the orientation option on the menuconfig as soon as possible.

@mair.swartz

I’ve added a new option on the menuconfig to set the display orientation, can you please test it with your display? The new code is in the display_orientation branch of the lv_port_esp32 repo, the change you did on the Kconfig file is now handled automatically.

imagen

imagen

Regards

Hi @Carlos_Diaz

Landscape seems OK


Portrait not so much

Also in CMAKELists.txt root
include($ENV{IDF_PATH}/tools/cmake/project.cmake) breaks the build when using littlevgl as a sub-module
I commented that line out in order to get it to build

Hi,

Thanks for testing it.

In portrait mode the display should be oriented with the buttons on the side, like rotating it 90 degrees, anyway the result is wrong, I will try to find out why is that, meanwhile, can you try with 0x28 instead of 0x68 in https://github.com/littlevgl/lv_port_esp32/blob/900c1d18bd380d0f9c34dc1090fab8fe732e3000/components/lvgl_esp32_drivers/lvgl_tft/ili9341.c#L122

I got a ILI9341 based display, but I can test the new value until tonight.

About the line you had to comment out, I’ve added that info into the readme, in the Temporal workaround section.

Swap the default height and width in lv_conf.h:

#define LV_HOR_RES_MAX          (CONFIG_LVGL_DISPLAY_WIDTH)
#define LV_VER_RES_MAX          (CONFIG_LVGL_DISPLAY_HEIGHT)

I swap the height and width values in the menuconfig based on the display orientation (for now only on the M5Stack):

config LVGL_DISPLAY_WIDTH
    int "TFT display width in pixels." if LVGL_PREDEFINED_DISPLAY_NONE
default 480 if LVGL_PREDEFINED_DISPLAY_ERTFT0356 || LVGL_PREDEFINED_DISPLAY_ADA_FEATHERWING
    default 240 if LVGL_PREDEFINED_DISPLAY_M5STACK && LVGL_DISPLAY_ORIENTATION_PORTRAIT
    default 320 if LVGL_PREDEFINED_DISPLAY_M5STACK && LVGL_DISPLAY_ORIENTATION_LANDSCAPE
default 480 if LVGL_PREDEFINED_DISPLAY_ERTFT0356
default 480 if LVGL_PREDEFINED_DISPLAY_ADA_FEATHERWING
default 320

config LVGL_DISPLAY_HEIGHT
    int "TFT display height in pixels." if LVGL_PREDEFINED_DISPLAY_NONE
    default 320 if LVGL_PREDEFINED_DISPLAY_M5STACK && LVGL_DISPLAY_ORIENTATION_PORTRAIT
    default 240 if LVGL_PREDEFINED_DISPLAY_M5STACK && LVGL_DISPLAY_ORIENTATION_LANDSCAPE
default 320 if LVGL_PREDEFINED_DISPLAY_ERTFT0356
default 320 if LVGL_PREDEFINED_DISPLAY_ADA_FEATHERWING
    default 240

Do you think we should do in other way?

Last night I was able to configure the display of the Wrover kit v4 in two different orientations and realized that in fact there are 4 possible orientations, so I wanted to ask you guys how would you name those orientations, should we use the display connector as reference point?

I have pushed the new commit so yall can see were I made the changes for it.