esphome / issues

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

Failed to upload image to esp32-h2 #5032

Open morenod opened 10 months ago

morenod commented 10 months ago

The problem

Tried to intialize an esp32-h2 dev kit with following config file:

esphome:
  name: esp32-zigbee

esp32:
  board: esp32dev
  variant: esp32h2

Compile works fine, but at the time to upload, I get this error:

# esphome upload config/esp32.yaml 
INFO ESPHome 2023.10.3
INFO Reading configuration config/esp32.yaml...
Found multiple options for uploading, please choose one:
  [1] xxxx
  [2] /dev/ttyACM1 (USB JTAG/serial debug unit)
(number): 2
esptool.py v4.6.2
Serial port /dev/ttyACM1
Connecting...
Chip is ESP32-H2 (revision v0.2)
Features: BLE, IEEE802.15.4
Crystal is 32MHz
MAC: xxx
BASE MAC: xxx
MAC_EXT: ff:fe
Uploading stub...
Running stub...
Stub running...
Changing baud rate to 460800
Changed.
Configuring flash size...
Auto-detected Flash size: 4MB
Unexpected chip id in image. Expected 16 but value was 0. Is this image for a different chip model?
ERROR Running command failed:xxx/esphome/config/.esphome/build/esp32-zigbee/.pioenvs/esp32-zigbee/firmware.bin is not an ESP32-H2 image. Use --force to flash anyway.
ERROR Please try running esptool.py --before default_reset --after hard_reset --baud 460800 --port /dev/ttyACM1 --chip esp32h2 write_flash -z --flash_size detect 0x10000 xxx/esphome/config/.esphome/build/esp32-zigbee/.pioenvs/esp32-zigbee/firmware.bin 0x1000 xxx/esphome/config/.esphome/build/esp32-zigbee/.pioenvs/esp32-zigbee/bootloader.bin 0x8000 xxx/esphome/config/.esphome/build/esp32-zigbee/.pioenvs/esp32-zigbee/partitions.bin 0xe000 /root/.platformio/packages/framework-arduinoespressif32/tools/partitions/boot_app0.bin locally.

Which version of ESPHome has the issue?

2023.10.3

What type of installation are you using?

pip

Which version of Home Assistant has the issue?

No response

What platform are you using?

ESP32

Board

espressif esp32-h2-mini-1

Component causing the issue

No response

Example YAML snippet

esphome:
  name: esp32-zigbee

esp32:
  board: esp32dev
  variant: esp32h2

Anything in the logs that might be useful for us?

No response

Additional information

No response

kurdybacha commented 6 months ago

This is platformio issue. esp32-h2 dev kit seems unsupported. In the meantime you can try with https://github.com/Jason2866/platform-espressif32 e.g.:

esphome:
  name: esp32-zigbee
  platformio_options:
    platform: https://github.com/tasmota/platform-espressif32/releases/download/2024.01.11/platform-espressif32.zip
esp32:
  board: esp32-h2-devkitm-1
  framework:
    type: esp-idf
    version: latest
  variant: esp32h2
...
kurdybacha commented 6 months ago

It is also possible to bypass PlatformIO and compile ESPHome project directly with esp-idf which has support for esp32-h2. More info in ESP32-H2 with BME680 Sensor Part 2.