esphome / issues

Issue Tracker for ESPHome
https://esphome.io/
293 stars 36 forks source link

ESP32-C3 - unsupported ISA substring '_zicsr_zifencei' #4949

Open wardy277 opened 1 year ago

wardy277 commented 1 year ago

The problem

With no changes, except using a newer version of esphome (docker-compose pull) the build now fails

I am using an ESP C3 (Wemos C3 mini) Rev 1, so have wifi output_power set to "8.5" for wifi to function.

Error since updating esphome:

  It fails with the following output:

    Change Dir: /config/.esphome/build/kitchen-under-cabinet/.pioenvs/kitchen-under-cabinet/CMakeFiles/CMakeTmp

    Run Build Command(s):/config/.esphome/platformio/packages/tool-ninja/ninja cmTC_c0f53 && [1/2] Building C object CMakeFiles/cmTC_c0f53.dir/testCCompiler.c.obj
    FAILED: CMakeFiles/cmTC_c0f53.dir/testCCompiler.c.obj 
    /config/.esphome/platformio/packages/toolchain-riscv32-esp/bin/riscv32-esp-elf-gcc   -march=rv32imc_zicsr_zifencei -o CMakeFiles/cmTC_c0f53.dir/testCCompiler.c.obj   -c testCCompiler.c
    cc1: error: -march=rv32imc_zicsr_zifencei: unsupported ISA substring '_zicsr_zifencei'
    ninja: build stopped: subcommand failed.

Which version of ESPHome has the issue?

2023.9.3

What type of installation are you using?

Docker

Which version of Home Assistant has the issue?

2023.9.3

What platform are you using?

ESP32

Board

Wemos C3 mini

Component causing the issue

build

Example YAML snippet

esphome:
  name: kitchen-under-cabinet
  platformio_options:
    board_build.flash_mode: dio
  on_boot:
    priority: -100.0
    then:
      - light.turn_on:
          id: kitchen_light

esp32:
  board: esp32-c3-devkitm-1
  variant: esp32c3
  framework:
    type: esp-idf
    version: latest

# Enable logging
logger:

# Enable Home Assistant API
api:

ota:
  password: !secret ota_password

wifi:
  ssid: !secret wifi_ssid
  password: !secret wifi_password
  output_power: "8.5"

  # Enable fallback hotspot (captive portal) in case wifi connection fails
  ap:
    ssid: "Kitchen-Under-Cabinet"
    password: "uXC30YN9xIFI"

binary_sensor:
  - platform: gpio
    pin: 5
    name: "Kitchen Motion"
    device_class: motion
    id: kitchen_motion
    filters:
      - delayed_off: 300s #300s # Sensor goes to OFF state when this time has passed after last true ON

  - platform: template
    id: Kitchen_motion_delayed_disabled
    lambda: |-
      return id(kitchen_motion).state;

switch:
  - platform: gpio
    pin: 4
    id: kitchen_light_disabled

output:
  - platform: ledc
    id: kitchen_light_output
    pin: 3

light:
  - platform: monochromatic
    output: kitchen_light_output
    id: kitchen_light
    name: "Kitchen Cabinet Lights"

Anything in the logs that might be useful for us?

INFO ESPHome 2023.9.3
INFO Reading configuration /config/kitchen-under-cabinet.yaml...
WARNING The selected ESP-IDF framework version is not the recommended one. If there are connectivity or build issues please remove the manual version.
WARNING The selected ESP-IDF framework version is not the recommended one. If there are connectivity or build issues please remove the manual version.
INFO Generating C++ source...
INFO Updating https://github.com/espressif/esp-protocols.git@mdns-v1.2.0
INFO Compiling app...
Processing kitchen-under-cabinet (board: esp32-c3-devkitm-1; framework: espidf; platform: platformio/espressif32@5.4.0)
--------------------------------------------------------------------------------
HARDWARE: ESP32C3 160MHz, 320KB RAM, 4MB Flash
 - framework-espidf @ 3.50100.0 (5.1.0) 
 - tool-cmake @ 3.16.4 
 - tool-ninja @ 1.7.1 
 - toolchain-esp32ulp @ 2.35.0-20220830 
 - toolchain-riscv32-esp @ 8.4.0+2021r2-patch5
Creating a new virtual environment for IDF Python dependencies
Installing ESP-IDF's Python dependencies
Collecting urllib3<2
  Downloading urllib3-1.26.17-py2.py3-none-any.whl (143 kB)
Collecting cryptography~=41.0.1
  Downloading cryptography-41.0.4-cp37-abi3-manylinux_2_28_x86_64.whl (4.4 MB)
Collecting future>=0.18.3
  Downloading future-0.18.3.tar.gz (840 kB)
Collecting pyparsing~=3.0.9
  Downloading pyparsing-3.0.9-py3-none-any.whl (98 kB)
Collecting kconfiglib~=14.1.0
  Downloading kconfiglib-14.1.0-py2.py3-none-any.whl (145 kB)
Collecting idf-component-manager~=1.2.3
  Downloading idf_component_manager-1.2.3-py3-none-any.whl (116 kB)
Collecting cffi>=1.12
  Downloading cffi-1.16.0-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (443 kB)
Collecting colorama
  Downloading colorama-0.4.6-py2.py3-none-any.whl (25 kB)
Collecting six
  Downloading six-1.16.0-py2.py3-none-any.whl (11 kB)
Collecting requests<3
  Downloading requests-2.31.0-py3-none-any.whl (62 kB)
Collecting requests-file
  Downloading requests_file-1.5.1-py2.py3-none-any.whl (3.7 kB)
Collecting click
  Downloading click-8.1.7-py3-none-any.whl (97 kB)
