Closed Gloomyeye closed 1 year ago
platformio gets the wrong toolchain for 32-bit systems with a 64-bit kernel.
What can I add to the configuration to fix the compiling? Is there a workaround?
I don't think there's a workaround. Why are you running a 32-bit system?
I haven’t had the time to do a clean install with the 64 but version. Anyway, you think that the issue will not occur if I upgrade the raspi OS to 64 but version?
No one has reported an issue with that.
I changed my raspi os from 32bit to 64bit with the help of this tutorial: https://www.tutonaut.de/raspberry-pi-von-32-auf-64-bit-umstellen/ After that I removed all my docker images/containers completly from the raspberry pi and reloaded them again. Unfortunately, the compiling issue still exists:
INFO Reading configuration /config/esp32-c3-deltasol.yaml...
INFO Generating C++ source...
INFO Compiling app...
Processing esp32-c3-deltasol (board: esp32-c3-devkitm-1; framework: arduino; platform: platformio/espressif32 @ 5.2.0)
--------------------------------------------------------------------------------
Library Manager: Installing esphome/AsyncTCP-esphome @ 1.2.2
INFO Installing esphome/AsyncTCP-esphome @ 1.2.2
Unpacking [####################################] 100%
Library Manager: AsyncTCP-esphome@1.2.2 has been installed!
INFO AsyncTCP-esphome@1.2.2 has been installed!
Library Manager: Installing esphome/ESPAsyncWebServer-esphome @ 2.1.0
INFO Installing esphome/ESPAsyncWebServer-esphome @ 2.1.0
Unpacking [####################################] 100%
Library Manager: ESPAsyncWebServer-esphome@2.1.0 has been installed!
INFO ESPAsyncWebServer-esphome@2.1.0 has been installed!
Library Manager: Resolving dependencies...
INFO Resolving dependencies...
Library Manager: Installing esphome/noise-c @ 0.1.4
INFO Installing esphome/noise-c @ 0.1.4
Unpacking [####################################] 100%
Library Manager: noise-c@0.1.4 has been installed!
INFO noise-c@0.1.4 has been installed!
Library Manager: Resolving dependencies...
INFO Resolving dependencies...
Library Manager: Installing esphome/libsodium @ 1.10018.1
INFO Installing esphome/libsodium @ 1.10018.1
Unpacking [####################################] 100%
Library Manager: libsodium@1.10018.1 has been installed!
INFO libsodium@1.10018.1 has been installed!
HARDWARE: ESP32C3 160MHz, 320KB RAM, 4MB Flash
- toolchain-riscv32-esp @ 8.4.0+2021r2-patch3
LDF: Library Dependency Finder -> https://bit.ly/configure-pio-ldf
Dependency Graph
|-- AsyncTCP-esphome @ 1.2.2
|-- WiFi @ 2.0.0
|-- FS @ 2.0.0
|-- Update @ 2.0.0
|-- ESPAsyncWebServer-esphome @ 2.1.0
| |-- AsyncTCP-esphome @ 1.2.2
|-- DNSServer @ 2.0.0
|-- ESPmDNS @ 2.0.0
|-- noise-c @ 0.1.4
| |-- libsodium @ 1.10018.1
Compiling .pioenvs/esp32-c3-deltasol/src/esphome/components/api/api_connection.cpp.o
sh: 1: riscv32-esp-elf-g++: not found
Compiling .pioenvs/esp32-c3-deltasol/src/esphome/components/api/api_frame_helper.cpp.o
sh: 1: riscv32-esp-elf-g++: not found
Compiling .pioenvs/esp32-c3-deltasol/src/esphome/components/api/api_pb2.cpp.o
sh: 1: riscv32-esp-elf-g++: not found
*** [.pioenvs/esp32-c3-deltasol/src/esphome/components/api/api_connection.cpp.o] Error 127
Compiling .pioenvs/esp32-c3-deltasol/src/esphome/components/api/api_pb2_service.cpp.o
*** [.pioenvs/esp32-c3-deltasol/src/esphome/components/api/api_frame_helper.cpp.o] Error 127
*** [.pioenvs/esp32-c3-deltasol/src/esphome/components/api/api_pb2.cpp.o] Error 127
sh: 1: riscv32-esp-elf-g++: not found
*** [.pioenvs/esp32-c3-deltasol/src/esphome/components/api/api_pb2_service.cpp.o] Error 127
========================== [FAILED] Took 6.31 seconds ==========================
I startet another test with another esp32 framework. However, another issue occurs.
This ist the config:
#https://esphome.io/components/esp32.html
esp32:
board: esp32-c3-devkitm-1
framework:
type: esp-idf
version: latest
# Custom sdkconfig options
sdkconfig_options:
CONFIG_COMPILER_OPTIMIZATION_SIZE: y
# Advanced tweaking options
advanced:
ignore_efuse_mac_crc: false
This is the log:
INFO Reading configuration /config/esp32-c3-deltasol-sc.yaml...
INFO Generating C++ source...
INFO Compiling app...
Processing esp32-c3-deltasol-sc (board: esp32-c3-devkitm-1; framework: espidf; platform: platformio/espressif32 @ 5.2.0)
--------------------------------------------------------------------------------
HARDWARE: ESP32C3 160MHz, 320KB RAM, 4MB Flash
- framework-espidf @ 3.40402.0 (4.4.2)
- tool-cmake @ 3.16.9
- tool-ninja @ 1.10.2
- toolchain-esp32ulp @ 2.35.0-20220830
- toolchain-riscv32-esp @ 8.4.0+2021r2-patch3
Reading CMake configuration...
-- The C compiler identification is unknown
-- The CXX compiler identification is unknown
-- The ASM compiler identification is unknown
-- Found assembler: /config/.esphome/platformio/packages/toolchain-riscv32-esp@8.4.0+2021r2-patch3/bin/riscv32-esp-elf-gcc
-- Check for working C compiler: /config/.esphome/platformio/packages/toolchain-riscv32-esp@8.4.0+2021r2-patch3/bin/riscv32-esp-elf-gcc
-- Check for working C compiler: /config/.esphome/platformio/packages/toolchain-riscv32-esp@8.4.0+2021r2-patch3/bin/riscv32-esp-elf-gcc -- broken
-- Configuring incomplete, errors occurred!
See also "/config/.esphome/build/esp32-c3-deltasol-sc/.pioenvs/esp32-c3-deltasol-sc/CMakeFiles/CMakeOutput.log".
See also "/config/.esphome/build/esp32-c3-deltasol-sc/.pioenvs/esp32-c3-deltasol-sc/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@8.4.0+2021r2-patch3/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/esp32-c3-deltasol-sc/.pioenvs/esp32-c3-deltasol-sc/CMakeFiles/CMakeTmp
Run Build Command(s):/config/.esphome/platformio/packages/tool-ninja/ninja cmTC_028a0 && [1/2] Building C object CMakeFiles/cmTC_028a0.dir/testCCompiler.c.obj
FAILED: CMakeFiles/cmTC_028a0.dir/testCCompiler.c.obj
/config/.esphome/platformio/packages/toolchain-riscv32-esp@8.4.0+2021r2-patch3/bin/riscv32-esp-elf-gcc -march=rv32imc -o CMakeFiles/cmTC_028a0.dir/testCCompiler.c.obj -c testCCompiler.c
/bin/sh: 1: /config/.esphome/platformio/packages/toolchain-riscv32-esp@8.4.0+2021r2-patch3/bin/riscv32-esp-elf-gcc: not found
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:296 (__project)
CMakeLists.txt:3 (project)
========================== [FAILED] Took 9.97 seconds ==========================
I changed my raspi os from 32bit to 64bit with the help of this tutorial: tutonaut.de/raspberry-pi-von-32-auf-64-bit-umstellen
This only changes the kernel, not the full userspace, which is what is actually causing this issue. If you were using the 32-bit kernel, or a full 64-bit OS then it would work as expected.
I did a complete reinstall of my raspberry pi and installed raspberry pi os lite (64 bit). Now, I can compile with the latest esphome version 2022.12.3 the mentioned test config for my esp32-c3.
Hello! I found a way to fix this problem, when you install a docker on RPI with 32bit OS but kernel is modificated to 64bit (like me), when you install esphome docker using name image: esphome/esphome:2022.11, is going to download the image for 32bit, instead you need to force the install of the 64bit image using SHA256 for example : image: esphome/esphome:2022.11@sha256:ebfbdd11f29c1a2bacd554476d5d8f2981123fe8f7e3636005bff032d293ea3d
Tengo el mismo problema, la configuración de mi ambiente es:
Raspberry Pi 4 Versión del Sistema Operativo: 5.10.0-20-arm64 Arquitectura de CPU: aarch64
version | core-2023.2.5 |
---|---|
installation_type | Home Assistant Supervised |
dev | false |
hassio | true |
docker | true |
user | root |
virtualenv | false |
python_version | 3.10.7 |
os_name | Linux |
os_version | 5.10.0-20-arm64 |
arch | aarch64 |
timezone | America/Mexico_City |
config_dir | /config |
The problem
I am not able to compile a simple esphome config for my esp32-c3 with board esp32-c3-devkitm-1.
I bought the following esp32: https://www.reichelt.de/entwicklungsboard-esp32-c3-mini-1-esp32c3devkitm-p311730.html?&trstct=pos_1&nbc=1 Now, I created a new esp32-c3 test config file and try to compile this file. Everytime, I get the compile issue.
I am using esphome and homeassistant in a docker environment on a raspi4 (32bit os system).
Which version of ESPHome has the issue?
2022.12.0b5
What type of installation are you using?
Docker
Which version of Home Assistant has the issue?
2022.12.4
What platform are you using?
ESP32
Board
esp32-c3-devkitm-1
Component causing the issue
riscv32-esp-elf-g++: not found
Example YAML snippet
Anything in the logs that might be useful for us?
Additional information
No response