esp-rs / esp-idf-template

A "Hello, world!" template of a Rust binary crate for the ESP-IDF framework.
Apache License 2.0
436 stars 52 forks source link

Command Error: Unknown Configuration Options and ParseException on ESP32 Platform #134

Closed oleander closed 1 year ago

oleander commented 1 year ago

Bug description

When running pio run -v, I get the following error:

Warning! Ignore unknown configuration option `rust_lib` in section [env]
Warning! Ignore unknown configuration option `rust_target` in section [env]
Processing debug (build_type: debug; extra_scripts: pre:platformio.git.py, pre:platformio.patch.py, platformio.cargo.py; board: esp32dev; platform: espressif32; framework: espidf; rust_lib: led; rust_target: xtensa-esp32-espidf)
---------------------------------------------------------------------------------------------------------------------------------------------------------------
CONFIGURATION: https://docs.platformio.org/page/boards/espressif32/esp32dev.html
PLATFORM: Espressif 32 (6.1.0) > Espressif ESP32 Dev Module
HARDWARE: ESP32 240MHz, 320KB RAM, 4MB Flash
DEBUG: Current (cmsis-dap) External (cmsis-dap, esp-bridge, esp-prog, iot-bus-jtag, jlink, minimodule, olimex-arm-usb-ocd, olimex-arm-usb-ocd-h, olimex-arm-usb-tiny-h, olimex-jtag-tiny, tumpa)
PACKAGES:
 - framework-espidf @ 3.50001.0 (5.0.1)
 - tool-cmake @ 3.16.4
 - tool-esptoolpy @ 1.40500.0 (4.5.0)
 - tool-ninja @ 1.9.0
 - toolchain-esp32ulp @ 1.23500.220830 (2.35.0)
 - toolchain-xtensa-esp32 @ 11.2.0+2022r1
Reading CMake configuration...
LDF: Library Dependency Finder -> https://bit.ly/configure-pio-ldf
LDF Modes: Finder ~ chain, Compatibility ~ soft
Found 0 compatible libraries
Scanning dependencies...
No dependencies
Building in debug mode
"/Users/linus/.platformio/penv/.espidf-5.0.1/bin/python" "/Users/linus/.platformio/packages/framework-espidf/tools/ldgen/ldgen.py" --input /Users/linus/.platformio/packages/framework-espidf/components/esp_system/ld/esp32/sections.ld.in --config "/Users/linus/Code/esp-idf-template/blink/led/sdkconfig.debug" --fragments "/Users/linus/.platformio/packages/framework-espidf/components/app_trace/linker.lf" "/Users/linus/.platformio/packages/framework-espidf/components/bt/linker.lf" "/Users/linus/.platformio/packages/framework-espidf/components/driver/linker.lf" "/Users/linus/.platformio/packages/framework-espidf/components/esp_adc/linker.lf" "/Users/linus/.platformio/packages/framework-espidf/components/esp_event/linker.lf" "/Users/linus/.platformio/packages/framework-espidf/components/esp_gdbstub/linker.lf" "/Users/linus/.platformio/packages/framework-espidf/components/esp_hw_support/linker.lf" "/Users/linus/.platformio/packages/framework-espidf/components/esp_lcd/linker.lf" "/Users/linus/.platformio/packages/framework-espidf/components/esp_netif/linker.lf" "/Users/linus/.platformio/packages/framework-espidf/components/esp_phy/linker.lf" "/Users/linus/.platformio/packages/framework-espidf/components/esp_pm/linker.lf" "/Users/linus/.platformio/packages/framework-espidf/components/esp_psram/linker.lf" "/Users/linus/.platformio/packages/framework-espidf/components/esp_ringbuf/linker.lf" "/Users/linus/.platformio/packages/framework-espidf/components/esp_rom/linker.lf" "/Users/linus/.platformio/packages/framework-espidf/components/esp_system/linker.lf" "/Users/linus/.platformio/packages/framework-espidf/components/esp_wifi/linker.lf" "/Users/linus/.platformio/packages/framework-espidf/components/espcoredump/linker.lf" "/Users/linus/.platformio/packages/framework-espidf/components/freertos/linker.lf" "/Users/linus/.platformio/packages/framework-espidf/components/hal/linker.lf" "/Users/linus/.platformio/packages/framework-espidf/components/heap/linker.lf" "/Users/linus/.platformio/packages/framework-espidf/components/log/linker.lf" "/Users/linus/.platformio/packages/framework-espidf/components/lwip/linker.lf" "/Users/linus/.platformio/packages/framework-espidf/components/soc/linker.lf" "/Users/linus/.platformio/packages/framework-espidf/components/spi_flash/linker.lf" "/Users/linus/.platformio/packages/framework-espidf/components/xtensa/linker.lf" "/Users/linus/.platformio/packages/framework-espidf/components/esp_system/app.lf" "/Users/linus/.platformio/packages/framework-espidf/components/esp_common/common.lf" "/Users/linus/.platformio/packages/framework-espidf/components/esp_common/soc.lf" "/Users/linus/.platformio/packages/framework-espidf/components/newlib/system_libs.lf" "/Users/linus/.platformio/packages/framework-espidf/components/newlib/newlib.lf" --output .pio/build/debug/sections.ld --kconfig "/Users/linus/.platformio/packages/framework-espidf/Kconfig" --env-file "/Users/linus/Code/esp-idf-template/blink/led/.pio/build/debug/config.env" --libraries-file "/Users/linus/Code/esp-idf-template/blink/led/.pio/build/debug/ldgen_libraries_pio" --objdump "/Users/linus/.platformio/packages/toolchain-xtensa-esp32/bin/xtensa-esp32-elf-objdump"
Traceback (most recent call last):
  File "/Users/linus/.platformio/packages/framework-espidf/tools/ldgen/ldgen/entity.py", line 152, in _get_infos_from_file
    results = parser.parseString(info.content, parseAll=True)
              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/linus/.platformio/penv/.espidf-5.0.1/lib/python3.11/site-packages/pyparsing/util.py", line 256, in _inner
    return fn(self, *args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/linus/.platformio/penv/.espidf-5.0.1/lib/python3.11/site-packages/pyparsing/core.py", line 1190, in parse_string
    raise exc.with_traceback(None)
pyparsing.exceptions.ParseException: Expected end of text, found 'default'  (at char 1), (line:2, col:1)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/Users/linus/.platformio/packages/framework-espidf/tools/ldgen/ldgen.py", line 183, in <module>
    main()
  File "/Users/linus/.platformio/packages/framework-espidf/tools/ldgen/ldgen.py", line 159, in main
    mapping_rules = generation_model.generate(sections_infos)
                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/linus/.platformio/packages/framework-espidf/tools/ldgen/ldgen/generation.py", line 514, in generate
    root_node.insert(entity, sections, target, flags, entities)
  File "/Users/linus/.platformio/packages/framework-espidf/tools/ldgen/ldgen/generation.py", line 241, in insert
    self.child_placement(entity, sections, target, flags, sections_db)
  File "/Users/linus/.platformio/packages/framework-espidf/tools/ldgen/ldgen/generation.py", line 233, in child_placement
    child.insert(entity, sections, target, flags, sections_db)
  File "/Users/linus/.platformio/packages/framework-espidf/tools/ldgen/ldgen/generation.py", line 241, in insert
    self.child_placement(entity, sections, target, flags, sections_db)
  File "/Users/linus/.platformio/packages/framework-espidf/tools/ldgen/ldgen/generation.py", line 233, in child_placement
    child.insert(entity, sections, target, flags, sections_db)
  File "/Users/linus/.platformio/packages/framework-espidf/tools/ldgen/ldgen/generation.py", line 241, in insert
    self.child_placement(entity, sections, target, flags, sections_db)
  File "/Users/linus/.platformio/packages/framework-espidf/tools/ldgen/ldgen/generation.py", line 296, in child_placement
    found_sections = sections_db.get_sections(self.parent.name, self.name)
                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/linus/.platformio/packages/framework-espidf/tools/ldgen/ldgen/entity.py", line 197, in get_sections
    obj = self._match_obj(archive, obj)
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/linus/.platformio/packages/framework-espidf/tools/ldgen/ldgen/entity.py", line 183, in _match_obj
    objs = self.get_objects(archive)
           ^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/linus/.platformio/packages/framework-espidf/tools/ldgen/ldgen/entity.py", line 176, in get_objects
    self._process_archive(archive)
  File "/Users/linus/.platformio/packages/framework-espidf/tools/ldgen/ldgen/entity.py", line 164, in _process_archive
    parsed = self._get_infos_from_file(stored)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/linus/.platformio/packages/framework-espidf/tools/ldgen/ldgen/entity.py", line 154, in _get_infos_from_file
    raise ParseException('Unable to parse section info file ' + info.filename + '. ' + p.msg)
pyparsing.exceptions.ParseException: Unable to parse section info file /Users/linus/Code/esp-idf-template/blink/led/.pio/build/debug/esp-idf/esp_event/libesp_event.a. Expected end of text  (at char 0), (line:1, col:1)
*** [.pio/build/debug/sections.ld] Error 1
================================================================= [FAILED] Took 4.22 seconds =================================================================

Environment    Status    Duration
-------------  --------  ------------
debug          FAILED    00:00:04.223
release        IGNORED

To Reproduce

Steps to reproduce the behavior:

  1. Follow the guide lines in README.md
  2. cargo binstall espup
  3. Follow the steps in README-pio.md
  4. cargo pio new led --platform espressif32 --frameworks espidf --board esp32dev
  5. It fails on the step pio run

Environment

ivmarkov commented 1 year ago

@oleander All of the errors I see in your trace are in fact within PlatformIO itself. The version (6.1.8rc2) sounds like something which is not released as well.

Can you try with the latest officially released version of PlatformIO and reply here if pio run completes successfully (or else, what is the output)? Thanks in advance!

oleander commented 1 year ago

Thanks for your response.

I tried a stable version of PlatformIO as well, but same problem. The problem did however go away the other day. Not sure what I did. So everything is good now.