- Notifications
You must be signed in to change notification settings - Fork 7.8k
feat(hosted): Implement OTA for esp-hosted co-processors #12065
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
👋 Hello me-no-dev, we appreciate your contribution to this project! 📘 Please review the project's Contributions Guide for key guidelines on code, documentation, testing, and more. 🖊️ Please also make sure you have read and signed the Contributor License Agreement for this project. Click to see more instructions ...
Review and merge process you can expect ...
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR introduces a new ESP_HostedOTA library that enables over-the-air firmware updates for ESP-Hosted co-processors on ESP32 Arduino platforms. The implementation includes HTTP-based firmware download, robust error handling, and improved initialization checks in the underlying hosted update functions.
Key changes:
- New
ESP_HostedOTAlibrary with theupdateEspHostedSlave()function for managing OTA updates - Enhanced error handling with initialization checks across all update-related functions
- Improved logging and state management in
hostedInit()andhostedActivateUpdate()
Reviewed changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
| libraries/ESP_HostedOTA/src/ESP_HostedOTA.h | Declares the main OTA update function |
| libraries/ESP_HostedOTA/src/ESP_HostedOTA.cpp | Implements OTA update logic with HTTP download and firmware write operations |
| libraries/ESP_HostedOTA/library.properties | Library metadata and configuration |
| libraries/ESP_HostedOTA/keywords.txt | Syntax highlighting definitions |
| libraries/ESP_HostedOTA/examples/ESP_HostedOTA/ESP_HostedOTA.ino | Example demonstrating WiFi connection and OTA update |
| cores/esp32/esp32-hal-hosted.c | Adds initialization checks, improves error handling, and version-aware activation logic |
Comments suppressed due to low confidence (1)
cores/esp32/esp32-hal-hosted.c:191
- The hosted_initialized flag is set to true before any initialization steps are attempted. If esp_hosted_sdio_set_config() fails at line 200-203 or esp_hosted_init() fails at line 205-209, the function returns false but doesn't reset hosted_initialized back to false, leaving it in an inconsistent state. Move this assignment after all initialization steps succeed, or ensure it's set to false on all error paths.
hosted_initialized = true; 💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
You can also share your feedback on Copilot code review for a chance to win a $100 gift card. Take the survey.
Test Results 76 files 76 suites 16m 13s ⏱️ For more details on these failures, see this check. Results for commit 5ebe76d. ♻️ This comment has been updated with latest results. |
Memory usage test (comparing PR against master branch)The table below shows the summary of memory usage change (decrease - increase) in bytes and percentage for each target.
Click to expand the detailed deltas report [usage change in BYTES]
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Does hosted require a specific partition layout, or is this something that should happen at every boot? |
The co-processor already has the proper partition layout flashed to it. Code only updates the app. |
This pull request introduces the new
ESP_HostedOTAlibrary for ESP32 Arduino platforms, enabling over-the-air (OTA) updates for the ESP-Hosted co-processor. It adds a complete implementation, example usage, and improves reliability and error handling in the underlying hosted update functions.New ESP_HostedOTA Library:
Added the
ESP_HostedOTAlibrary with metadata (library.properties), keyword highlighting (keywords.txt), and implementation files (ESP_HostedOTA.cpp,ESP_HostedOTA.h). The core functionupdateEspHostedSlave()manages the OTA update process, including network checks, error handling, and update activation. [1] [2] [3] [4]Included a usage example (
ESP_HostedOTA.ino) demonstrating WiFi connection and triggering the OTA update, with instructions for user configuration.Reliability and Error Handling Improvements:
Updated
esp32-hal-hosted.cto check initialization before performing update operations, logging errors and returning false if not initialized. This prevents invalid update attempts and improves robustness. [1] [2] [3] [4] [5]Enhanced initialization and connection logic in
hostedInit()to provide detailed error messages and ensure proper state management during setup and reinitialization.Minor Codebase Updates:
Added missing header include for
esp32-hal.hto ensure proper compilation.Declared
hostedInit()andhostedDeinit()functions for better code organization.