espressif / esp-iot-solution

Espressif IoT Library. IoT Device Drivers, Documentations and Solutions.
Apache License 2.0
1.99k stars 787 forks source link

"TypeError: Version is not semantic" while building any esp-iot-solution examples (AEGHB-341) #287

Closed armwdev closed 1 year ago

armwdev commented 1 year ago

Environment

Problem Description

I am not sure if that's a bug or my mistake as I tried on multiple PCs. When I tried to build any examples (lvgl_example) from the esp-iot-solution of the master branch, lvgl (8.3) and esp-idf latest stable release (5.1), it fails to build with error: "TypeError: Version is not semantic". You can see the full logs in the "Debug Logs" at the bottom.

Expected Behavior

As there is no modifications to the files, it should build the examples normally.

Actual Behavior

It builds the esp-idf examples fine but not the esp-iot-solution examples.

Steps to repropduce

1- Downloaded the latest stable ESP-IDF, tools, lvgl and master branch of the esp-iot-solution 2- cd to any example project (lvgl_example), set the target to esp32s3, applied idf.py build 3- It starts to build but at the end it shows the error above and logs at the bottom.

Code to reproduce this issue:

From main.cpp of the lvgl_example below:

/* component includes */
#include <stdio.h>

/* freertos includes */
#include "freertos/FreeRTOS.h"
#include "freertos/task.h"
#include "freertos/timers.h"
#include "freertos/semphr.h"
#include "freertos/queue.h"
#include "freertos/event_groups.h"
#include "esp_freertos_hooks.h"
#include "iot_board.h"
#include "lvgl_gui.h"
#include "esp_log.h"

#include "lv_examples/src/lv_demo_printer/lv_demo_printer.h"
#include "lv_examples/src/lv_demo_widgets/lv_demo_widgets.h"
#include "lv_examples/src/lv_ex_get_started/lv_ex_get_started.h"
#include "lv_examples/src/lv_demo_benchmark/lv_demo_benchmark.h"
#include "lv_examples/src/lv_demo_keypad_encoder/lv_demo_keypad_encoder.h"
#include "lv_examples/src/lv_demo_stress/lv_demo_stress.h"
#include "lv_examples/src/lv_ex_style/lv_ex_style.h"

static const char *TAG = "example_lvgl";

void app_main()
{
    iot_board_init();
    spi_bus_handle_t spi2_bus = iot_board_get_handle(BOARD_SPI2_ID);

    scr_driver_t lcd_drv;
    touch_panel_driver_t touch_drv;
    scr_interface_spi_config_t spi_lcd_cfg = {
        .spi_bus = spi2_bus,
        .pin_num_cs = BOARD_LCD_SPI_CS_PIN,
        .pin_num_dc = BOARD_LCD_SPI_DC_PIN,
        .clk_freq = BOARD_LCD_SPI_CLOCK_FREQ,
        .swap_data = true,
    };

    scr_interface_driver_t *iface_drv;
    scr_interface_create(SCREEN_IFACE_SPI, &spi_lcd_cfg, &iface_drv);

    scr_controller_config_t lcd_cfg = {
        .interface_drv = iface_drv,
        .pin_num_rst = 18,
        .pin_num_bckl = 23,
        .rst_active_level = 0,
        .bckl_active_level = 1,
        .offset_hor = 0,
        .offset_ver = 0,
        .width = 240,
        .height = 320,
        .rotate = SCR_DIR_TBLR,
    };
    scr_find_driver(SCREEN_CONTROLLER_ILI9341, &lcd_drv);
    lcd_drv.init(&lcd_cfg);

    touch_panel_config_t touch_cfg = {
        .interface_spi = {
            .spi_bus = spi2_bus,
            .pin_num_cs = BOARD_TOUCH_SPI_CS_PIN,
            .clk_freq = 10000000,
        },
        .interface_type = TOUCH_PANEL_IFACE_SPI,
        .pin_num_int = -1,
        .direction = TOUCH_DIR_TBLR,
        .width = 240,
        .height = 320,
    };
    touch_panel_find_driver(TOUCH_PANEL_CONTROLLER_XPT2046, &touch_drv);
    touch_drv.init(&touch_cfg);
    touch_drv.calibration_run(&lcd_drv, false);

    /* Initialize LittlevGL GUI */
    lvgl_init(&lcd_drv, &touch_drv);

    lvgl_acquire();
#ifdef CONFIG_LV_DEMO_BENCHMARK
    lv_demo_benchmark();
#elif defined CONFIG_LV_DEMO_PRINTER
    lv_demo_printer();
#elif defined CONFIG_LV_DEMO_WIDGETS
    lv_demo_widgets();
#elif defined CONFIG_LV_EX_GET_STARTED
    lv_ex_get_started_1();
#elif defined CONFIG_LV_DEMO_STRESS
    lv_demo_stress();
#elif defined CONFIG_LV_EX_STYLE
    lv_ex_style_1();
#endif
    lvgl_release();

    ESP_LOGI(TAG, "[APP] IDF version: %s", esp_get_idf_version());
    ESP_LOGI(TAG, "[APP] Free memory: %d bytes", esp_get_free_heap_size());
}

