Skip to content

Issues updating the slave from HTTPS and query it's current firmware version (EHM-74) #71

@me-no-dev

Description

@me-no-dev

Checklist

  • Checked the issue tracker for similar issues to ensure this is not a duplicate
  • Read the documentation to confirm the issue is not addressed there and your configuration is set correctly
  • Tested with the latest version to ensure the issue hasn't been fixed

How often does this bug occurs?

always

Expected behavior

  • OTA should be able to update the slave firmware from HTTPS URL (and possibly from local file/byte array)
  • esp_hosted_get_coprocessor_fwversion() should work after calling esp_hosted_init()
  • esp_hosted_init() should return error if Slave was not found (wrong pins, missing, etc.)
  • There should be a way to query the Host version and compare against the Slave version
  • Possibly there should be a way to query the slave chip model

Actual behavior (suspected bug)

When attempting OTA over HTTPS the following logs are emitted and update fails:

E (8461) esp-tls-mbedtls: No server verification option set in esp_tls_cfg_t structure. Check esp_tls API reference
E (8461) esp-tls-mbedtls: Failed to set client configurations, returned [0x8017] (ESP_ERR_MBEDTLS_SSL_SETUP_FAILED)
E (8471) esp-tls: create_ssl_handle failed
E (8474) esp-tls: Failed to open new connection
E (8478) transport_base: Failed to open a new connection
E (8484) HTTP_CLIENT: Connection failed, sock < 0
E (8488) hosted_ota: Failed to open HTTP connection: ESP_ERR_HTTP_CONNECT
E (8494) hosted_ota: Check if URL is correct and connectable: https://github.com/.../network_adapter.bin

When calling esp_hosted_get_coprocessor_fwversion() right after esp_hosted_init() the following exception is raised:

E (3238) H_SDIO_DRV: tx fail: NULL buff, invalid len (20) or len > max len (1524), transport_up(0))
E (3238) serial: Failed to write data

E (3239) serial_if: Failed to write TX data

CORRUPT HEAP: Bad head at 0x4ff2997c. Expected 0xabba1234 got 0x4ff160d4

assert failed: multi_heap_free multi_heap_poisoning.c:279 (head != NULL)

When calling esp_hosted_init() on a Host that has no Slave or with wrong IO config, it will return ESP_OK, but following communication will cause exception:

sdio_mempool_create free:561412 min-free:561412 lfb-def:385012 lfb-8bit:385012

[   679][V][WiFiGeneric.cpp:324] wifiHostedInit(): ESP-HOSTED initialized!
E (2120) sdmmc_common: sdmmc_init_ocr: send_op_cond (1) returned 0x107
E (2120) sdio_wrapper: sdmmc_card_init failed
E (4690) H_SDIO_DRV: sdio card init failed

FreeRTOS: FreeRTOS Task "sdio_read" should not return, Aborting now!
Core  0 register dump:

There is no way to query the Host version or the Slave chip model at the moment

Error logs or terminal output

Steps to reproduce the behavior

  1. Try OTA with HTTPS URL
  2. Call esp_hosted_get_coprocessor_fwversion() right after esp_hosted_init()
  3. Call esp_hosted_init() with wrong pins or no actual Slave and call any other hosted API after that

Project release version

2.0.13

System architecture

ARM 64-bit (Apple M1/M2, Raspberry Pi 4/5)

Operating system

MacOS

Operating system version

15.5

Shell

Bash

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions