g0xar
May 30, 2022, 1:05pm
1
Hi, I’m new here and a beginner with ESP32, Linux and embedded systems. So I apologise if I’m asking really dumb questions.
I’m using a Raspberry Pi 4 with the latest 32 bit operating system. I’ve successfully installed VS Studio code and Platform IO. Using the Project Wizard to create my first project using the Espressive IOT Development Framework fails.
To help me diagnose the problem I’ve tried to copy the text in the results pop up window which tells me it has failed. I can’t find a way to do this. There is a lot of text. It seems to be replicated in my Documents folder in a file called Platform_io_error. However this also has a lot of HTML like text formatting characters which neither of my editors will ignore. I don’t really want to spend time removing them manually which is why I’m asking what markup format is used. Then I can find an appropriate editor.
For what its worth the problem seems to be a failure to load the liblto.plugin.so plugin.
Thanks, and stay safe,
Steve
Let’s make sure you can compile the basic examples. Do on the commandline (you must have exported PlatformIO into the PATH )
cp -r ~/.platformio/platforms/espressif32/examples/espidf-blink .
cd espidf-blink
pio run -t clean
pio run
Does it show any errors?
1 Like
g0xar
May 30, 2022, 6:31pm
3
Max, Thank you for the advice. The basic examples are not installed. After an educational time with a text editor I’ve managed to clean up the error file and removed most of the unwanted formatting.
There seems to be a problem here
Error: Processing az-delivery-devkit-v4 (platform: espressif32; board: az-delivery-devkit-v4; framework: espidf)
So I need to investigate that. I tried to post the whole file but I’m new here and am not allowed to.
Regards,
Steve
Can you upload it to pastebin.com and link it here?
My bad, maybe we should have run a pio platform install espressif32
before that to make sure it does.
There was an s
missing in the path, I fixed that now.
g0xar
May 31, 2022, 10:32am
6
Hi Max,
Thanks for the change. I deleted ProgramIO from VSC, removed the Espressive framework. Then did a reload of Linux, then reinstalled ProgramIO within VSC. Hopefully that cleaned out the trash.
Using the project wizard I created a new project as before. This time there is a new failure message
Tool Manager: tool-ninja@1.10.2 has been installed!
Updating metadata for the vscode IDE…
Error: Processing az-delivery-devkit-v4 (platform: espressif32; board: az-delivery-devkit-v4; framework: espidf)
--------------------------------------------------------------------------------
Verbose mode can be enabled via `-v, --verbose` option
CONFIGURATION: https://docs.platformio.org/page/boards/espressif32/az-delivery-devkit-v4.html
If I have time later today I’ll send you a link to the entire file. For what its worth there is no rush. I’m a hobby programmer now learning the ESP-32 and C++ for radio and robotics projects.
Stay safe and thanks again,
Steve
g0xar
May 31, 2022, 10:50am
7
I made a mistake Max, its the same error. Here is the content of platformio.ini
; PlatformIO Project Configuration File
;
; Build options: build flags, source filter
; Upload options: custom upload port, speed and extra flags
; Library options: dependencies, extra library storages
; Advanced options: extra scripting
;
; Please visit documentation for the other options and examples
; Redirecting...
[env:az-delivery-devkit-v4]
platform = espressif32
board = az-delivery-devkit-v4
framework = espidf
g0xar
May 31, 2022, 12:33pm
8
Max, Here is the complete diagnostic file az-delivery-devkit-v4 - Pastebin.com
Steve
/home/koszonom/.platformio/packages/toolchain-xtensa-esp32/bin/../lib/gcc/xtensa-esp32-elf/8.4.0/../../../../xtensa-esp32-elf/bin/ld: /home/koszonom/.platformio/packages/toolchain-xtensa-esp32/bin/../libexec/gcc/xtensa-esp32-elf/8.4.0/liblto_plugin.so: error loading plugin: /home/koszonom/.platformio/packages/toolchain-xtensa-esp32/bin/../libexec/gcc/xtensa-esp32-elf/8.4.0/liblto_plugin.so: cannot open shared object file: No such file or directory
Hm. It really looks like the compiler is not properly executable on the Pi 4. The same was noticed in
opened 10:02PM - 08 Nov 21 UTC
closed 06:18AM - 21 Nov 22 UTC
Status: Done
Resolution: Done
Hi.
If I do this everything works exactly as expected:
```bash
# Install I… DF
export IDF_TOOLS_PATH=/home/esp/tools/
mkdir /home/esp/idf
cd /home/esp/idf
git clone -b v4.3.1 --recursive https://github.com/espressif/esp-idf.git .
./install.sh
# Pull fix for broken CA file
cd /home/esp/idf/components/mbedtls/esp_crt_bundle
mv cacrt_all.pem cacrt_all.pem.orig
wget https://raw.githubusercontent.com/electrocucaracha/esp-idf/4e45f13e2df72a4cb4dc875942e95775198db85c/components/mbedtls/esp_crt_bundle/cacrt_all.pem
# Compile 'blink'
cp -pr /home/esp/idf/examples/get-started/blink /home/esp/blink/
cd /home/esp/blink
. /home/esp/idf/export.sh
idf.py set-target esp32s2
idf.py build
```
However, the author of TinyUSB (@hathach) has told me that TinyUSB does not (and will not in the forseeable future) do what I need, so I need to use v4.4 of the IDF.
**If I erase everything (and clear the environment) ...and repeat all the above steps using `-b release/v4.4`, the `set-target` command fails with:**
```bash
~/blink $ idf.py set-target esp32s2
Adding "set-target"'s dependency "fullclean" to list of commands with default set of options.
Executing action: fullclean
Build directory '/home/esp/blink/build' not found. Nothing to clean.
Executing action: set-target
Set Target to: esp32s2, new sdkconfig created. Existing sdkconfig renamed to sdkconfig.old.
Running cmake in directory /home/esp/blink/build
Executing "cmake -G Ninja -DPYTHON_DEPS_CHECKED=1 -DESP_PLATFORM=1 -DIDF_TARGET=esp32s2 -DCCACHE_ENABLE=0 /home/esp/blink"...
-- Found Git: /usr/bin/git (found version "2.20.1")
-- 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: /home/esp/tools/tools/xtensa-esp32s2-elf/esp-2021r2-8.4.0/xtensa-esp32s2-elf/bin/xtensa-esp32s2-elf-gcc
-- Check for working C compiler: /home/esp/tools/tools/xtensa-esp32s2-elf/esp-2021r2-8.4.0/xtensa-esp32s2-elf/bin/xtensa-esp32s2-elf-gcc
-- Check for working C compiler: /home/esp/tools/tools/xtensa-esp32s2-elf/esp-2021r2-8.4.0/xtensa-esp32s2-elf/bin/xtensa-esp32s2-elf-gcc -- broken
CMake Error at /usr/share/cmake-3.16/Modules/CMakeTestCCompiler.cmake:60 (message):
The C compiler
"/home/esp/tools/tools/xtensa-esp32s2-elf/esp-2021r2-8.4.0/xtensa-esp32s2-elf/bin/xtensa-esp32s2-elf-gcc"
is not able to compile a simple test program.
It fails with the following output:
Change Dir: /home/esp/blink/build/CMakeFiles/CMakeTmp
Run Build Command(s):/usr/bin/ninja cmTC_a0212 && [1/2] Building C object CMakeFiles/cmTC_a0212.dir/testCCompiler.c.obj
[2/2] Linking C executable cmTC_a0212
FAILED: cmTC_a0212
: && /home/esp/tools/tools/xtensa-esp32s2-elf/esp-2021r2-8.4.0/xtensa-esp32s2-elf/bin/xtensa-esp32s2-elf-gcc -mlongcalls CMakeFiles/cmTC_a0212.dir/testCCompiler.c.obj -o cmTC_a0212 && :
/home/esp/tools/tools/xtensa-esp32s2-elf/esp-2021r2-8.4.0/xtensa-esp32s2-elf/bin/../lib/gcc/xtensa-esp32s2-elf/8.4.0/../../../../xtensa-esp32s2-elf/bin/ld: /home/esp/tools/tools/xtensa-esp32s2-elf/esp-2021r2-8.4.0/xtensa-esp32s2-elf/bin/../libexec/gcc/xtensa-esp32s2-elf/8.4.0/liblto_plugin.so: error loading plugin: /home/esp/tools/tools/xtensa-esp32s2-elf/esp-2021r2-8.4.0/xtensa-esp32s2-elf/bin/../libexec/gcc/xtensa-esp32s2-elf/8.4.0/liblto_plugin.so: cannot open shared object file: No such file or directory
collect2: error: ld returned 1 exit status
ninja: build stopped: subcommand failed.
CMake will not be able to correctly generate this project.
Call Stack (most recent call first):
/home/esp/idf/tools/cmake/project.cmake:290 (__project)
CMakeLists.txt:8 (project)
-- Configuring incomplete, errors occurred!
See also "/home/esp/blink/build/CMakeFiles/CMakeOutput.log".
See also "/home/esp/blink/build/CMakeFiles/CMakeError.log".
cmake failed with exit code 1
```
**The directory `/home/esp/blink/build/CMakeFiles/CMakeTmp` DOES exist:**
```bash
~/blink $ ls -ald /home/esp/blink/build/CMakeFiles/CMakeTmp
drwxr-xr-x 2 esp esp 4096 Nov 8 21:27 /home/esp/blink/build/CMakeFiles/CMakeTmp
```
**And so does `/home/esp/tools/tools/xtensa-esp32s2-elf/esp-2021r2-8.4.0/xtensa-esp32s2-elf/bin/../libexec/gcc/xtensa-esp32s2-elf/8.4.0/liblto_plugin.so`:**
```bash
~/blink $ ls -al /home/esp/tools/tools/xtensa-esp32s2-elf/esp-2021r2-8.4.0/xtensa-esp32s2-elf/bin/../libexec/gcc/xtensa-esp32s2-elf/8.4.0/liblto_plugin.so*
lrwxrwxrwx 1 esp esp 22 Nov 8 21:25 /home/esp/tools/tools/xtensa-esp32s2-elf/esp-2021r2-8.4.0/xtensa-esp32s2-elf/bin/../libexec/gcc/xtensa-esp32s2-elf/8.4.0/liblto_plugin.so -> liblto_plugin.so.0.0.0
lrwxrwxrwx 1 esp esp 22 Nov 8 21:25 /home/esp/tools/tools/xtensa-esp32s2-elf/esp-2021r2-8.4.0/xtensa-esp32s2-elf/bin/../libexec/gcc/xtensa-esp32s2-elf/8.4.0/liblto_plugin.so.0 -> liblto_plugin.so.0.0.0
-rwxr-xr-x 1 esp esp 71508 Oct 15 07:35 /home/esp/tools/tools/xtensa-esp32s2-elf/esp-2021r2-8.4.0/xtensa-esp32s2-elf/bin/../libexec/gcc/xtensa-esp32s2-elf/8.4.0/liblto_plugin.so.0.0.0
```
**The log files don't give me any further clues:**
```bash
~/blink $ cat build/CMakeFiles/CMakeError.log
Compiling the C compiler identification source file "CMakeCCompilerId.c" failed.
Compiler: /home/esp/tools/tools/xtensa-esp32s2-elf/esp-2021r2-8.4.0/xtensa-esp32s2-elf/bin/xtensa-esp32s2-elf-gcc
Build flags: -mlongcalls
Id flags:
The output was:
1
/home/esp/tools/tools/xtensa-esp32s2-elf/esp-2021r2-8.4.0/xtensa-esp32s2-elf/bin/../lib/gcc/xtensa-esp32s2-elf/8.4.0/../../../../xtensa-esp32s2-elf/bin/ld: /home/esp/tools/tools/xtensa-esp32s2-elf/esp-2021r2-8.4.0/xtensa-esp32s2-elf/bin/../libexec/gcc/xtensa-esp32s2-elf/8.4.0/liblto_plugin.so: error loading plugin: /home/esp/tools/tools/xtensa-esp32s2-elf/esp-2021r2-8.4.0/xtensa-esp32s2-elf/bin/../libexec/gcc/xtensa-esp32s2-elf/8.4.0/liblto_plugin.so: cannot open shared object file: No such file or directory
collect2: error: ld returned 1 exit status
Compiling the CXX compiler identification source file "CMakeCXXCompilerId.cpp" failed.
Compiler: /home/esp/tools/tools/xtensa-esp32s2-elf/esp-2021r2-8.4.0/xtensa-esp32s2-elf/bin/xtensa-esp32s2-elf-g++
Build flags: -mlongcalls
Id flags:
The output was:
1
/home/esp/tools/tools/xtensa-esp32s2-elf/esp-2021r2-8.4.0/xtensa-esp32s2-elf/bin/../lib/gcc/xtensa-esp32s2-elf/8.4.0/../../../../xtensa-esp32s2-elf/bin/ld: /home/esp/tools/tools/xtensa-esp32s2-elf/esp-2021r2-8.4.0/xtensa-esp32s2-elf/bin/../libexec/gcc/xtensa-esp32s2-elf/8.4.0/liblto_plugin.so: error loading plugin: /home/esp/tools/tools/xtensa-esp32s2-elf/esp-2021r2-8.4.0/xtensa-esp32s2-elf/bin/../libexec/gcc/xtensa-esp32s2-elf/8.4.0/liblto_plugin.so: cannot open shared object file: No such file or directory
collect2: error: ld returned 1 exit status
Determining if the C compiler works failed with the following output:
Change Dir: /home/esp/blink/build/CMakeFiles/CMakeTmp
Run Build Command(s):/usr/bin/ninja cmTC_a0212 && [1/2] Building C object CMakeFiles/cmTC_a0212.dir/testCCompiler.c.obj
[2/2] Linking C executable cmTC_a0212
FAILED: cmTC_a0212
: && /home/esp/tools/tools/xtensa-esp32s2-elf/esp-2021r2-8.4.0/xtensa-esp32s2-elf/bin/xtensa-esp32s2-elf-gcc -mlongcalls CMakeFiles/cmTC_a0212.dir/testCCompiler.c.obj -o cmTC_a0212 && :
/home/esp/tools/tools/xtensa-esp32s2-elf/esp-2021r2-8.4.0/xtensa-esp32s2-elf/bin/../lib/gcc/xtensa-esp32s2-elf/8.4.0/../../../../xtensa-esp32s2-elf/bin/ld: /home/esp/tools/tools/xtensa-esp32s2-elf/esp-2021r2-8.4.0/xtensa-esp32s2-elf/bin/../libexec/gcc/xtensa-esp32s2-elf/8.4.0/liblto_plugin.so: error loading plugin: /home/esp/tools/tools/xtensa-esp32s2-elf/esp-2021r2-8.4.0/xtensa-esp32s2-elf/bin/../libexec/gcc/xtensa-esp32s2-elf/8.4.0/liblto_plugin.so: cannot open shared object file: No such file or directory
collect2: error: ld returned 1 exit status
ninja: build stopped: subcommand failed.
```
```bash
~/blink $ cat build/CMakeFiles/CMakeOutput.log
The target system is: Generic - -
The host system is: Linux - 5.10.63-v7l+ - armv7l
Compiling the C compiler identification source file "CMakeCCompilerId.c" succeeded.
Compiler: /home/esp/tools/tools/xtensa-esp32s2-elf/esp-2021r2-8.4.0/xtensa-esp32s2-elf/bin/xtensa-esp32s2-elf-gcc
Build flags: -mlongcalls
Id flags: -c
The output was:
0
Compilation of the C compiler identification source "CMakeCCompilerId.c" produced "CMakeCCompilerId.o"
The C compiler identification is GNU, found in "/home/esp/blink/build/CMakeFiles/3.16.3/CompilerIdC/CMakeCCompilerId.o"
Compiling the CXX compiler identification source file "CMakeCXXCompilerId.cpp" succeeded.
Compiler: /home/esp/tools/tools/xtensa-esp32s2-elf/esp-2021r2-8.4.0/xtensa-esp32s2-elf/bin/xtensa-esp32s2-elf-g++
Build flags: -mlongcalls
Id flags: -c
The output was:
0
Compilation of the CXX compiler identification source "CMakeCXXCompilerId.cpp" produced "CMakeCXXCompilerId.o"
The CXX compiler identification is GNU, found in "/home/esp/blink/build/CMakeFiles/3.16.3/CompilerIdCXX/CMakeCXXCompilerId.o"
Checking whether the ASM compiler is GNU using "--version" matched "(GNU assembler)|(GCC)|(Free Software Foundation)":
xtensa-esp32s2-elf-gcc (crosstool-NG esp-2021r2) 8.4.0
Copyright (C) 2018 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
```
The same error happens if I use `master` or `4.4-dev` branches, or if I use `git` to switch branches from `4.3.1` (as per the official docs) ...IE. `4.3.1` is the _only_ version I can get to work - and I _need_ v4.4 for the native USB support!
I'm out of ideas! Can anybody help please?
Thanks,
BC
Funny that even Mac seemed to have problems with this in past, and you could disable LTO to get around this problem (at the cost of increased firmware size) Doesn't work on macOS Monterey 12.3! · Issue #727 · platformio/platform-espressif32 · GitHub .
But basically there probably needs to be a new XTensa compiler package for the Pi. Please open an issue in Issues · platformio/platform-espressif32 · GitHub about this error.
g0xar
May 31, 2022, 1:18pm
10
Max, Thanks, having read through those issues I’ll install a fresh 64 bit version of Rasberian on a spare Pi 4 and try it out. I’ll report back. If that fails I have an Intel based single board system.
Stay safe,
Steve
g0xar
May 31, 2022, 5:31pm
11
Max, I can confirm that on both 32 and 64 bit versions of the operating system and VSCode there are problems. I need to get some more diagnostics before I raise the issue formally.
On my M1 Mac there are no issues, which surprised me!
Stay safe in Ukraine and watch out for orcs!
Steve