Debug Logs:

*  Executing task: cmake -G Ninja -DPYTHON_DEPS_CHECKED=1 -DESP_PLATFORM=1 -B c:\esp\esp-iot-solution\examples\hmi\lvgl_example\build -S c:\esp\esp-iot-solution\examples\hmi\lvgl_example 

-- Found Git: C:/esp/tools/tools/idf-git/2.34.2/cmd/git.exe (found version "2.34.1.windows.1") 
-- Component directory C:/esp/esp-iot-solution/components/display/digital_tube does not contain a CMakeLists.txt file. No component will be added
-- Component directory C:/esp/esp-iot-solution/components/display/lcd does not contain a CMakeLists.txt file. No component will be added
-- Component directory C:/esp/esp-iot-solution/components/sensors/gesture does not contain a CMakeLists.txt file. No component will be added
-- Component directory C:/esp/esp-iot-solution/components/sensors/humiture does not contain a CMakeLists.txt file. No component will be added    
-- Component directory C:/esp/esp-iot-solution/components/sensors/imu does not contain a CMakeLists.txt file. No component will be added
-- Component directory C:/esp/esp-iot-solution/components/sensors/light_sensor does not contain a CMakeLists.txt file. No component will be added
-- Component directory C:/esp/esp-iot-solution/components/sensors/pressure does not contain a CMakeLists.txt file. No component will be added    
-- Component directory C:/esp/esp-iot-solution/components/storage/eeprom does not contain a CMakeLists.txt file. No component will be added
-- The C compiler identification is GNU 12.2.0
-- The CXX compiler identification is GNU 12.2.0
-- The ASM compiler identification is GNU
-- Found assembler: C:/esp/idf-v5.1/tools-v5.1/tools/xtensa-esp32s3-elf/esp-12.2.0_20230208/xtensa-esp32s3-elf/bin/xtensa-esp32s3-elf-gcc.exe
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: C:/esp/idf-v5.1/tools-v5.1/tools/xtensa-esp32s3-elf/esp-12.2.0_20230208/xtensa-esp32s3-elf/bin/xtensa-esp32s3-elf-gcc.exe - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: C:/esp/idf-v5.1/tools-v5.1/tools/xtensa-esp32s3-elf/esp-12.2.0_20230208/xtensa-esp32s3-elf/bin/xtensa-esp32s3-elf-g++.exe - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Building ESP-IDF components for target esp32s3
CMake Error at C:/esp/idf-v5.1/esp-idf/tools/cmake/build.cmake:540 (message):
  Traceback (most recent call last):

    File "<frozen runpy>", line 198, in _run_module_as_main
    File "<frozen runpy>", line 88, in _run_code
    File "c:\esp\idf-v5.1\tools-v5.1\python_env\idf5.1_py3.11_env\Lib\site-packages\idf_component_manager\prepare_components\__main__.py", line 6, in <module>
      main()
    File "c:\esp\idf-v5.1\tools-v5.1\python_env\idf5.1_py3.11_env\Lib\site-packages\idf_component_manager\prepare_components\prepare.py", line 124, in main
      args.func(args)
    File "c:\esp\idf-v5.1\tools-v5.1\python_env\idf5.1_py3.11_env\Lib\site-packages\idf_component_manager\prepare_components\prepare.py", line 31, in prepare_dep_dirs
      ).prepare_dep_dirs(
        ^^^^^^^^^^^^^^^^^
    File "c:\esp\idf-v5.1\tools-v5.1\python_env\idf5.1_py3.11_env\Lib\site-packages\idf_component_manager\core.py", line 67, in wrapper
      return func(self, *args, **kwargs)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^
    File "c:\esp\idf-v5.1\tools-v5.1\python_env\idf5.1_py3.11_env\Lib\site-packages\idf_component_manager\core.py", line 529, in prepare_dep_dirs
      downloaded_component_paths, downloaded_component_version_dict = download_project_dependencies(
                                                                      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    File "c:\esp\idf-v5.1\tools-v5.1\python_env\idf5.1_py3.11_env\Lib\site-packages\idf_component_manager\dependencies.py", line 146, in download_project_dependencies
      if is_solve_required(project_requirements, solution):
         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    File "c:\esp\idf-v5.1\tools-v5.1\python_env\idf5.1_py3.11_env\Lib\site-packages\idf_component_manager\dependencies.py", line 99, in is_solve_required
      component.name, spec='=={}'.format(component.version.semver))
                                         ^^^^^^^^^^^^^^^^^^^^^^^^
    File "c:\esp\idf-v5.1\tools-v5.1\python_env\idf5.1_py3.11_env\Lib\site-packages\idf_component_tools\manifest\manifest.py", line 275, in semver
      raise TypeError('Version is not semantic')

  TypeError: Version is not semantic

Call Stack (most recent call first):
  C:/esp/idf-v5.1/esp-idf/tools/cmake/project.cmake:464 (idf_build_process)
  CMakeLists.txt:16 (project)

-- Configuring incomplete, errors occurred!
See also "C:/esp/esp-iot-solution/examples/hmi/lvgl_example/build/CMakeFiles/CMakeOutput.log".

 *  The terminal process "C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe -Command cmake -G Ninja -DPYTHON_DEPS_CHECKED=1 -DESP_PLATFORM=1 -B c:\esp\esp-iot-solution\examples\hmi\lvgl_example\build -S c:\esp\esp-iot-solution\examples\hmi\lvgl_example" terminated with exit code: 1. 
leeebo commented 1 year ago

@armwdev Hi the examples under examples/hmi were temporarily disabled. As we have removed all submodules from the repo, we will merge a new version code (based on esp component manager) and guide docs about HMI soon.

Currently please refer the examples in esp-dev-kits/tree/master/esp32-s3-lcd-ev-board/examples

armwdev commented 1 year ago

@leeebo Hi and thanks for the quick response. I was mainly interested in the lvgl_wificonfig example to set the wifi credentials using the lvgl as this seems a bit complicated task. Is there any way so I can make modifications to make the lvgl_wificonfig example to work with the idf 5.1?

As a workaround, I've used the previous commit and fixed the board_common. But now I receive error "E (372) ADC: CONFLICT! driver_ng is not allowed to be used with the legacy driver"

I've tried to disable the i2s_lcd as much as I can from the code and the menuconfig but not sure why the error still occurs.

Logs for the error:

I (364) spi_flash: detected chip: gd
I (368) spi_flash: flash io: qio
E (372) ADC: CONFLICT! driver_ng is not allowed to be used with the legacy driver

abort() was called at PC 0x420358a3 on core 0
0x420358a3: check_adc_oneshot_driver_conflict at C:/esp/idf-v5.1/esp-idf/components/driver/deprecated/adc_legacy.c:930 (discriminator 3)

Backtrace: 0x40375b8a:0x3fceb1b0 0x4037eb9d:0x3fceb1d0 0x4038613e:0x3fceb1f0 0x420358a3:0x3fceb260 0x42003753:0x3fceb280 0x42003a8d:0x3fceb2a0 0x403759d6:0x3fceb2e0 0x403cda98:0x3fceb340 0x403cde91:0x3fceb380 0x403c999d:0x3fceb4b0 0x40045c01:0x3fceb570 |<-CORRUPTED
0x40375b8a: panic_abort at C:/esp/idf-v5.1/esp-idf/components/esp_system/panic.c:452

0x4037eb9d: esp_system_abort at C:/esp/idf-v5.1/esp-idf/components/esp_system/port/esp_system_chip.c:84

0x4038613e: abort at C:/esp/idf-v5.1/esp-idf/components/newlib/abort.c:38

0x420358a3: check_adc_oneshot_driver_conflict at C:/esp/idf-v5.1/esp-idf/components/driver/deprecated/adc_legacy.c:930 (discriminator 3)

0x42003753: do_global_ctors at C:/esp/idf-v5.1/esp-idf/components/esp_system/startup.c:200 (discriminator 15)

0x42003a8d: start_cpu0_default at C:/esp/idf-v5.1/esp-idf/components/esp_system/startup.c:463 (discriminator 3)

0x403759d6: call_start_cpu0 at C:/esp/idf-v5.1/esp-idf/components/esp_system/port/cpu_start.c:691

0x40045c01: ets_run_flash_bootloader in ROM

ELF file SHA256: eaba7a1a09934189

Rebooting...

Please let me know if there is a better way or how do I fix this error.

Thanks

leeebo commented 1 year ago

@armwdev For wifi credentials using LVGL, there is an example 86box_smart_panel, we suggest developing based it

armwdev commented 1 year ago

Thanks for your suggestion. That example seems a bit resource intensive and incompatible with the development kit that I have. I need a compact and simpler example so I hope you can fix the hmi examples soon.