Compile yaml file failed

I am trying to compile a yaml file so I can use it with esphome-flasher, but it has failed 3 times to do it but it keeps failing.

HARDWARE: ESP32 240MHz, 320KB RAM, 4MB Flash
 - toolchain-xtensa-esp32 @ 8.4.0+2021r2-patch3
LDF: Library Dependency Finder ->
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
|-- Wire @ 2.0.0
|-- ArduinoJson @ 6.18.5
Linking /data/home/.pioenvs/home/firmware.elf
collect2: fatal error: ld terminated with signal 9 [Killed]
compilation terminated.
*** [/data/home/.pioenvs/home/firmware.elf] Error 1
========================= [FAILED] Took 71.73 seconds =========================

It has compiled once before, but not this time.
Can some one tell me why. I know it says terminated with signal 9 , but what does that mean.

Another newly created file as also failed with api_connection.cpp.o
Another new file failed with

 xtensa -esp32-elf-g++: fatal error: killed signal terminated program ccplus
compilation terminated
+++ [/data/home/.pioenvs/home/src/main.cpp.o] Error 1


Not of a great help but this happened to me in the past when the RPi is very busy.
signal 9 is SIGKILL, in linux you can “poke” processes with a various set of signal, each of them to inform the program that it should do something.

But there is one exception, it is SIGKILL, it is the only signal that nobody can intercept to do something. It is an instant kill. No previous notice.
SIGKILL is a useful signal for terminating processes that have become unresponsive.

Looking at you first code, it is not compiling anything, only linking.
What I did last time it was misbehaving is to use the CLI instead of the web interface but it is definitely not user friendly.

The top answer from stackoverflow via google is “memory exhaustion” - the machine you are compiling on does not have enough ram+swap to link the resulting compilation into a binary.

1 Like

I rebooted the pi 3 with HA on, and tried again, this time it compiled ok.

Actually this is the first time this problem has arisen, but yes probably not enough ram.


I had the same problem when trying to get my first ESP32 dev board working. Had a hard time finding this thread as a user with no to not so much experience. Disabling all add-ons except ESPHome and restarting the RPi 3 worked for me.


1 Like