2505 views|7 replies

155

Posts

1

Resources
The OP
 

[2022 Digi-Key Innovation Design Competition] 4. ESP32-S2-Kaluga-1 running LVGL [Copy link]

 

I have been quite busy in the past two weeks, and I only found time to test several cases in the Kaluga official repository "esp-dev-kits". Currently, except for the touchpad case, all others are working properly. However, through the analysis of the LCD component and the corresponding cases, I found that the official case only provides the LCD driver, but not the GUI, and the case only has the function of displaying the picture on the entire screen, so I decided to try to introduce lvgl.

1. Obtain from lv_port_esp warehouse

The one used here is a complete transplant repository "lv_port_esp32" from the lvgl homepage on GitHub - link:

链接已隐藏,如需查看请登录或者注册
.

Figure 4-1 Screenshot of GitHub homepage

According to experience, using the recursive cloning parameter "--recursive" indeed caused an error, so I chose to clone directly without parameters: "git clone https://github.com/lvgl/lv_port_esp32.git". In this way, there will be three linked repositories that have not been downloaded, and then they can be downloaded separately and placed in the directory with the same name.

The associated warehouse 1 is lvgl. I clicked the web link directly to go there, hoping to ensure the project version compatibility. However, an error was still reported during the compilation. Fortunately, I just commented out the useless statements.

Warehouse 1:

链接已隐藏,如需查看请登录或者注册
. I also got an error when cloning this warehouse. I successfully downloaded the zip file on the page and then naturally unzipped it to the "../components/lvgl" directory.

Warehouse 2:

链接已隐藏,如需查看请登录或者注册
. This warehouse only has several display driver source files, which can be directly cloned successfully and is located at "../components/lvgl_esp32_drivers".

Warehouse 3:

链接已隐藏,如需查看请登录或者注册
. The name of this warehouse is "lv_demo". In order to avoid mistakes (subsequent analysis of CMakeLists also determines that the name must be changed), after cloning, I changed the directory name to "lv_examples", and finally located at "../components/lv_examples/lv_examplees".

Figure 4-2 Direct cloning (non-recursive) of the three missing subdirectories (the third one is one level below lv_examples)

Figure 4-3 Path locations of three linked warehouses l

2. Project configuration (based on VS Code)

Directly use VS Code to open the root directory "lv_port_esp32", first select the MCU type "esp32s2" in the status bar, then click the "gear" button in the status bar - equivalent to executing "idf.py menuconfig", and finally execute build.

For the specific menuconfig configuration, I made the following modifications:

Figure 4-4 Status bar tool button of esp-idf plugin

Figure 4-5 lvgl configuration

Figure 4-6 LVGL ESP Drivers

Figure 4-7 LVGL ESP Drivers——Display Pin Assignments and Kaluga Schematic

Judging from the pin distribution, the LCD Touch pin and Camera pin of the Kaluga board are reused, so the touch screen is not turned on here.

3. Compile the project

The build will report two errors, both located in "../components/lv_examples/lv_examples/lv_demo.h".

One is that the header file "../lv_demo_conf.h" cannot be found. There are two ways to modify it: rename lv_demo_conf_template.h in the same directory to lv_demo_conf.h (this header file is not actually enabled), or simply comment out this header file connection.

The second is the conditional compilation of the version check. I don’t know if it is a selection problem in the download stage. The version check here does not meet 8.0.0, so the error message "#error" will be output. I simply comment it out.

Figure 4-8 Error reporting and modification methods in lv_demo.h

During the link phase, an error is reported that the lv_demo_widgets() function (located in ../lv_examples/src/lv_demo_widgets/lv_demo_widgets.c) is undefined. This is because the lv_demo_conf.h header file is not enabled, and the macro definition "LV_USE_DEMO_WIDGETS" is missing. However, when I try to add this macro, a large number of type mismatch errors (mainly various lvgl structures) are reported in the lv_demo_widgets.c source file. I guess it is because the version does not match 8.0.0.

Therefore, main.c is modified here, demo is not used, and only two labels are displayed, as follows:

static void create_demo_application(void)
{
    /* When using a monochrome display we only show "Hello World" centered on the
     * screen */


    /* use a pretty small demo for monochrome displays */
    /* Get the current screen  */
    lv_obj_t * scr = lv_disp_get_scr_act(NULL);

    /*Create a Label on the currently active screen*/
    lv_obj_t * label1 =  lv_label_create(scr, NULL);
    lv_obj_t * label2 =  lv_label_create(scr, NULL);  //added by author

    /*Modify the Label's text*/
    lv_label_set_text(label1, "Hello\nworld");
    lv_label_set_text(label2, "Nihao Shijie! Wonderful Tianjin!");

    /* Align the Label to the center
     * NULL means align on parent (which is the screen now)
     * 0, 0 at the end means an x, y offset after alignment*/
    lv_obj_align(label1, NULL, LV_ALIGN_CENTER, 0, 0);
    lv_obj_align(label2, NULL, LV_ALIGN_CENTER, 0, 50);//added by author

#if defined CONFIG_LV_TFT_DISPLAY_MONOCHROME || \      //moved by author
    defined CONFIG_LV_TFT_DISPLAY_CONTROLLER_ST7735S
    /* Otherwise we show the selected demo */

    #if defined CONFIG_LV_USE_DEMO_WIDGETS
        lv_demo_widgets();
    #elif defined CONFIG_LV_USE_DEMO_KEYPAD_AND_ENCODER
        lv_demo_keypad_encoder();
    #elif defined CONFIG_LV_USE_DEMO_BENCHMARK
        lv_demo_benchmark();
    #elif defined CONFIG_LV_USE_DEMO_STRESS
        lv_demo_stress();
    #else
        #error "No demo application selected."
    #endif
#endif
}

Figure 4-9 lvgl test case effect

This post is from DigiKey Technology Zone

Latest reply

Sir, please pay attention to the posting rules "Post Topic Category" Please select [Experience Sharing] The title should be: [Creative name] + shared content Example: [Low-cost smart cat's eye based on RGB-D face detection and environmental monitoring] Material unpacking—STM32F750   Details Published on 2022-8-3 21:37
 
 

6773

Posts

2

Resources
2
 

This tutorial is quite detailed. How much RAM does the ESP32-S2 have? Can it fit a whole screen's worth of video memory?

This post is from DigiKey Technology Zone

Comments

I haven't checked the information, but I think it is enough. There are many ESP32 lvgl cases on the Internet.  Details Published on 2022-8-2 08:29
 
 
 

6841

Posts

11

Resources
3
 
The details are explained in detail, and the host has done a great job in this regard. Thanks for sharing!
This post is from DigiKey Technology Zone

Comments

Thank you for replying to each one.  Details Published on 2022-8-2 08:30
 
 
 

155

Posts

1

Resources
4
 
wangerxian posted on 2022-8-1 15:58 This tutorial is quite detailed. How much RAM does ESP32-S2 have? Can it fit the video memory of a screen?

I haven't checked the information, but I think it is enough. There are many ESP32 lvgl cases on the Internet.

This post is from DigiKey Technology Zone

Comments

Hmm, I haven’t actually experienced LVGL yet!  Details Published on 2022-8-2 09:09
 
 
 

155

Posts

1

Resources
5
 
lugl4313820 posted on 2022-8-1 17:40 Various details are explained in detail, the host did a very good job in this regard. Thanks for sharing!

Thank you for replying to each one.

This post is from DigiKey Technology Zone
 
 
 

6773

Posts

2

Resources
6
 
sonicfirr posted on 2022-8-2 08:29 I haven't checked the information, but it is probably enough. There are many ESP32 lvgl cases on the Internet.

Hmm, I haven’t actually experienced LVGL yet!

This post is from DigiKey Technology Zone
 
 
 

6060

Posts

6

Resources
7
 

Sir, please pay attention to the posting rules

"Post Topic Category" Please select [Experience Sharing]

The title should be: [Creative name] + shared content

Example: [Low-cost smart cat's eye based on RGB-D face detection and environmental monitoring] Material unpacking—STM32F750

This post is from DigiKey Technology Zone

Comments

Okay, pay attention next time.  Details Published on 2022-8-4 08:00
Personal signature

在爱好的道路上不断前进,在生活的迷雾中播撒光引

 
 
 

155

Posts

1

Resources
8
 
Qintianqintian0303 posted on 2022-8-3 21:37 Boss, please pay attention to the posting rules "Post Topic Category" Please select [Experience Sharing] The title should be: [Creative Name] + Sharing Content...

Okay, pay attention next time.

This post is from DigiKey Technology Zone
 
 
 

Guess Your Favourite
Find a datasheet?

EEWorld Datasheet Technical Support

Related articles more>>
Copyright © 2005-2024 EEWORLD.com.cn, Inc. All rights reserved 京B2-20211791 京ICP备10001474号-1 电信业务审批[2006]字第258号函 京公网安备 11010802033920号
快速回复 返回顶部 Return list