esphome / issues

Issue Tracker for ESPHome
https://esphome.io/
290 stars 36 forks source link

RP2040 compile error with ESPHome 2024.2.2 #5579

Closed on-kage closed 7 months ago

on-kage commented 7 months ago

The problem

After upgrading to ESPHome 2024.2.2, I attempted to update my Raspberry Pico W device that is currently on ESPHome v2024.2.1. The PicoW is currently running as an irrigation controller and is still completely functional as is. I just wanted to keep the version up to date. I have also tried to "Clean Build Files" and retry with the same result

I also tried to comment out all of the text sensors and sensors and still had compile failures

Which version of ESPHome has the issue?

2024.2.2

What type of installation are you using?

Home Assistant Add-on

Which version of Home Assistant has the issue?

2024.3.0

What platform are you using?

RP2040

Board

Raspberry Pi Pico W

Component causing the issue

No response

Example YAML snippet

esphome:
  name: sprinklercontroller
  friendly_name: SprinklerController

rp2040:
  board: rpipicow
  framework:
    # Required until https://github.com/platformio/platform-raspberrypi/pull/36 is merged
    platform_version: https://github.com/maxgerhardt/platform-raspberrypi.git

# Enable logging
logger:

# Enable Home Assistant API
api:
  encryption:
    key: "<key>"

ota:
  password: "<pass>"

wifi:
  ssid: !secret wifi_ssid
  password: !secret wifi_password

  manual_ip:
    static_ip: 192.168.0.185
    gateway: 192.168.0.1
    subnet: 255.255.255.0
sprinkler:
  - id: sprinkler_ctrl
    main_switch: "Sprinklers"
    auto_advance_switch: "Sprinklers Auto Advance"
    multiplier_number: "Sprinkler Multiplier"
    repeat_number: "Sprinkler Repeat"
    valve_overlap: 3s
    valves:
      - valve_switch: "Zone 1"
        run_duration: 300s
        valve_switch_id: sprinkler_valve_sw1
      - valve_switch: "Zone 2"
        run_duration: 300s
        valve_switch_id: sprinkler_valve_sw2
      - valve_switch: "Zone 3"
        run_duration: 300s
        valve_switch_id: sprinkler_valve_sw3
      - valve_switch: "Zone 4"
        run_duration: 300s
        valve_switch_id: sprinkler_valve_sw4
      - valve_switch: "Zone 5"
        run_duration: 300s
        valve_switch_id: sprinkler_valve_sw5
      - valve_switch: "Zone 6"
        run_duration: 300s
        valve_switch_id: sprinkler_valve_sw6
      - valve_switch: "Zone 7"
        run_duration: 300s
        valve_switch_id: sprinkler_valve_sw7
      - valve_switch: "Zone 8"
        run_duration: 300s
        valve_switch_id: sprinkler_valve_sw8
      - valve_switch: "Zone 9"
        run_duration: 300s
        valve_switch_id: sprinkler_valve_sw9
      - valve_switch: "Zone 10"
        run_duration: 300s
        valve_switch_id: sprinkler_valve_sw10
      - valve_switch: "Zone 11"
        run_duration: 300s
        valve_switch_id: sprinkler_valve_sw11
      - valve_switch: "Zone 12"
        run_duration: 300s
        valve_switch_id: sprinkler_valve_sw12

switch: 
  - platform: gpio
    pin: 
      number: 0
      inverted: true
    id: sprinkler_valve_sw1
  - platform: gpio
    pin: 
      number: 28
      inverted: true
    id: sprinkler_valve_sw2
  - platform: gpio
    pin: 
      number: 1
      inverted: true
    id: sprinkler_valve_sw3
  - platform: gpio
    pin: 
      number: 22
      inverted: true
    id: sprinkler_valve_sw4
  - platform: gpio
    pin: 
      number: 2
      inverted: true
    id: sprinkler_valve_sw5
  - platform: gpio
    pin: 
      number: 21
      inverted: true
    id: sprinkler_valve_sw6
  - platform: gpio
    pin: 
      number: 3
      inverted: true
    id: sprinkler_valve_sw7
  - platform: gpio
    pin: 
      number: 20
      inverted: true
    id: sprinkler_valve_sw8
  - platform: gpio
    pin: 
      number: 4
      inverted: true
    id: sprinkler_valve_sw9
  - platform: gpio
    pin: 
      number: 19
      inverted: true
    id: sprinkler_valve_sw10
  - platform: gpio
    pin: 
      number: 5
      inverted: true
    id: sprinkler_valve_sw11
  - platform: gpio
    pin: 
      number: 17
      inverted: true
    id: sprinkler_valve_sw12
  - platform: gpio
    pin: 
      number: 6
      inverted: true
    id: sprinkler_valve_sw13
  - platform: gpio
    pin: 
      number: 18
      inverted: true
    id: sprinkler_valve_sw14
  - platform: gpio
    pin: 
      number: 7
      inverted: true
    id: sprinkler_valve_sw15
  - platform: gpio
    pin: 
      number: 15
      inverted: false
    id: sprinkler_en
    name: "Enable"

text_sensor:
  - platform: wifi_info
    ip_address:
      name: Sprinkler IP
    ssid:
      name: Sprinkler SSID
  - platform: version
    name: Sprinkler Version
    hide_timestamp: true
    disabled_by_default: false
    icon: mdi:new-box
    entity_category: diagnostic
sensor:
  - platform: wifi_signal # Reports the WiFi signal strength/RSSI in dB
    name: "Sprinkler Signal dB"
    id: wifi_signal_db
    update_interval: 60s
    entity_category: "diagnostic"
  - platform: copy # Reports the WiFi signal strength in %
    source_id: wifi_signal_db
    name: "Sprinkler Signal %"
    filters:
      - lambda: return min(max(2 * (x + 100.0), 0.0), 100.0);
    unit_of_measurement: " %"
    entity_category: "diagnostic"
    device_class: ""
  - platform: uptime
    name: Sprinkler Uptime
    disabled_by_default: false
    force_update: false
    unit_of_measurement: s
    icon: mdi:timer-outline
    accuracy_decimals: 0
    device_class: duration
    state_class: total_increasing
    entity_category: diagnostic
    update_interval: 60s

Anything in the logs that might be useful for us?

INFO ESPHome 2024.2.2
INFO Reading configuration /config/esphome/sprinklercontroller.yaml...
INFO Generating C++ source...
INFO Compiling app...
Processing sprinklercontroller (board: rpipicow; framework: arduino; platform: https://github.com/maxgerhardt/platform-raspberrypi.git)
--------------------------------------------------------------------------------
HARDWARE: RP2040 133MHz, 264KB RAM, 2MB Flash
 - framework-arduinopico @ 1.30600.0 (3.6.0) 
 - tool-rp2040tools @ 1.0.2 
Flash size: 2.00MB
Sketch size: 1.00MB
Filesystem size: 1.00MB
Maximium Sketch size: 1044480 EEPROM start: 0x101ff000 Filesystem start: 0x100ff000 Filesystem end: 0x101ff000
Dependency Graph
|-- WiFi @ 1.0.0
|-- LEAmDNS @ 1.2
|-- Updater @ 1.0
|-- noise-c @ 0.1.4
|-- MD5Builder @ 1.0.0
|-- lwIP-Ethernet @ 1
|-- lwIP_CYW43 @ 1
|-- SPI @ 1.0
Compiling .pioenvs/sprinklercontroller/src/esphome/components/api/api_connection.cpp.o
Compiling .pioenvs/sprinklercontroller/src/esphome/components/api/api_frame_helper.cpp.o
Compiling .pioenvs/sprinklercontroller/src/esphome/components/api/api_pb2.cpp.o
Compiling .pioenvs/sprinklercontroller/src/esphome/components/api/api_pb2_service.cpp.o
Compiling .pioenvs/sprinklercontroller/src/esphome/components/api/api_server.cpp.o
Compiling .pioenvs/sprinklercontroller/src/esphome/components/api/list_entities.cpp.o
Compiling .pioenvs/sprinklercontroller/src/esphome/components/api/proto.cpp.o
during GIMPLE pass: phiopt
Compiling .pioenvs/sprinklercontroller/src/esphome/components/api/subscribe_state.cpp.o
In file included from /data/cache/platformio/packages/toolchain-rp2040-earlephilhower/arm-none-eabi/include/c++/12.3.0/vector:70,
                 from /data/cache/platformio/packages/toolchain-rp2040-earlephilhower/arm-none-eabi/include/c++/12.3.0/functional:62,
                 from src/esphome/core/component.h:5,
                 from src/esphome/components/api/proto.h:3,
                 from src/esphome/components/api/api_pb2.h:5,
                 from src/esphome/components/api/api_pb2.cpp:3:
/data/cache/platformio/packages/toolchain-rp2040-earlephilhower/arm-none-eabi/include/c++/12.3.0/bits/vector.tcc: In member function 'void std::vector<_Tp, _Alloc>::_M_realloc_insert(iterator, _Args&& ...) [with _Args = {std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >}; _Tp = std::__cxx11::basic_string<char>; _Alloc = std::allocator<std::__cxx11::basic_string<char> >]':
/data/cache/platformio/packages/toolchain-rp2040-earlephilhower/arm-none-eabi/include/c++/12.3.0/bits/vector.tcc:439:7: internal compiler error: Segmentation fault
  439 |       vector<_Tp, _Alloc>::
      |       ^~~~~~~~~~~~~~~~~~~
0x184285e internal_error(char const*, ...)
    ???:0
0xa8c7f3 gimple_seq_discard(gimple*)
    ???:0
Please submit a full bug report, with preprocessed source (by using -freport-bug).
Please include the complete backtrace with any bug report.
See <https://gcc.gnu.org/bugs/> for instructions.
*** [.pioenvs/sprinklercontroller/src/esphome/components/api/api_pb2.cpp.o] Error 1
during GIMPLE pass: phiopt
src/esphome/components/api/api_server.cpp: In member function 'bool esphome::api::APIServer::check_password(const std::string&) const':
src/esphome/components/api/api_server.cpp:345:1: internal compiler error: Segmentation fault
  345 | }  // namespace esphome
      | ^
0x184285e internal_error(char const*, ...)
    ???:0
0xa8c7f3 gimple_seq_discard(gimple*)
    ???:0
Please submit a full bug report, with preprocessed source (by using -freport-bug).
Please include the complete backtrace with any bug report.
See <https://gcc.gnu.org/bugs/> for instructions.
*** [.pioenvs/sprinklercontroller/src/esphome/components/api/api_server.cpp.o] Error 1
========================= [FAILED] Took 21.75 seconds =========================

Additional information

No response

ssieb commented 7 months ago

That is most likely a hardware problem. What are you running HA on?

on-kage commented 7 months ago

I am running on a BeeLink mini PC (https://a.co/d/itxagkK) HA is running on a VM in VirtualBox (6.1.38_Ubuntu_r153438). Host OS is Linux Mint 21.1

ssieb commented 7 months ago

I'm guessing it's a virtualbox issue then. Try running esphome directly on the PC, not as an HA addon.

on-kage commented 7 months ago

Running ESPHome in a docker directly on the PC did work to get compiled and loaded

blackie333 commented 7 months ago

Have experienced similar errors on my 4GB Arm-based host because esphome compilation has consumed all available ram memory on host.