From 56bebefd15502e9d8188a063affcbd5a90b94e4b Mon Sep 17 00:00:00 2001 From: Shubham Patil Date: Tue, 21 May 2024 19:56:23 +0530 Subject: [PATCH] chef: Fix building esp32 examples on darwin and some iram optimizations (#33529) --- examples/chef/chef.py | 17 +++++++++++++---- examples/chef/esp32/sdkconfig.defaults | 1 + examples/chef/esp32/sdkconfig_rpc.defaults | 1 + 3 files changed, 15 insertions(+), 4 deletions(-) diff --git a/examples/chef/chef.py b/examples/chef/chef.py index 816840f8584a45..d3b9fae0ec06ff 100755 --- a/examples/chef/chef.py +++ b/examples/chef/chef.py @@ -696,11 +696,20 @@ def main() -> int: if options.build_target == "esp32": shell.run_cmd(f"cd {_CHEF_SCRIPT_PATH}/esp32") if options.enable_ipv4: - shell.run_cmd( - "sed -i 's/CONFIG_DISABLE_IPV4=y/#\\ CONFIG_DISABLE_IPV4\\ is\\ not\\ set/g' sdkconfig ") + if sys.platform == "darwin": + shell.run_cmd( + "sed -i '' 's/CONFIG_DISABLE_IPV4=y/#\\ CONFIG_DISABLE_IPV4\\ is\\ not\\ set/g' sdkconfig ") + else: + shell.run_cmd( + "sed -i 's/CONFIG_DISABLE_IPV4=y/#\\ CONFIG_DISABLE_IPV4\\ is\\ not\\ set/g' sdkconfig ") else: - shell.run_cmd( - "sed -i 's/#\\ CONFIG_DISABLE_IPV4\\ is\\ not\\ set/CONFIG_DISABLE_IPV4=y/g' sdkconfig ") + if sys.platform == "darwin": + shell.run_cmd( + "sed -i '' 's/#\\ CONFIG_DISABLE_IPV4\\ is\\ not\\ set/CONFIG_DISABLE_IPV4=y/g' sdkconfig ") + else: + shell.run_cmd( + "sed -i 's/#\\ CONFIG_DISABLE_IPV4\\ is\\ not\\ set/CONFIG_DISABLE_IPV4=y/g' sdkconfig ") + shell.run_cmd("idf.py build") shell.run_cmd("idf.py build flashing_script") shell.run_cmd( diff --git a/examples/chef/esp32/sdkconfig.defaults b/examples/chef/esp32/sdkconfig.defaults index 327e0d2538f022..fc09afaa38a00a 100644 --- a/examples/chef/esp32/sdkconfig.defaults +++ b/examples/chef/esp32/sdkconfig.defaults @@ -62,6 +62,7 @@ CONFIG_MBEDTLS_HKDF_C=y # IRAM optimizations CONFIG_FREERTOS_PLACE_FUNCTIONS_INTO_FLASH=y +CONFIG_RINGBUF_PLACE_FUNCTIONS_INTO_FLASH=y # Increase LwIP IPv6 address number CONFIG_LWIP_IPV6_NUM_ADDRESSES=6 diff --git a/examples/chef/esp32/sdkconfig_rpc.defaults b/examples/chef/esp32/sdkconfig_rpc.defaults index bf2bcc8a7b7bc7..1b9f9ddc30134f 100644 --- a/examples/chef/esp32/sdkconfig_rpc.defaults +++ b/examples/chef/esp32/sdkconfig_rpc.defaults @@ -61,5 +61,6 @@ CONFIG_MBEDTLS_HKDF_C=y # IRAM optimizations CONFIG_FREERTOS_PLACE_FUNCTIONS_INTO_FLASH=y +CONFIG_RINGBUF_PLACE_FUNCTIONS_INTO_FLASH=y CONFIG_DIAG_USE_EXTERNAL_LOG_WRAP=y