Using VSCode / Platform IO IDE installed on Raspberry PI4.
Created a new projet “Test”
plaformio.ini ;
[env:esp32dev]
platform = espressif32
board = esp32dev
framework = arduino
when I build the project I’ve an errror for xtensa g++ not found.
Also I got an error for <Arduino.h> missing stdbool.h include file (not in include path)
vscode and platformio IDE reinstalled.
Running on Raspberry PI4 - Linux raspberrypi 6.1.21-v8+
debian version 11.6
PlatformIO IDE 3.1.1
VSCode V1.76.0
.vscode and .platformio removed → not solving issue.
`
Exécution de la tâche dans le dossier Test : platformio run
Processing esp32dev (platform: espressif32; board: esp32dev; framework: arduino)
Verbose mode can be enabled via -v, --verbose
option
CONFIGURATION: Redirecting...
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-arduinoespressif32 @ 3.20007.0 (2.0.7)
tool-esptoolpy @ 1.40500.0 (4.5.0)
toolchain-xtensa-esp32 @ 8.4.0+2021r2-patch5
LDF: Library Dependency Finder → Library Dependency Finder (LDF) — PlatformIO latest documentation
LDF Modes: Finder ~ chain, Compatibility ~ soft
Found 33 compatible libraries
Scanning dependencies…
No dependencies
Building in release mode
Compiling .pio/build/esp32dev/src/main.cpp.o
sh: 1: xtensa-esp32-elf-g++: not found
Building .pio/build/esp32dev/bootloader.bin
Generating partitions .pio/build/esp32dev/partitions.bin
esptool.py v4.5
Creating esp32 image…
Merged 1 ELF section
Successfully created esp32 image.
Compiling .pio/build/esp32dev/FrameworkArduino/Esp.cpp.o
*** [.pio/build/esp32dev/src/main.cpp.o] Error 127
sh: 1: xtensa-esp32-elf-g++: not found
Some additionnal comments ;
pi@raspberrypi:~ $ uname -a
Linux raspberrypi 6.1.21-v8+ #1642 SMP PREEMPT Mon Apr 3 17:24:16 BST 2023 aarch64 GNU/Linux
pi@raspberrypi:~ $ find /home/pi/.platformio -name “xtensa-esp32-elf-g++” -print
/home/pi/.platformio/packages/toolchain-xtensa-esp32/bin/xtensa-esp32-elf-g++
pi@raspberrypi:~ $ file /home/pi/.platformio/packages/toolchain-xtensa-esp32/bin/xtensa-esp32-elf-g++
/home/pi/.platformio/packages/toolchain-xtensa-esp32/bin/xtensa-esp32-elf-g++: ELF 64-bit LSB executable, ARM aarch64, version 1 (SYSV), dynamically linked, interpreter /lib/ld-linux-aarch64.so.1, for GNU/Linux 3.7.0, BuildID[sha1]=abfed9e5893019faebfd4748833b6357f5cfe614, stripped
pi@raspberrypi:~ $ /home/pi/.platformio/packages/toolchain-xtensa-esp32/bin/xtensa-esp32-elf-g++
bash: /home/pi/.platformio/packages/toolchain-xtensa-esp32/bin/xtensa-esp32-elf-g++: Aucun fichier ou dossier de ce type
→ Maybe is that G++ is ELF64bit with interpreter /lib/ld-linux-aarch64.so.1,
And ld-linux-aarch64.so.1 is missing…
pi@raspberrypi:~ $ ll /lib/ld-linux*
lrwxrwxrwx 1 root root 30 18 oct. 2022 /lib/ld-linux-armhf.so.3 → arm-linux-gnueabihf/ld-2.31.so
lrwxrwxrwx 1 root root 24 30 oct. 2021 /lib/ld-linux.so.3 → /lib/ld-linux-armhf.so.3
Are you running a 32-bit Raspbian on a 64-bit capable Raspberry Pi?
I think Yes… After a apt-get update && apt-get upgrade
I’m looking to boot a 32 bit kernel
may I can also upgrade to 64bit Raspbian… and reconfigure my server
What’s the output of pio system info
?
pi@raspberrypi:~ $ .platformio/penv/bin/pio system info
-------------------------- ---------------------------------------
PlatformIO Core 6.1.7
Python 3.9.2-final.0
System Type linux_aarch64
Platform Linux-6.1.21-v8+-aarch64-with-glibc2.31
File System Encoding utf-8
Locale Encoding UTF-8
PlatformIO Core Directory /home/pi/.platformio
PlatformIO Core Executable platformio
Python Executable /home/pi/.platformio/penv/bin/python
Global Libraries 0
Development Platforms 2
Tools & Toolchains 7
Identifying a 64bit arch…
So uname -a
says aarch64. The platform returned by Python says aarch64. PlatformIO thinks you’re on aarch64. But… you’re not running a 64-bit kernel.
I’m not sure whether PlatformIO is doing something wrong here or whether the state of your system is screwy.
In any case, things should be resolved if you get a clean 64-bit (preferred) raspbian image installed on the Pi.
If you think PlatformIO should detect this case and give you the ARMv7l (32-bit) binaries, file a bug in Issues · platformio/platformio-core · GitHub .
Tks a lot for this.
It’s more clear for me.
I’ve created an issue and it is closed now → post pb here…
Maybe too long to wait this to solve aarch64 kernel on Raspbian 32bit.
I’m looking a workaround to boot a 32 bit kernel.
And for long time reinstall a Raspbian OS 64Bit on my Pi4. I’ve an old Pi3 that can run my current config and renstall my config.
maxgerhardt:
aarch64
See here. issue “After updating 32 bit Raspi OS Pi 4 is on 64bit kernel”
opened 03:20PM - 18 Mar 23 UTC
After updating Raspberry PI OS to the last kernel update, the kernel is switched… to 64 bit.
$ uname -a
Linux 5.15.84-v7l+ #1613 SMP Thu Jan 5 12:01:26 GMT 2023 armv7l GNU/Linux
$ sudo apt update
....
$ sudo apt upgrade
The following packages will be upgraded:
curl libapr1 libaprutil1 libaprutil1-dbd-sqlite3 libaprutil1-ldap libcamera-apps-lite libcamera0 libcurl3-gnutls libcurl4 libnss3 libtiff5 linux-libc-dev raspberrypi-bootloader raspberrypi-kernel
raspi-config vcdbg
16 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
Need to get 108 MB/111 MB of archives.
After this operation, 3,879 kB of additional disk space will be used.
Do you want to continue? [Y/n] Y
Get:1 http://archive.raspberrypi.org/debian bullseye/main armhf raspberrypi-kernel armhf 1:1.20230317-1 [102 MB]
Get:2 http://archive.raspberrypi.org/debian bullseye/main armhf linux-libc-dev armhf 1:1.20230317-1 [1,119 kB]
Get:3 http://archive.raspberrypi.org/debian bullseye/main armhf raspberrypi-bootloader armhf 1:1.20230317-1 [4,542 kB]
Get:4 http://archive.raspberrypi.org/debian bullseye/main armhf vcdbg armhf 1:1.20230317-1 [213 kB]
......
Setting up raspberrypi-kernel (1:1.20230317-1) ..
.....
$ sudo reboot
....
$ uname -a
Linux 6.1.19-v8+ #1637 SMP PREEMPT Tue Mar 14 11:11:47 GMT 2023 aarch64 GNU/Linux
For me this is a problem while running some software that needs 32bit.
arm_64bit=0 added tot /boot/config.txt and everything fine now.
Why not respect the 32bit kernel when already active and change the setting to arm_64bit=1 if needed?
Workaround is
The switch to running a 64-bit kernel by default on Pi 4 is intentional.
We believe it gives a better experience with few drawbacks.
As you've found, you can revert to the 32-bit kernel by adding `arm_64bit=0` to config.txt.
See https://forums.raspberrypi.com/viewtopic.php?p=2088935#p2088935 for more details.
And also some comments
A 64-bit OS requires a 64-bit kernel.
A 32-bit OS can use a 32-bit or 64-bit kernel.
So add line “arm_64bit=0” at the end of /boot/config.txt in section pi4
[pi4]
# Run as fast as firmware / board allows
arm_boost=1
arm_64bit=0
[all]
And reboot.
Reinstallation of PlatformIO will work fine after.