Skip to content

User controlled initializing and deinitializing (EHM-51) #48

@renzenicolai

Description

@renzenicolai

Feature description

Firmware that makes use of patched esp-hosted demonstrating the use case: https://github.com/Nicolai-Electronics/tanmatsu-launcher/

For my application I would like to be able to recover from situations where the slave ESP32 radio is unreachable. For this being able to test whether or not the slave ESP32 works before starting ESP-HOSTED is a must have.

Currently I have made the following changes to the version of ESP-HOSTED in my project:

  • Remove the constructor and destructor attributes from the init and deinit functions in esp_hosted_host_init.c (headers should be added to allow the user application to manually call these functions)
  • Replace the ESP_ERROR_CHECK macros in hosted_sdio_card_fn_init (sdio_wrapper.c) with return on error statements

By doing this the user can:

  • Test if the radio is working by first calling hosted_sdio_init followed by hosted_sdio_card_init
  • If this succeeds esp_hosted_host_init can be called to start WiFi

In general I would appreciate it a lot if the use of ESP_ERROR_CHECK in ESP-HOSTED could be limited to an absolute minimum. Please just return esp_err_t error codes so that the user application can handle errors gracefully.

Use cases

Detection if the radio is working so that the product can re-flash the radio module without the firmware crashing before app_main gets called.

Alternatives

No response

Additional context

If calling hosted_sdio_card_init returns an error my firmware will restart the esp32-c6 module in bootloader mode and load firmware onto it. Currently we use the serial port of the esp32-c6 for this (github.com/badgeteam/esp32-component-esptool).

If possible we would like to re-flash the esp32-c6 module via sdio but no documentation for the sdio bootloader protocol is currently available. If possible we would like to receive such information so that we can implement a component for flashing the esp32-c6 via sdio instead of serial.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions