Failed to run confgey.py for ESP32 with kconfig type hex

Sysprogs forums Forums VisualGDB Failed to run confgey.py for ESP32 with kconfig type hex

Viewing 10 posts - 1 through 10 (of 10 total)
  • Author
    Posts
  • #23201
    doingnz
    Participant

    Hi,

    I am trying to create a VisualGDB project that builds the TFT Library found here: https://github.com/loboris/ESP32_TFT_library

    I have resolved all but one issue. If I add the following definition for SPIFFS_BASE_ADDR to Kconfig.projbuild as per the original github repository, then I get an error “Failed to run confgen.py”

    config SPIFFS_BASE_ADDR
    hex “SPIFFS Base address”
    range 100000 1FFE000
    default 180000
    help
    Starting address of the SPIFFS area in ESP32 Flash

    It fails to parse the 1FFE000 as hex.

    Output is as follows:

    Traceback (most recent call last):
    File “C:/SysGCC/esp32/esp-idf/v3.1/tools/kconfig_new/confgen.py”, line 292, in <module>
    main()
    File “C:/SysGCC/esp32/esp-idf/v3.1/tools/kconfig_new/confgen.py”, line 106, in main
    output_function(config, temp_file)
    File “C:/SysGCC/esp32/esp-idf/v3.1/tools/kconfig_new/confgen.py”, line 258, in write_json_menus
    config.walk_menu(write_node)
    File “C:/SysGCC/esp32/esp-idf/v3.1/tools/kconfig_new/kconfiglib.py”, line 966, in walk_menu
    callback(node)
    File “C:/SysGCC/esp32/esp-idf/v3.1/tools/kconfig_new/confgen.py”, line 232, in write_node
    greatest_range = [int(min_range.str_value), int(max_range.str_value)]
    ValueError: invalid literal for int() with base 10: ‘1FFE000’

    The projects builds if I change the above to int and convert hex to decimal as follows.

    config SPIFFS_BASE_ADDR
    int “SPIFFS Base address”
    range 1048576 33546240
    default 1572864
    help
    Starting address of the SPIFFS area in ESP32 Flash

    Is VisualGDB missing support for “hex” parameters or something I have done incorrectly?

    Thanks for the help.

    • This topic was modified 5 years, 4 months ago by doingnz. Reason: removed Kconfig.projbuild attachement as it is not permitted
    #23209
    support
    Keymaster

    Hi,

    Thanks for the email address update. We have linked the new email address to your forum profile.

    Regarding the problem, is looks like you are missing the “0x” prefix (e.g. see how PARTITION_TABLE_OFFSET is defined in esp-idf\v3.1\components\partition_table\Kconfig.projbuild).

    #23210
    doingnz
    Participant

    The project is now running on the ESP32-WROVER-KIT v4.1 with the workaround of using the int and decimal values in place of the HEX.

    There are a couple of other small edits from the original library. Demo not perfect, but runs blinky + tft_demo as tasks.

    Attached Zip of project if anyone wants to play further.

    #23211
    doingnz
    Participant

    Try that attachment again after deleting the folders ‘mkspiffs’ and ‘spiffs_image’. The original folders available from github repo as no changes relevant to running on ESP32

    Attachments:
    You must be logged in to view attached files.
    #23214
    doingnz
    Participant

    I tried adding the 0x prefix earlier. Still fails, but with a different error. i.e. with

    config SPIFFS_BASE_ADDR
    hex “SPIFFS Base address”
    range 0x100000 0x1FFE000
    default 0x180000
    help
    Starting address of the SPIFFS area in ESP32 Flash

    error is

    Traceback (most recent call last):
    File "C:/SysGCC/esp32/esp-idf/v3.1/tools/kconfig_new/confgen.py", line 292, in <module>
    main()
    File "C:/SysGCC/esp32/esp-idf/v3.1/tools/kconfig_new/confgen.py", line 106, in main
    output_function(config, temp_file)
    File "C:/SysGCC/esp32/esp-idf/v3.1/tools/kconfig_new/confgen.py", line 258, in write_json_menus
    config.walk_menu(write_node)
    File "C:/SysGCC/esp32/esp-idf/v3.1/tools/kconfig_new/kconfiglib.py", line 966, in walk_menu
    callback(node)
    File "C:/SysGCC/esp32/esp-idf/v3.1/tools/kconfig_new/confgen.py", line 232, in write_node
    greatest_range = [int(min_range.str_value), int(max_range.str_value)]
    ValueError: invalid literal for int() with base 10: '0x100000'

     

    #23215
    doingnz
    Participant

    The problem appears to be with “range”.

    i.e. this is OK

    config SPIFFS_BASE_ADDR
    hex “SPIFFS Base address”
    default 0x180000
    help
    Starting address of the SPIFFS area in ESP32 Flash

    but this is not

    config SPIFFS_BASE_ADDR
    hex “SPIFFS Base address”
    range 0x100000 0x1FFE000
    default 0x180000
    help
    Starting address of the SPIFFS area in ESP32 Flash

     

    #23216
    doingnz
    Participant

    if I specify:

    config SPIFFS_BASE_ADDR
    hex “SPIFFS Base address”
    default 0x180000
    range 1048576 33546240
    help
    Starting address of the SPIFFS area in ESP32 Flash

    It will build, and VisualGDB UI for PROJECT PROPERTIES will require value to be entered as hex prefixed with ‘0x’, but it will ignore the range check. i.e. I can enter 0x100 and it will be saved as the config value.

    Obviously not an urgent fix as I can build and run the project. 🙂

    #23217
    support
    Keymaster

    Hi,

    Thanks for the very detailed description. We have rechecked this and it indeed looks like the logic for handling the ranges for hex entries still expects decimal values.

    This is logic, however, is a part of the ESP-IDF itself and is unfortunately outside of VisualGDB’s control. Please consider submitting a bugreport in the ESP-IDF bugtracker for this.

    The range checking is indeed not yet supported by VisualGDB, sorry. We will try to add it in one of the next releases, although we have a few other features queued (e.g. ESP32 unit test integration) ahead of that.

    #23227
    doingnz
    Participant

    Before i create an issue in ESP-IDF bugtracker, thoughts why the following works under msys32 build without ‘0x’ prefix, but in VisualGDB environment requires ‘0x’ prefix for default and range cannot be hex?

    config SPIFFS_BASE_ADDR
    hex "SPIFFS Base address"
    range 100000 1FFE000
    default 180000
    help
    Starting address of the SPIFFS area in ESP32 Flash
    #23228
    support
    Keymaster

    Hi,

    Strange. We tried the example above and ESP-IDF failed to parse it (100000 and 180000 are valid decimal values as well, but 1FFE000 caused it to crash). If it doesn’t fail in your msys32 environment, please double-check that you are using the same versions of ESP-IDF (perhaps it has already been fixed in the master branch of ESP-IDF).

Viewing 10 posts - 1 through 10 (of 10 total)
  • You must be logged in to reply to this topic.