M5Stack blank screen

Description

I am having trouble getting the M5Stack Core Development kit displaying anything using the esp-idf (4.0)

What MCU/Processor/Board and compiler are you using?

M5Stack Core Development kit - ESP32

What do you want to achieve?

get a “hello world” sample running

What have you tried so far?

I have cloned the lv_port_esp32 repo and have successfully ran the sample code on a ST7789
I then hooked up an M5Stack and set the config for the M5stack. After flashing the screen remains blank.
I ran the sample Arduino code on the M5Stack and it shows correctly proving the device is working.
I have tried to set the pin assignments based on m5stack-core-basic-version documentation but with no luck

any advice would be appreciated

Hi,

I don’t have that kit at hand but let me investigate what can be the issue. Just a few questions, does the display have a background led?

@Carlos_Diaz yes it does

Hi,

Can you try to enable the backlight control (option Enable control of the display backlight by using an GPIO):

I don’t know if the backlight turns on with a logic 1 or logic 0, you will need to set or clear the option Is backlight turn on with a HIh logic level?

Please test it and let me know if it worked, if so let me know if the display turns on with a logic high or low and i will try to update the configuration to select the correct options automatically.

Regards
Carlos

@Carlos_Diaz, Yip That did the trick. Thank you so much. :slight_smile:

1 Like

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