Skip to content

Commit

Permalink
[Chef] Fix compile -a doesn't work on ESP32
Browse files Browse the repository at this point in the history
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
  • Loading branch information
erwinpan1 committed Apr 14, 2023
1 parent faf548c commit 62183b6
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
7 changes: 4 additions & 3 deletions examples/chef/chef.py
Original file line number Diff line number Diff line change
Expand Up @@ -595,7 +595,7 @@ def main() -> int:
#

if options.do_build:
sw_ver_string = ""
sw_ver_string = "v1.0"

if options.do_automated_test_stamp:
branch = ""
Expand All @@ -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
1 change: 1 addition & 0 deletions examples/chef/esp32/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ if(NOT ${CONFIG_DEVICE_PRODUCT_NAME} STREQUAL "")
endif()
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 62183b6

Please sign in to comment.