Collecting tqdm<5
  Downloading tqdm-4.66.1-py3-none-any.whl (78 kB)
Collecting pyyaml>5.2
  Downloading PyYAML-6.0.1-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (738 kB)
Collecting contextlib2>0.6.0
  Downloading contextlib2-21.6.0-py2.py3-none-any.whl (13 kB)
Collecting schema
  Downloading schema-0.7.5-py2.py3-none-any.whl (17 kB)
Collecting cachecontrol[filecache]>0.12.6
  Downloading cachecontrol-0.13.1-py3-none-any.whl (22 kB)
Collecting requests-toolbelt
  Downloading requests_toolbelt-1.0.0-py2.py3-none-any.whl (54 kB)
Collecting packaging
  Downloading packaging-23.2-py3-none-any.whl (53 kB)
Collecting msgpack>=0.5.2
  Downloading msgpack-1.0.7-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (530 kB)
Collecting filelock>=3.8.0
  Downloading filelock-3.12.4-py3-none-any.whl (11 kB)
Collecting pycparser
  Downloading pycparser-2.21-py2.py3-none-any.whl (118 kB)
Collecting idna<4,>=2.5
  Downloading idna-3.4-py3-none-any.whl (61 kB)
Collecting certifi>=2017.4.17
  Downloading certifi-2023.7.22-py3-none-any.whl (158 kB)
Collecting charset-normalizer<4,>=2
  Downloading charset_normalizer-3.3.0-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (138 kB)
Using legacy 'setup.py install' for future, since package 'wheel' is not installed.
Installing collected packages: urllib3, idna, charset-normalizer, certifi, requests, msgpack, six, pycparser, filelock, contextlib2, cachecontrol, tqdm, schema, requests-toolbelt, requests-file, pyyaml, packaging, future, colorama, click, cffi, pyparsing, kconfiglib, idf-component-manager, cryptography
    Running setup.py install for future: started
    Running setup.py install for future: finished with status 'done'
Successfully installed cachecontrol-0.13.1 certifi-2023.7.22 cffi-1.16.0 charset-normalizer-3.3.0 click-8.1.7 colorama-0.4.6 contextlib2-21.6.0 cryptography-41.0.4 filelock-3.12.4 future-0.18.3 idf-component-manager-1.2.3 idna-3.4 kconfiglib-14.1.0 msgpack-1.0.7 packaging-23.2 pycparser-2.21 pyparsing-3.0.9 pyyaml-6.0.1 requests-2.31.0 requests-file-1.5.1 requests-toolbelt-1.0.0 schema-0.7.5 six-1.16.0 tqdm-4.66.1 urllib3-1.26.17
Reading CMake configuration...
-- Found Git: /usr/bin/git (found version "2.30.2") 
-- The C compiler identification is GNU 8.4.0
-- The CXX compiler identification is GNU 8.4.0
-- The ASM compiler identification is GNU
-- Found assembler: /config/.esphome/platformio/packages/toolchain-riscv32-esp/bin/riscv32-esp-elf-gcc
-- Check for working C compiler: /config/.esphome/platformio/packages/toolchain-riscv32-esp/bin/riscv32-esp-elf-gcc
-- Check for working C compiler: /config/.esphome/platformio/packages/toolchain-riscv32-esp/bin/riscv32-esp-elf-gcc -- broken
-- Configuring incomplete, errors occurred!
See also "/config/.esphome/build/kitchen-under-cabinet/.pioenvs/kitchen-under-cabinet/CMakeFiles/CMakeOutput.log".
See also "/config/.esphome/build/kitchen-under-cabinet/.pioenvs/kitchen-under-cabinet/CMakeFiles/CMakeError.log".

fatal: not a git repository (or any parent up to mount point /)
Stopping at filesystem boundary (GIT_DISCOVERY_ACROSS_FILESYSTEM not set).
CMake Error at /config/.esphome/platformio/packages/tool-cmake/share/cmake-3.16/Modules/CMakeTestCCompiler.cmake:60 (message):
  The C compiler

    "/config/.esphome/platformio/packages/toolchain-riscv32-esp/bin/riscv32-esp-elf-gcc"

  is not able to compile a simple test program.

  It fails with the following output:

    Change Dir: /config/.esphome/build/kitchen-under-cabinet/.pioenvs/kitchen-under-cabinet/CMakeFiles/CMakeTmp

    Run Build Command(s):/config/.esphome/platformio/packages/tool-ninja/ninja cmTC_c0f53 && [1/2] Building C object CMakeFiles/cmTC_c0f53.dir/testCCompiler.c.obj
    FAILED: CMakeFiles/cmTC_c0f53.dir/testCCompiler.c.obj 
    /config/.esphome/platformio/packages/toolchain-riscv32-esp/bin/riscv32-esp-elf-gcc   -march=rv32imc_zicsr_zifencei -o CMakeFiles/cmTC_c0f53.dir/testCCompiler.c.obj   -c testCCompiler.c
    cc1: error: -march=rv32imc_zicsr_zifencei: unsupported ISA substring '_zicsr_zifencei'
    ninja: build stopped: subcommand failed.

  CMake will not be able to correctly generate this project.
Call Stack (most recent call first):
  /config/.esphome/platformio/packages/framework-espidf/tools/cmake/project.cmake:365 (__project)
  CMakeLists.txt:3 (project)

========================= [FAILED] Took 10.25 seconds =========================

Additional information

No response

stintel commented 1 year ago

If you use latest IDF you will have to use a newer version of PlatformIO. Try this:

esp32:
  board: esp32-c3-devkitm-1
  platform_version: 6.4.0
  variant: esp32c3
  framework:
    type: esp-idf
    version: latest