Skip to content

chore(build): update sdkconfig to 5.5.3 and guard c5 firmware embedde…#21

Merged
anarchyysm merged 10 commits intoHighCodeh:devfrom
Ghost64847:fix/p4-c5-firmware-link-guard
Mar 22, 2026
Merged

chore(build): update sdkconfig to 5.5.3 and guard c5 firmware embedde…#21
anarchyysm merged 10 commits intoHighCodeh:devfrom
Ghost64847:fix/p4-c5-firmware-link-guard

Conversation

@Ghost64847
Copy link
Copy Markdown

@Ghost64847 Ghost64847 commented Mar 22, 2026

Summary

  1. C5 firmware embedding is now gated by C5_FIRMWARE_EMBEDDED in components/Service/CMakeLists.txt
  2. c5_flasher uses #if C5_FIRMWARE_EMBEDDED to avoid _binary_TentacleOS_C5_bin_start/_end undefined references and returns ESP_ERR_NOT_FOUND when absent
  3. sdkconfig upgraded to ESP-IDF 5.5.3

Validation

  • ESP-IDF build succeeds (TentacleOS_P4.bin generated)
  • Missing C5 bin now disables update path only; does not break main app link

Copilot AI review requested due to automatic review settings March 22, 2026 08:03
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Updates the ESP-IDF project configuration to v5.5.3 and makes embedding the C5 firmware binary optional, avoiding link errors when the C5 .bin isn’t present.

Changes:

  • Bump firmware_p4 sdkconfig metadata/options to ESP-IDF 5.5.3 generated settings.
  • Conditionally declare/use embedded C5 firmware symbols behind a build-time flag.
  • Add CMake logic to define C5_FIRMWARE_EMBEDDED based on whether the C5 binary exists and is embedded.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 4 comments.

File Description
firmware_p4/sdkconfig Regenerated configuration for ESP-IDF 5.5.3, including notable hardware revision and CPU frequency changes.
firmware_p4/components/Service/c5_flasher/c5_flasher.c Guards embedded firmware symbol references and adds a runtime error path when not embedded.
firmware_p4/components/Service/CMakeLists.txt Adds embed detection and propagates C5_FIRMWARE_EMBEDDED as a compile definition.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +1482 to +1483
CONFIG_ESP_DEFAULT_CPU_FREQ_MHZ_400=y
CONFIG_ESP_DEFAULT_CPU_FREQ_MHZ=400
Copy link

Copilot AI Mar 22, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The default CPU frequency is changed from 360 MHz to 400 MHz in this generated sdkconfig. This has power/thermal implications and may require re-validating timing-sensitive peripherals and power budgets; please confirm this is intentional for the target hardware.

Copilot uses AI. Check for mistakes.
# Embed C5 Firmware Binary into Service component (used by c5_flasher)
set(C5_BIN_PATH "${CMAKE_SOURCE_DIR}/../firmware_c5/build/TentacleOS_C5.bin")
set(C5_FIRMWARE_EMBEDDED 0)
if(EXISTS ${C5_BIN_PATH})
Copy link

Copilot AI Mar 22, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if(EXISTS ${C5_BIN_PATH}) should quote the path (if(EXISTS "${C5_BIN_PATH}")) to avoid mis-parsing when the source dir path contains spaces or special characters. This is a common CMake footgun and can cause the embed step to be skipped unexpectedly.

Suggested change
if(EXISTS ${C5_BIN_PATH})
if(EXISTS "${C5_BIN_PATH}")

Copilot uses AI. Check for mistakes.
Comment on lines +113 to +114
ESP_LOGE(TAG, "Embedded C5 firmware is unavailable");
return ESP_ERR_NOT_FOUND;
Copy link

Copilot AI Mar 22, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When bin_data is NULL and the firmware binary wasn't embedded, this now returns ESP_ERR_NOT_FOUND. In the current codebase bridge_manager_init() treats any non-OK as a hard failure (and the CMake warning claims the feature is “disabled”), so this can cause startup failures on builds that don't have the C5 .bin present. Consider making callers explicitly guard on C5_FIRMWARE_EMBEDDED / handle ESP_ERR_NOT_FOUND, or change the behavior to align with “disabled” semantics (e.g., a no-op with a distinct return code that callers treat as non-fatal).

Suggested change
ESP_LOGE(TAG, "Embedded C5 firmware is unavailable");
return ESP_ERR_NOT_FOUND;
ESP_LOGW(TAG, "C5 firmware update skipped: embedded firmware is unavailable and no external binary was provided");
return ESP_OK;

Copilot uses AI. Check for mistakes.
Comment on lines +1257 to +1261
# CONFIG_ESP32P4_SELECTS_REV_LESS_V3 is not set
# CONFIG_ESP32P4_REV_MIN_300 is not set
CONFIG_ESP32P4_REV_MIN_301=y
CONFIG_ESP32P4_REV_MIN_FULL=301
CONFIG_ESP_REV_MIN_FULL=301
Copy link

Copilot AI Mar 22, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This sdkconfig update bumps the minimum supported ESP32-P4 revision to v3.01 (CONFIG_ESP32P4_REV_MIN_301=y). If the product still needs to run on rev <3.0 silicon, this will prevent boot / build-time compatibility. Please confirm the hardware fleet requirement, or adjust the revision selection options accordingly.

Suggested change
# CONFIG_ESP32P4_SELECTS_REV_LESS_V3 is not set
# CONFIG_ESP32P4_REV_MIN_300 is not set
CONFIG_ESP32P4_REV_MIN_301=y
CONFIG_ESP32P4_REV_MIN_FULL=301
CONFIG_ESP_REV_MIN_FULL=301
CONFIG_ESP32P4_SELECTS_REV_LESS_V3=y
# CONFIG_ESP32P4_REV_MIN_300 is not set
# CONFIG_ESP32P4_REV_MIN_301 is not set
CONFIG_ESP32P4_REV_MIN_FULL=0
CONFIG_ESP_REV_MIN_FULL=0

Copilot uses AI. Check for mistakes.
@anarchyysm anarchyysm changed the base branch from main to dev March 22, 2026 12:55
@anarchyysm anarchyysm merged commit cd72cdf into HighCodeh:dev Mar 22, 2026
5 of 6 checks passed
@anarchyysm
Copy link
Copy Markdown
Member

thank you buddy, i only changed the branch😁😁

@Ghost64847
Copy link
Copy Markdown
Author

能为本项目做出贡献,我感到很高兴。
I am pleased to be able to contribute to this project.

@Ghost64847 Ghost64847 deleted the fix/p4-c5-firmware-link-guard branch March 22, 2026 16:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants