Skip to content

Commit

Permalink
[Chef] Fix compile -a doesn't work on ESP32 (#26095)
Browse files Browse the repository at this point in the history
* [Chef] Fix compile -a doesn't work on ESP32

with `chef.py --automated_test_stamp` we can assign timestamp as
software version string when compiling chef sample device. However, this
failed on ESP32. On ESP32, I found that it uses PROJECT_VER to overwrite
CHIP_DEVICE_CONFIG_DEVICE_SOFTWARE_VERSION_STRING, so I set it in the esp32's
CMakeLists.txt

* chef.py set default sw_ver_string from "v1.0" to""

* Add comment in examples/chef/esp32/CMakeLists.txt
  • Loading branch information
erwinpan1 authored and pull[bot] committed Feb 27, 2024
1 parent cbe4f8a commit 1367870
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
5 changes: 3 additions & 2 deletions examples/chef/chef.py
Original file line number Diff line number Diff line change
Expand Up @@ -615,10 +615,11 @@ def main() -> int:
f"\"{truncated_sw_ver_string}\" due to 64 bytes limitation")
sw_ver_string = truncated_sw_ver_string

flush_print("Building...")

flush_print(f"Software Version String: \"{sw_ver_string}\"")
flush_print(
f"Product ID 0x{options.pid:02X} / Vendor ID 0x{options.vid:02X}")
flush_print("Building...")

shell.run_cmd(f"cd {_CHEF_SCRIPT_PATH}")

if (options.build_target == "esp32") or (options.build_target == "nrfconnect") or (options.build_target == "ameba"):
Expand Down
2 changes: 2 additions & 0 deletions examples/chef/esp32/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,10 @@ idf_build_set_property(COMPILE_OPTIONS "-DCHIP_DEVICE_CONFIG_DEVICE_PRODUCT_ID=$
if(NOT ${CONFIG_DEVICE_PRODUCT_NAME} STREQUAL "")
idf_build_set_property(COMPILE_OPTIONS "-DCHIP_DEVICE_CONFIG_DEVICE_PRODUCT_NAME=\"${CONFIG_DEVICE_PRODUCT_NAME}\"" APPEND)
endif()
# Forwarding the customized software version string to the ESP32 firmware image
if(NOT ${CHIP_DEVICE_CONFIG_DEVICE_SOFTWARE_VERSION_STRING} STREQUAL "")
idf_build_set_property(COMPILE_OPTIONS "-DCHIP_DEVICE_CONFIG_DEVICE_SOFTWARE_VERSION_STRING=\"${CHIP_DEVICE_CONFIG_DEVICE_SOFTWARE_VERSION_STRING}\"" APPEND)
set(PROJECT_VER ${CHIP_DEVICE_CONFIG_DEVICE_SOFTWARE_VERSION_STRING})
endif()
idf_build_set_property(COMPILE_OPTIONS "-DCHIP_PLATFORM_ESP32=1" APPEND)

Expand Down

0 comments on commit 1367870

Please sign in to comment.