ESPhome fails to update

If I update the ESPhome board, it fails. I run Homeassistant on a Raspberry Pi 3B and installed the ESPHome add-on. I am up to date on the latest version.

This is the log:
Updating /config/esphome/vloerverwarming.yaml

INFO Reading configuration /config/esphome/vloerverwarming.yaml…
INFO Generating C++ source…
INFO Compiling app…
Processing thermometer-lora (board: esp32dev; framework: arduino; platform: platformio/espressif32 @ 5.2.0)

HARDWARE: ESP32 240MHz, 320KB RAM, 4MB Flash

  • toolchain-xtensa-esp32 @ 8.4.0+2021r2-patch3
    LDF: Library Dependency Finder → Library Dependency Finder (LDF) — PlatformIO latest documentation
    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
    Compiling /data/thermometer-lora/.pioenvs/thermometer-lora/src/main.cpp.o
    Linking /data/thermometer-lora/.pioenvs/thermometer-lora/firmware.elf
    /data/cache/platformio/packages/toolchain-xtensa-esp32/bin/…/lib/gcc/xtensa-esp32-elf/8.4.0/…/…/…/…/xtensa-esp32-elf/bin/ld: cannot find -lstdc++
    collect2: error: ld returned 1 exit status
    *** [/data/thermometer-lora/.pioenvs/thermometer-lora/firmware.elf] Error 1

any suggestions? Creating a clean build does not change the outcome.

Probably running out of ram. Common problem on rpi 3.