From 30ca5c7a88f0e220ec0acce83ac20581c4514164 Mon Sep 17 00:00:00 2001 From: Roland Dobai Date: Fri, 26 Apr 2019 12:50:20 +0200 Subject: [PATCH 01/21] Confgen: Fix prefix removal to work for exact match only --- tools/kconfig_new/confgen.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/tools/kconfig_new/confgen.py b/tools/kconfig_new/confgen.py index 5d49c8539..68c453a86 100755 --- a/tools/kconfig_new/confgen.py +++ b/tools/kconfig_new/confgen.py @@ -58,6 +58,12 @@ class DeprecatedOptions(object): rep_dic = {} rev_rep_dic = {} + def remove_config_prefix(string): + if string.startswith(self.config_prefix): + return string[len(self.config_prefix):] + raise RuntimeError('Error in {} (line {}): Config {} is not prefixed with {}' + ''.format(rep_path, line_number, string, self.config_prefix)) + for root, dirnames, filenames in os.walk(repl_dir): for filename in fnmatch.filter(filenames, self._REN_FILE): rep_path = os.path.join(root, filename) @@ -75,7 +81,8 @@ class DeprecatedOptions(object): 'replacement {} is defined'.format(rep_path, line_number, rep_dic[sp_line[0]], sp_line[0], sp_line[1])) - (dep_opt, new_opt) = (x.lstrip(self.config_prefix) for x in sp_line) + + (dep_opt, new_opt) = (remove_config_prefix(x) for x in sp_line) rep_dic[dep_opt] = new_opt rev_rep_dic[new_opt] = dep_opt return rep_dic, rev_rep_dic From 254c1c10851e275da749c5d9cf669db7715d57b9 Mon Sep 17 00:00:00 2001 From: Roland Dobai Date: Fri, 26 Apr 2019 15:43:40 +0200 Subject: [PATCH 02/21] Confgen: link config options to parent choices in the docs --- tools/kconfig_new/confgen.py | 24 +++++++++++++++++++++--- 1 file changed, 21 insertions(+), 3 deletions(-) diff --git a/tools/kconfig_new/confgen.py b/tools/kconfig_new/confgen.py index 68c453a86..7531b7f21 100755 --- a/tools/kconfig_new/confgen.py +++ b/tools/kconfig_new/confgen.py @@ -111,13 +111,31 @@ class DeprecatedOptions(object): f_out.write(line) def append_doc(self, config, path_output): + + def option_was_written(opt): + return any(gen_kconfig_doc.node_should_write(node) for node in config.syms[opt].nodes) + if len(self.r_dic) > 0: with open(path_output, 'a') as f_o: header = 'Deprecated options and their replacements' f_o.write('{}\n{}\n\n'.format(header, '-' * len(header))) - for key in sorted(self.r_dic): - f_o.write('- {}{}: :ref:`{}{}`\n'.format(config.config_prefix, key, - config.config_prefix, self.r_dic[key])) + for dep_opt in sorted(self.r_dic): + new_opt = self.r_dic[dep_opt] + if new_opt not in config.syms or (config.syms[new_opt].choice is None and option_was_written(new_opt)): + # everything except config for a choice (no link reference for those in the docs) + f_o.write('- {}{} (:ref:`{}{}`)\n'.format(config.config_prefix, dep_opt, + config.config_prefix, new_opt)) + + if new_opt in config.named_choices: + # here are printed config options which were filtered out + syms = config.named_choices[new_opt].syms + for sym in syms: + if sym.name in self.rev_r_dic: + # only if the symbol has been renamed + dep_name = self.rev_r_dic[sym.name] + + # config options doesn't have references + f_o.write(' - {}{}\n'.format(config.config_prefix, dep_name)) def append_config(self, config, path_output): tmp_list = [] From 67e7cd8a0f660b3362bb0c7623fa0e38b89f98a4 Mon Sep 17 00:00:00 2001 From: Roland Dobai Date: Thu, 9 May 2019 15:43:07 +0200 Subject: [PATCH 03/21] tools: Kconfig checker ignores test files --- tools/check_kconfigs.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/tools/check_kconfigs.py b/tools/check_kconfigs.py index b65f68cda..bc094de03 100755 --- a/tools/check_kconfigs.py +++ b/tools/check_kconfigs.py @@ -34,6 +34,9 @@ OUTPUT_SUFFIX = '.new' IGNORE_DIRS = ( # Kconfigs from submodules need to be ignored: os.path.join('components', 'mqtt', 'esp-mqtt'), + # Test Kconfigs are also ignored + os.path.join('tools', 'ldgen', 'test', 'data'), + os.path.join('tools', 'kconfig_new', 'test'), ) SPACES_PER_INDENT = 4 From 979e1e32cbc6aba7fd3dfbde273a9df55f7a8acb Mon Sep 17 00:00:00 2001 From: Roland Dobai Date: Thu, 9 May 2019 16:14:42 +0200 Subject: [PATCH 04/21] tools: Ignore sdkconfig.rename files from the example directory --- tools/kconfig_new/confgen.py | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/tools/kconfig_new/confgen.py b/tools/kconfig_new/confgen.py index 7531b7f21..04dca5d4c 100755 --- a/tools/kconfig_new/confgen.py +++ b/tools/kconfig_new/confgen.py @@ -46,15 +46,15 @@ class DeprecatedOptions(object): _RE_DEP_OP_BEGIN = re.compile(_DEP_OP_BEGIN) _RE_DEP_OP_END = re.compile(_DEP_OP_END) - def __init__(self, config_prefix, path_rename_files): + def __init__(self, config_prefix, path_rename_files, ignore_dirs=()): self.config_prefix = config_prefix # r_dic maps deprecated options to new options; rev_r_dic maps in the opposite direction - self.r_dic, self.rev_r_dic = self._parse_replacements(path_rename_files) + self.r_dic, self.rev_r_dic = self._parse_replacements(path_rename_files, ignore_dirs) # note the '=' at the end of regex for not getting partial match of configs self._RE_CONFIG = re.compile(r'{}(\w+)='.format(self.config_prefix)) - def _parse_replacements(self, repl_dir): + def _parse_replacements(self, repl_dir, ignore_dirs): rep_dic = {} rev_rep_dic = {} @@ -68,6 +68,10 @@ class DeprecatedOptions(object): for filename in fnmatch.filter(filenames, self._REN_FILE): rep_path = os.path.join(root, filename) + if rep_path.startswith(ignore_dirs): + print('Ignoring: {}'.format(rep_path)) + continue + with open(rep_path) as f_rep: for line_number, line in enumerate(f_rep, start=1): sp_line = line.split() @@ -222,7 +226,10 @@ def main(): raise RuntimeError("Defaults file not found: %s" % name) config.load_config(name, replace=False) - deprecated_options = DeprecatedOptions(config.config_prefix, path_rename_files=os.environ["IDF_PATH"]) + # don't collect rename options from examples because those are separate projects and no need to "stay compatible" + # with example projects + deprecated_options = DeprecatedOptions(config.config_prefix, path_rename_files=os.environ["IDF_PATH"], + ignore_dirs=(os.path.join(os.environ["IDF_PATH"], 'examples'))) # If config file previously exists, load it if args.config and os.path.exists(args.config): From 1af263ebb2e7e0c6e1f4d01e4fb6bac13ee067f4 Mon Sep 17 00:00:00 2001 From: Roland Dobai Date: Tue, 14 May 2019 16:23:19 +0200 Subject: [PATCH 05/21] tools: Check syntax also of Kconfig.in files --- tools/check_kconfigs.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/check_kconfigs.py b/tools/check_kconfigs.py index bc094de03..843502cb1 100755 --- a/tools/check_kconfigs.py +++ b/tools/check_kconfigs.py @@ -23,7 +23,7 @@ import argparse from io import open # regular expression for matching Kconfig files -RE_KCONFIG = r'^Kconfig(?:\.projbuild)?$' +RE_KCONFIG = r'^Kconfig(\.projbuild)?(\.in)?$' # ouput file with suggestions will get this suffix OUTPUT_SUFFIX = '.new' From c5000c83d250896fffbddd7a3991384ea0fc286d Mon Sep 17 00:00:00 2001 From: Roland Dobai Date: Wed, 24 Apr 2019 15:02:25 +0200 Subject: [PATCH 06/21] Rename Kconfig options (root) --- CMakeLists.txt | 16 +++---- Kconfig | 46 +++++++++---------- .../asio/port/include/esp_asio_config.h | 4 +- components/asio/port/include/esp_exception.h | 4 +- components/cxx/CMakeLists.txt | 2 +- components/cxx/component.mk | 2 +- components/cxx/cxx_exception_stubs.cpp | 4 +- components/cxx/test/test_cxx.cpp | 6 +-- components/esp32/Kconfig | 2 +- components/esp32/cpu_start.c | 6 +-- components/esp32/test/test_stack_check.c | 2 +- .../esp32/test/test_stack_check_cxx.cpp | 2 +- components/esp_common/include/esp_err.h | 2 +- components/esp_common/src/stack_check.c | 2 +- components/freertos/Kconfig | 2 +- components/heap/multi_heap_platform.h | 4 +- components/newlib/platform_include/assert.h | 2 +- docs/en/api-guides/error-handling.rst | 4 +- docs/en/api-guides/fatal-errors.rst | 2 +- docs/zh_CN/api-guides/error-handling.rst | 4 +- examples/system/cpp_exceptions/README.md | 4 +- .../system/cpp_exceptions/sdkconfig.defaults | 4 +- make/project.mk | 18 ++++---- sdkconfig.rename | 25 ++++++++-- tools/check_kconfigs.py | 6 +-- tools/ldgen/samples/sdkconfig | 24 +++++----- tools/unit-test-app/configs/release | 4 +- tools/unit-test-app/sdkconfig.defaults | 6 +-- 28 files changed, 113 insertions(+), 96 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 139dce9c6..a844c0576 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -18,19 +18,19 @@ endif() list(APPEND compile_definitions "-DGCC_NOT_5_2_0=${GCC_NOT_5_2_0}") -if(CONFIG_OPTIMIZATION_LEVEL_RELEASE) +if(CONFIG_COMPILER_OPTIMIZATION_LEVEL_RELEASE) list(APPEND compile_options "-Os") else() list(APPEND compile_options "-Og") endif() -if(CONFIG_CXX_EXCEPTIONS) +if(CONFIG_COMPILER_CXX_EXCEPTIONS) list(APPEND cxx_compile_options "-fexceptions") else() list(APPEND cxx_compile_options "-fno-exceptions") endif() -if(CONFIG_DISABLE_GCC8_WARNINGS) +if(CONFIG_COMPILER_DISABLE_GCC8_WARNINGS) list(APPEND compile_options "-Wno-parentheses" "-Wno-sizeof-pointer-memaccess" "-Wno-clobbered") @@ -50,15 +50,15 @@ if(CONFIG_DISABLE_GCC8_WARNINGS) endif() endif() -if(CONFIG_OPTIMIZATION_ASSERTIONS_DISABLED) +if(CONFIG_COMPILER_OPTIMIZATION_ASSERTIONS_DISABLE) list(APPEND compile_definitions "NDEBUG") endif() -if(CONFIG_STACK_CHECK_NORM) +if(CONFIG_COMPILER_STACK_CHECK_MODE_NORM) list(APPEND compile_options "-fstack-protector") -elseif(CONFIG_STACK_CHECK_STRONG) +elseif(CONFIG_COMPILER_STACK_CHECK_MODE_STRONG) list(APPEND compile_options "-fstack-protector-strong") -elseif(CONFIG_STACK_CHECK_ALL) +elseif(CONFIG_COMPILER_STACK_CHECK_MODE_ALL) list(APPEND compile_options "-fstack-protector-all") endif() @@ -117,4 +117,4 @@ foreach(build_component ${build_components}) endif() endforeach() endif() -endforeach() \ No newline at end of file +endforeach() diff --git a/Kconfig b/Kconfig index 874bb6e9a..dd61783ab 100644 --- a/Kconfig +++ b/Kconfig @@ -60,9 +60,9 @@ mainmenu "Espressif IoT Development Framework Configuration" menu "Compiler options" - choice OPTIMIZATION_COMPILER + choice COMPILER_OPTIMIZATION prompt "Optimization Level" - default OPTIMIZATION_LEVEL_DEBUG + default COMPILER_OPTIMIZATION_LEVEL_DEBUG help This option sets compiler optimization level (gcc -O argument). @@ -76,15 +76,15 @@ mainmenu "Espressif IoT Development Framework Configuration" in project makefile, before including $(IDF_PATH)/make/project.mk. Note that custom optimization levels may be unsupported. - config OPTIMIZATION_LEVEL_DEBUG + config COMPILER_OPTIMIZATION_LEVEL_DEBUG bool "Debug (-Og)" - config OPTIMIZATION_LEVEL_RELEASE + config COMPILER_OPTIMIZATION_LEVEL_RELEASE bool "Release (-Os)" endchoice - choice OPTIMIZATION_ASSERTION_LEVEL + choice COMPILER_OPTIMIZATION_ASSERTION_LEVEL prompt "Assertion level" - default OPTIMIZATION_ASSERTIONS_ENABLED + default COMPILER_OPTIMIZATION_ASSERTIONS_ENABLE help Assertions can be: @@ -96,20 +96,20 @@ mainmenu "Espressif IoT Development Framework Configuration" - Disabled entirely (not recommended for most configurations.) -DNDEBUG is added to CPPFLAGS in this case. - config OPTIMIZATION_ASSERTIONS_ENABLED + config COMPILER_OPTIMIZATION_ASSERTIONS_ENABLE prompt "Enabled" bool help Enable assertions. Assertion content and line number will be printed on failure. - config OPTIMIZATION_ASSERTIONS_SILENT + config COMPILER_OPTIMIZATION_ASSERTIONS_SILENT prompt "Silent (saves code size)" bool help Enable silent assertions. Failed assertions will abort(), user needs to use the aborting address to find the line number with the failed assertion. - config OPTIMIZATION_ASSERTIONS_DISABLED + config COMPILER_OPTIMIZATION_ASSERTIONS_DISABLE prompt "Disabled (sets -DNDEBUG)" bool help @@ -117,7 +117,7 @@ mainmenu "Espressif IoT Development Framework Configuration" endchoice # assertions - menuconfig CXX_EXCEPTIONS + menuconfig COMPILER_CXX_EXCEPTIONS bool "Enable C++ exceptions" default n help @@ -129,17 +129,17 @@ mainmenu "Espressif IoT Development Framework Configuration" Enabling this option currently adds an additional ~500 bytes of heap overhead when an exception is thrown in user code for the first time. - config CXX_EXCEPTIONS_EMG_POOL_SIZE + config COMPILER_CXX_EXCEPTIONS_EMG_POOL_SIZE int "Emergency Pool Size" default 0 - depends on CXX_EXCEPTIONS + depends on COMPILER_CXX_EXCEPTIONS help Size (in bytes) of the emergency memory pool for C++ exceptions. This pool will be used to allocate memory for thrown exceptions when there is not enough memory on the heap. - choice STACK_CHECK_MODE + choice COMPILER_STACK_CHECK_MODE prompt "Stack smashing protection mode" - default STACK_CHECK_NONE + default COMPILER_STACK_CHECK_MODE_NONE help Stack smashing protection mode. Emit extra code to check for buffer overflows, such as stack smashing attacks. This is done by adding a guard variable to functions with vulnerable objects. @@ -162,23 +162,23 @@ mainmenu "Espressif IoT Development Framework Configuration" - coverage: NORMAL < STRONG < OVERALL - config STACK_CHECK_NONE + config COMPILER_STACK_CHECK_MODE_NONE bool "None" - config STACK_CHECK_NORM + config COMPILER_STACK_CHECK_MODE_NORM bool "Normal" - config STACK_CHECK_STRONG + config COMPILER_STACK_CHECK_MODE_STRONG bool "Strong" - config STACK_CHECK_ALL + config COMPILER_STACK_CHECK_MODE_ALL bool "Overall" endchoice - config STACK_CHECK + config COMPILER_STACK_CHECK bool - default !STACK_CHECK_NONE + default !COMPILER_STACK_CHECK_MODE_NONE help Stack smashing protection. - config WARN_WRITE_STRINGS + config COMPILER_WARN_WRITE_STRINGS bool "Enable -Wwrite-strings warning flag" default "n" help @@ -192,7 +192,7 @@ mainmenu "Espressif IoT Development Framework Configuration" For C++, this warns about the deprecated conversion from string literals to ``char *``. - config DISABLE_GCC8_WARNINGS + config COMPILER_DISABLE_GCC8_WARNINGS bool "Disable new warnings introduced in GCC 6 - 8" default "n" help @@ -223,4 +223,4 @@ mainmenu "Espressif IoT Development Framework Configuration" You can still include these headers in a legacy way until it is totally deprecated by enable this option. - endmenu #Compatibility options \ No newline at end of file + endmenu #Compatibility options diff --git a/components/asio/port/include/esp_asio_config.h b/components/asio/port/include/esp_asio_config.h index accccad0d..f8617fcc9 100644 --- a/components/asio/port/include/esp_asio_config.h +++ b/components/asio/port/include/esp_asio_config.h @@ -18,9 +18,9 @@ // Enabling exceptions only when they are enabled in menuconfig // # include -# ifndef CONFIG_CXX_EXCEPTIONS +# ifndef CONFIG_COMPILER_CXX_EXCEPTIONS # define ASIO_NO_EXCEPTIONS -# endif // CONFIG_CXX_EXCEPTIONS +# endif // CONFIG_COMPILER_CXX_EXCEPTIONS // // LWIP compatifility inet and address macros/functions diff --git a/components/asio/port/include/esp_exception.h b/components/asio/port/include/esp_exception.h index 3c5c04375..a4a316013 100644 --- a/components/asio/port/include/esp_exception.h +++ b/components/asio/port/include/esp_exception.h @@ -18,7 +18,7 @@ // // This exception stub is enabled only if exceptions are disabled in menuconfig // -#if !defined(CONFIG_CXX_EXCEPTIONS) && defined (ASIO_NO_EXCEPTIONS) +#if !defined(CONFIG_COMPILER_CXX_EXCEPTIONS) && defined (ASIO_NO_EXCEPTIONS) #include "esp_log.h" @@ -34,6 +34,6 @@ void throw_exception(const Exception& e) abort(); } }} -#endif // CONFIG_CXX_EXCEPTIONS==1 && defined (ASIO_NO_EXCEPTIONS) +#endif // CONFIG_COMPILER_CXX_EXCEPTIONS==1 && defined (ASIO_NO_EXCEPTIONS) #endif // _ESP_EXCEPTION_H_ diff --git a/components/cxx/CMakeLists.txt b/components/cxx/CMakeLists.txt index 0d9b14f13..cb5609d2a 100644 --- a/components/cxx/CMakeLists.txt +++ b/components/cxx/CMakeLists.txt @@ -5,6 +5,6 @@ register_component() target_link_libraries(${COMPONENT_LIB} stdc++) target_link_libraries(${COMPONENT_LIB} "-u __cxa_guard_dummy") -if(NOT CONFIG_CXX_EXCEPTIONS) +if(NOT CONFIG_COMPILER_CXX_EXCEPTIONS) target_link_libraries(${COMPONENT_LIB} "-u __cxx_fatal_exception") endif() diff --git a/components/cxx/component.mk b/components/cxx/component.mk index 7d819675a..a5d6e55cc 100644 --- a/components/cxx/component.mk +++ b/components/cxx/component.mk @@ -2,7 +2,7 @@ # is taken from cxx_guards.o instead of libstdc++.a COMPONENT_ADD_LDFLAGS += -u __cxa_guard_dummy -ifndef CONFIG_CXX_EXCEPTIONS +ifndef CONFIG_COMPILER_CXX_EXCEPTIONS # If exceptions are disabled, ensure our fatal exception # hooks are preferentially linked over libstdc++ which # has full exception support diff --git a/components/cxx/cxx_exception_stubs.cpp b/components/cxx/cxx_exception_stubs.cpp index f09f946dd..858ed0bfc 100644 --- a/components/cxx/cxx_exception_stubs.cpp +++ b/components/cxx/cxx_exception_stubs.cpp @@ -4,7 +4,7 @@ #include #include -#ifndef CONFIG_CXX_EXCEPTIONS +#ifndef CONFIG_COMPILER_CXX_EXCEPTIONS const char *FATAL_EXCEPTION = "Fatal C++ exception: "; @@ -81,4 +81,4 @@ extern "C" void __cxa_call_terminate(void) __attribute__((alias("__cxx_fatal_exc bool std::uncaught_exception() __attribute__((alias("__cxx_fatal_exception_bool"))); -#endif // CONFIG_CXX_EXCEPTIONS +#endif // CONFIG_COMPILER_CXX_EXCEPTIONS diff --git a/components/cxx/test/test_cxx.cpp b/components/cxx/test/test_cxx.cpp index 3ba121ca5..0f5cce331 100644 --- a/components/cxx/test/test_cxx.cpp +++ b/components/cxx/test/test_cxx.cpp @@ -196,7 +196,7 @@ TEST_CASE("before scheduler has started, static initializers work correctly", "[ TEST_ASSERT_EQUAL(2, StaticInitTestBeforeScheduler::order); } -#ifdef CONFIG_CXX_EXCEPTIONS +#ifdef CONFIG_COMPILER_CXX_EXCEPTIONS TEST_CASE("c++ exceptions work", "[cxx]") { @@ -259,7 +259,7 @@ TEST_CASE("c++ exceptions emergency pool", "[cxx] [ignore]") thrown_value = e; printf("Got exception %d\n", thrown_value); } -#if CONFIG_CXX_EXCEPTIONS_EMG_POOL_SIZE > 0 +#if CONFIG_COMPILER_CXX_EXCEPTIONS_EMG_POOL_SIZE > 0 // free all memory while (pprev) { p = (void **)(*pprev); @@ -274,7 +274,7 @@ TEST_CASE("c++ exceptions emergency pool", "[cxx] [ignore]") #endif } -#else // !CONFIG_CXX_EXCEPTIONS +#else // !CONFIG_COMPILER_CXX_EXCEPTIONS TEST_CASE("std::out_of_range exception when -fno-exceptions", "[cxx][reset=abort,SW_CPU_RESET]") { diff --git a/components/esp32/Kconfig b/components/esp32/Kconfig index d9de4fd30..b22c73940 100644 --- a/components/esp32/Kconfig +++ b/components/esp32/Kconfig @@ -570,7 +570,7 @@ menu "ESP32-specific" config ESP32_DEBUG_STUBS_ENABLE bool "OpenOCD debug stubs" - default OPTIMIZATION_LEVEL_DEBUG + default COMPILER_OPTIMIZATION_LEVEL_DEBUG depends on !ESP32_TRAX help Debug stubs are used by OpenOCD to execute pre-compiled onboard code which does some useful debugging, diff --git a/components/esp32/cpu_start.c b/components/esp32/cpu_start.c index d7fe6141f..ed701a1a7 100644 --- a/components/esp32/cpu_start.c +++ b/components/esp32/cpu_start.c @@ -454,16 +454,16 @@ void start_cpu1_default(void) } #endif //!CONFIG_FREERTOS_UNICORE -#ifdef CONFIG_CXX_EXCEPTIONS +#ifdef CONFIG_COMPILER_CXX_EXCEPTIONS size_t __cxx_eh_arena_size_get() { - return CONFIG_CXX_EXCEPTIONS_EMG_POOL_SIZE; + return CONFIG_COMPILER_CXX_EXCEPTIONS_EMG_POOL_SIZE; } #endif static void do_global_ctors(void) { -#ifdef CONFIG_CXX_EXCEPTIONS +#ifdef CONFIG_COMPILER_CXX_EXCEPTIONS static struct object ob; __register_frame_info( __eh_frame, &ob ); #endif diff --git a/components/esp32/test/test_stack_check.c b/components/esp32/test/test_stack_check.c index 5dc9062c5..0fa6c7bfe 100644 --- a/components/esp32/test/test_stack_check.c +++ b/components/esp32/test/test_stack_check.c @@ -1,6 +1,6 @@ #include "unity.h" -#if CONFIG_STACK_CHECK +#if CONFIG_COMPILER_STACK_CHECK static void recur_and_smash() { diff --git a/components/esp32/test/test_stack_check_cxx.cpp b/components/esp32/test/test_stack_check_cxx.cpp index 5c2c489e7..cb6e5a770 100644 --- a/components/esp32/test/test_stack_check_cxx.cpp +++ b/components/esp32/test/test_stack_check_cxx.cpp @@ -1,6 +1,6 @@ #include "unity.h" -#if CONFIG_STACK_CHECK +#if CONFIG_COMPILER_STACK_CHECK static void recur_and_smash_cxx() { diff --git a/components/esp_common/include/esp_err.h b/components/esp_common/include/esp_err.h index 794f32e1e..c46ae3837 100644 --- a/components/esp_common/include/esp_err.h +++ b/components/esp_common/include/esp_err.h @@ -105,7 +105,7 @@ void _esp_error_check_failed_without_abort(esp_err_t rc, const char *file, int l esp_err_t __err_rc = (x); \ (void) sizeof(__err_rc); \ } while(0) -#elif defined(CONFIG_OPTIMIZATION_ASSERTIONS_SILENT) +#elif defined(CONFIG_COMPILER_OPTIMIZATION_ASSERTIONS_SILENT) #define ESP_ERROR_CHECK(x) do { \ esp_err_t __err_rc = (x); \ if (__err_rc != ESP_OK) { \ diff --git a/components/esp_common/src/stack_check.c b/components/esp_common/src/stack_check.c index f79b50a6c..d22102a47 100644 --- a/components/esp_common/src/stack_check.c +++ b/components/esp_common/src/stack_check.c @@ -15,7 +15,7 @@ #include "sdkconfig.h" #include "esp_system.h" -#if CONFIG_STACK_CHECK +#if CONFIG_COMPILER_STACK_CHECK #define LOG_LOCAL_LEVEL CONFIG_LOG_DEFAULT_LEVEL #include "esp_log.h" diff --git a/components/freertos/Kconfig b/components/freertos/Kconfig index 777ca7b60..343fc89ac 100644 --- a/components/freertos/Kconfig +++ b/components/freertos/Kconfig @@ -410,7 +410,7 @@ menu "FreeRTOS" config FREERTOS_TASK_FUNCTION_WRAPPER bool "Enclose all task functions in a wrapper function" - depends on OPTIMIZATION_LEVEL_DEBUG + depends on COMPILER_OPTIMIZATION_LEVEL_DEBUG default y help If enabled, all FreeRTOS task functions will be enclosed in a wrapper function. diff --git a/components/heap/multi_heap_platform.h b/components/heap/multi_heap_platform.h index 7ff1f00ae..a3a0acc67 100644 --- a/components/heap/multi_heap_platform.h +++ b/components/heap/multi_heap_platform.h @@ -48,9 +48,9 @@ inline static void multi_heap_assert(bool condition, const char *format, int lin */ #ifndef NDEBUG if(!condition) { -#ifndef CONFIG_OPTIMIZATION_ASSERTIONS_SILENT +#ifndef CONFIG_COMPILER_OPTIMIZATION_ASSERTIONS_SILENT ets_printf(format, line, address); -#endif // CONFIG_OPTIMIZATION_ASSERTIONS_SILENT +#endif // CONFIG_COMPILER_OPTIMIZATION_ASSERTIONS_SILENT abort(); } #else // NDEBUG diff --git a/components/newlib/platform_include/assert.h b/components/newlib/platform_include/assert.h index afbea986e..356872721 100644 --- a/components/newlib/platform_include/assert.h +++ b/components/newlib/platform_include/assert.h @@ -22,7 +22,7 @@ #include_next -#if defined(CONFIG_OPTIMIZATION_ASSERTIONS_SILENT) && !defined(NDEBUG) +#if defined(CONFIG_COMPILER_OPTIMIZATION_ASSERTIONS_SILENT) && !defined(NDEBUG) #undef assert #define assert(__e) ((__e) ? (void)0 : abort()) #endif diff --git a/docs/en/api-guides/error-handling.rst b/docs/en/api-guides/error-handling.rst index 8c470d2bc..d465a414c 100644 --- a/docs/en/api-guides/error-handling.rst +++ b/docs/en/api-guides/error-handling.rst @@ -114,9 +114,9 @@ Error handling patterns C++ Exceptions -------------- -Support for C++ Exceptions in ESP-IDF is disabled by default, but can be enabled using :ref:`CONFIG_CXX_EXCEPTIONS` option. +Support for C++ Exceptions in ESP-IDF is disabled by default, but can be enabled using :ref:`CONFIG_COMPILER_CXX_EXCEPTIONS` option. -Enabling exception handling normally increases application binary size by a few kB. Additionally it may be necessary to reserve some amount of RAM for exception emergency pool. Memory from this pool will be used if it is not possible to allocate exception object from the heap. Amount of memory in the emergency pool can be set using :ref:`CONFIG_CXX_EXCEPTIONS_EMG_POOL_SIZE` variable. +Enabling exception handling normally increases application binary size by a few kB. Additionally it may be necessary to reserve some amount of RAM for exception emergency pool. Memory from this pool will be used if it is not possible to allocate exception object from the heap. Amount of memory in the emergency pool can be set using :ref:`CONFIG_COMPILER_CXX_EXCEPTIONS_EMG_POOL_SIZE` variable. If an exception is thrown, but there is no ``catch`` block, the program will be terminated by ``abort`` function, and backtrace will be printed. See :doc:`Fatal Errors ` for more information about backtraces. diff --git a/docs/en/api-guides/fatal-errors.rst b/docs/en/api-guides/fatal-errors.rst index 3cea89c88..06883edb5 100644 --- a/docs/en/api-guides/fatal-errors.rst +++ b/docs/en/api-guides/fatal-errors.rst @@ -283,7 +283,7 @@ Consult :doc:`Heap Memory Debugging <../api-reference/system/heap_debug>` docume Stack Smashing ^^^^^^^^^^^^^^ -Stack smashing protection (based on GCC ``-fstack-protector*`` flags) can be enabled in ESP-IDF using :ref:`CONFIG_STACK_CHECK_MODE` option. If stack smashing is detected, message similar to the following will be printed:: +Stack smashing protection (based on GCC ``-fstack-protector*`` flags) can be enabled in ESP-IDF using :ref:`CONFIG_COMPILER_STACK_CHECK_MODE` option. If stack smashing is detected, message similar to the following will be printed:: Stack smashing protect failure! diff --git a/docs/zh_CN/api-guides/error-handling.rst b/docs/zh_CN/api-guides/error-handling.rst index 40ac8c1db..025d3695a 100644 --- a/docs/zh_CN/api-guides/error-handling.rst +++ b/docs/zh_CN/api-guides/error-handling.rst @@ -126,8 +126,8 @@ ESP-IDF 中大多数函数会返回 :cpp:type:`esp_err_t` 类型的错误码, C++ 异常 -------- -默认情况下,ESP-IDF 会禁用对 C++ 异常的支持,但是可以通过 :ref:`CONFIG_CXX_EXCEPTIONS` 选项启用。 +默认情况下,ESP-IDF 会禁用对 C++ 异常的支持,但是可以通过 :ref:`CONFIG_COMPILER_CXX_EXCEPTIONS` 选项启用。 -通常情况下,启用异常处理会让应用程序的二进制文件增加几 kB。此外,启用该功能时还应为异常事故池预留一定内存。当应用程序无法从堆中分配异常对象时,就可以使用这个池中的内存。该内存池的大小可以通过 :ref:`CONFIG_CXX_EXCEPTIONS_EMG_POOL_SIZE` 来设定。 +通常情况下,启用异常处理会让应用程序的二进制文件增加几 kB。此外,启用该功能时还应为异常事故池预留一定内存。当应用程序无法从堆中分配异常对象时,就可以使用这个池中的内存。该内存池的大小可以通过 :ref:`CONFIG_COMPILER_CXX_EXCEPTIONS_EMG_POOL_SIZE` 来设定。 如果 C++ 程序抛出了异常,但是程序中并没有 ``catch`` 代码块来捕获该异常,那么程序的运行就会被 ``abort`` 函数中止,然后打印回溯信息。有关回溯的更多信息,请参阅 :doc:`不可恢复错误 ` 。 diff --git a/examples/system/cpp_exceptions/README.md b/examples/system/cpp_exceptions/README.md index 0ff49f352..2056379ed 100644 --- a/examples/system/cpp_exceptions/README.md +++ b/examples/system/cpp_exceptions/README.md @@ -4,9 +4,9 @@ This example demonstrates usage of C++ exceptions in ESP-IDF. -By default, C++ exceptions support is disabled in ESP-IDF. It can be enabled using `CONFIG_CXX_EXCEPTIONS` configuration option. +By default, C++ exceptions support is disabled in ESP-IDF. It can be enabled using `CONFIG_COMPILER_CXX_EXCEPTIONS` configuration option. -In this example, `sdkconfig.defaults` file sets `CONFIG_CXX_EXCEPTIONS` option. This enables both compile time support (`-fexceptions` compiler flag) and run-time support for C++ exception handling. +In this example, `sdkconfig.defaults` file sets `CONFIG_COMPILER_CXX_EXCEPTIONS` option. This enables both compile time support (`-fexceptions` compiler flag) and run-time support for C++ exception handling. Example source code declares a class which can throw exception from the constructor, depending on the argument. It illustrates that exceptions can be thrown and caught using standard C++ facilities. diff --git a/examples/system/cpp_exceptions/sdkconfig.defaults b/examples/system/cpp_exceptions/sdkconfig.defaults index e9d7fca37..a365ac658 100644 --- a/examples/system/cpp_exceptions/sdkconfig.defaults +++ b/examples/system/cpp_exceptions/sdkconfig.defaults @@ -1,3 +1,3 @@ # Enable C++ exceptions and set emergency pool size for exception objects -CONFIG_CXX_EXCEPTIONS=y -CONFIG_CXX_EXCEPTIONS_EMG_POOL_SIZE=1024 +CONFIG_COMPILER_CXX_EXCEPTIONS=y +CONFIG_COMPILER_CXX_EXCEPTIONS_EMG_POOL_SIZE=1024 diff --git a/make/project.mk b/make/project.mk index 2f1def70d..449badb20 100644 --- a/make/project.mk +++ b/make/project.mk @@ -375,7 +375,7 @@ COMMON_WARNING_FLAGS = -Wall -Werror=all \ -Wextra \ -Wno-unused-parameter -Wno-sign-compare -ifdef CONFIG_DISABLE_GCC8_WARNINGS +ifdef CONFIG_COMPILER_DISABLE_GCC8_WARNINGS COMMON_WARNING_FLAGS += -Wno-parentheses \ -Wno-sizeof-pointer-memaccess \ -Wno-clobbered \ @@ -391,9 +391,9 @@ COMMON_WARNING_FLAGS += -Wno-parentheses \ -Wno-int-in-bool-context endif -ifdef CONFIG_WARN_WRITE_STRINGS +ifdef CONFIG_COMPILER_WARN_WRITE_STRINGS COMMON_WARNING_FLAGS += -Wwrite-strings -endif #CONFIG_WARN_WRITE_STRINGS +endif #CONFIG_COMPILER_WARN_WRITE_STRINGS # Flags which control code generation and dependency generation, both for C and C++ COMMON_FLAGS = \ @@ -405,25 +405,25 @@ COMMON_FLAGS = \ ifndef IS_BOOTLOADER_BUILD # stack protection (only one option can be selected in menuconfig) -ifdef CONFIG_STACK_CHECK_NORM +ifdef CONFIG_COMPILER_STACK_CHECK_MODE_NORM COMMON_FLAGS += -fstack-protector endif -ifdef CONFIG_STACK_CHECK_STRONG +ifdef CONFIG_COMPILER_STACK_CHECK_MODE_STRONG COMMON_FLAGS += -fstack-protector-strong endif -ifdef CONFIG_STACK_CHECK_ALL +ifdef CONFIG_COMPILER_STACK_CHECK_MODE_ALL COMMON_FLAGS += -fstack-protector-all endif endif # Optimization flags are set based on menuconfig choice -ifdef CONFIG_OPTIMIZATION_LEVEL_RELEASE +ifdef CONFIG_COMPILER_OPTIMIZATION_LEVEL_RELEASE OPTIMIZATION_FLAGS = -Os else OPTIMIZATION_FLAGS = -Og endif -ifdef CONFIG_OPTIMIZATION_ASSERTIONS_DISABLED +ifdef CONFIG_COMPILER_OPTIMIZATION_ASSERTIONS_DISABLE CPPFLAGS += -DNDEBUG endif @@ -459,7 +459,7 @@ CXXFLAGS := $(strip \ $(CXXFLAGS) \ $(EXTRA_CXXFLAGS)) -ifdef CONFIG_CXX_EXCEPTIONS +ifdef CONFIG_COMPILER_CXX_EXCEPTIONS CXXFLAGS += -fexceptions else CXXFLAGS += -fno-exceptions diff --git a/sdkconfig.rename b/sdkconfig.rename index c2f45861c..6ff0f5747 100644 --- a/sdkconfig.rename +++ b/sdkconfig.rename @@ -2,6 +2,25 @@ # CONFIG_DEPRECATED_OPTION CONFIG_NEW_OPTION # SDK tool configuration -CONFIG_TOOLPREFIX CONFIG_SDK_TOOLPREFIX -CONFIG_PYTHON CONFIG_SDK_PYTHON -CONFIG_MAKE_WARN_UNDEFINED_VARIABLES CONFIG_SDK_MAKE_WARN_UNDEFINED_VARIABLES +CONFIG_TOOLPREFIX CONFIG_SDK_TOOLPREFIX +CONFIG_PYTHON CONFIG_SDK_PYTHON +CONFIG_MAKE_WARN_UNDEFINED_VARIABLES CONFIG_SDK_MAKE_WARN_UNDEFINED_VARIABLES + +# Compiler options +CONFIG_OPTIMIZATION_COMPILER CONFIG_COMPILER_OPTIMIZATION +CONFIG_OPTIMIZATION_LEVEL_DEBUG CONFIG_COMPILER_OPTIMIZATION_LEVEL_DEBUG +CONFIG_OPTIMIZATION_LEVEL_RELEASE CONFIG_COMPILER_OPTIMIZATION_LEVEL_RELEASE +CONFIG_OPTIMIZATION_ASSERTION_LEVEL CONFIG_COMPILER_OPTIMIZATION_ASSERTION_LEVEL +CONFIG_OPTIMIZATION_ASSERTIONS_ENABLED CONFIG_COMPILER_OPTIMIZATION_ASSERTIONS_ENABLE +CONFIG_OPTIMIZATION_ASSERTIONS_SILENT CONFIG_COMPILER_OPTIMIZATION_ASSERTIONS_SILENT +CONFIG_OPTIMIZATION_ASSERTIONS_DISABLED CONFIG_COMPILER_OPTIMIZATION_ASSERTIONS_DISABLE +CONFIG_CXX_EXCEPTIONS CONFIG_COMPILER_CXX_EXCEPTIONS +CONFIG_CXX_EXCEPTIONS_EMG_POOL_SIZE CONFIG_COMPILER_CXX_EXCEPTIONS_EMG_POOL_SIZE +CONFIG_STACK_CHECK_MODE CONFIG_COMPILER_STACK_CHECK_MODE +CONFIG_STACK_CHECK_NONE CONFIG_COMPILER_STACK_CHECK_MODE_NONE +CONFIG_STACK_CHECK_NORM CONFIG_COMPILER_STACK_CHECK_MODE_NORM +CONFIG_STACK_CHECK_STRONG CONFIG_COMPILER_STACK_CHECK_MODE_STRONG +CONFIG_STACK_CHECK_ALL CONFIG_COMPILER_STACK_CHECK_MODE_ALL +CONFIG_STACK_CHECK CONFIG_COMPILER_STACK_CHECK +CONFIG_WARN_WRITE_STRINGS CONFIG_COMPILER_WARN_WRITE_STRINGS +CONFIG_DISABLE_GCC8_WARNINGS CONFIG_COMPILER_DISABLE_GCC8_WARNINGS diff --git a/tools/check_kconfigs.py b/tools/check_kconfigs.py index 843502cb1..05f0168cd 100755 --- a/tools/check_kconfigs.py +++ b/tools/check_kconfigs.py @@ -41,11 +41,9 @@ IGNORE_DIRS = ( SPACES_PER_INDENT = 4 -# TODO decrease the value (after the names have been refactored) -CONFIG_NAME_MAX_LENGTH = 60 +CONFIG_NAME_MAX_LENGTH = 40 -# TODO increase prefix length (after the names have been refactored) -CONFIG_NAME_MIN_PREFIX_LENGTH = 0 +CONFIG_NAME_MIN_PREFIX_LENGTH = 4 # The checker will not fail if it encounters this string (it can be used for temporarily resolve conflicts) RE_NOERROR = re.compile(r'\s+#\s+NOERROR\s+$') diff --git a/tools/ldgen/samples/sdkconfig b/tools/ldgen/samples/sdkconfig index 4c3c94b97..d5b44b6a4 100644 --- a/tools/ldgen/samples/sdkconfig +++ b/tools/ldgen/samples/sdkconfig @@ -84,18 +84,18 @@ CONFIG_PARTITION_TABLE_MD5=y # # Compiler options # -CONFIG_OPTIMIZATION_LEVEL_DEBUG=y -CONFIG_OPTIMIZATION_LEVEL_RELEASE= -CONFIG_OPTIMIZATION_ASSERTIONS_ENABLED=y -CONFIG_OPTIMIZATION_ASSERTIONS_SILENT= -CONFIG_OPTIMIZATION_ASSERTIONS_DISABLED= -CONFIG_CXX_EXCEPTIONS= -CONFIG_STACK_CHECK_NONE=y -CONFIG_STACK_CHECK_NORM= -CONFIG_STACK_CHECK_STRONG= -CONFIG_STACK_CHECK_ALL= -CONFIG_STACK_CHECK= -CONFIG_WARN_WRITE_STRINGS= +CONFIG_COMPILER_OPTIMIZATION_LEVEL_DEBUG=y +CONFIG_COMPILER_OPTIMIZATION_LEVEL_RELEASE= +CONFIG_COMPILER_OPTIMIZATION_ASSERTIONS_ENABLE=y +CONFIG_COMPILER_OPTIMIZATION_ASSERTIONS_SILENT= +CONFIG_COMPILER_OPTIMIZATION_ASSERTIONS_DISABLE= +CONFIG_COMPILER_CXX_EXCEPTIONS= +CONFIG_COMPILER_STACK_CHECK_MODE_NONE=y +CONFIG_COMPILER_STACK_CHECK_MODE_NORM= +CONFIG_COMPILER_STACK_CHECK_MODE_STRONG= +CONFIG_COMPILER_STACK_CHECK_MODE_ALL= +CONFIG_COMPILER_STACK_CHECK= +CONFIG_COMPILER_WARN_WRITE_STRINGS= # # Component config diff --git a/tools/unit-test-app/configs/release b/tools/unit-test-app/configs/release index 86fbc9a49..d58d94997 100644 --- a/tools/unit-test-app/configs/release +++ b/tools/unit-test-app/configs/release @@ -1,3 +1,3 @@ TEST_EXCLUDE_COMPONENTS=bt app_update -CONFIG_OPTIMIZATION_LEVEL_RELEASE=y -CONFIG_OPTIMIZATION_ASSERTIONS_SILENT=y \ No newline at end of file +CONFIG_COMPILER_OPTIMIZATION_LEVEL_RELEASE=y +CONFIG_COMPILER_OPTIMIZATION_ASSERTIONS_SILENT=y diff --git a/tools/unit-test-app/sdkconfig.defaults b/tools/unit-test-app/sdkconfig.defaults index afaf11031..4efe0e264 100644 --- a/tools/unit-test-app/sdkconfig.defaults +++ b/tools/unit-test-app/sdkconfig.defaults @@ -21,12 +21,12 @@ CONFIG_ULP_COPROC_ENABLED=y CONFIG_TASK_WDT=n CONFIG_SPI_FLASH_WRITING_DANGEROUS_REGIONS_FAILS=y CONFIG_FREERTOS_QUEUE_REGISTRY_SIZE=7 -CONFIG_STACK_CHECK_STRONG=y -CONFIG_STACK_CHECK=y +CONFIG_COMPILER_STACK_CHECK_MODE_STRONG=y +CONFIG_COMPILER_STACK_CHECK=y CONFIG_SUPPORT_STATIC_ALLOCATION=y CONFIG_ESP_TIMER_PROFILING=y CONFIG_ADC2_DISABLE_DAC=n -CONFIG_WARN_WRITE_STRINGS=y +CONFIG_COMPILER_WARN_WRITE_STRINGS=y CONFIG_SPI_MASTER_IN_IRAM=y CONFIG_EFUSE_VIRTUAL=y CONFIG_SPIRAM_BANKSWITCH_ENABLE=n From 64c2aa15aa28f71b407f2f2faa25b468197c321f Mon Sep 17 00:00:00 2001 From: Roland Dobai Date: Fri, 26 Apr 2019 18:12:35 +0200 Subject: [PATCH 07/21] Rename Kconfig options (components/freertos) --- components/esp32/Kconfig | 2 +- components/freertos/Kconfig | 12 ++++++------ .../freertos/include/freertos/FreeRTOSConfig.h | 10 +++++----- components/freertos/sdkconfig.rename | 8 ++++++++ components/pthread/CMakeLists.txt | 2 +- components/pthread/component.mk | 2 +- components/pthread/pthread_local_storage.c | 6 +++--- docs/en/api-guides/freertos-smp.rst | 4 ++-- tools/ldgen/samples/sdkconfig | 8 ++++---- tools/unit-test-app/sdkconfig.defaults | 2 +- 10 files changed, 32 insertions(+), 24 deletions(-) create mode 100644 components/freertos/sdkconfig.rename diff --git a/components/esp32/Kconfig b/components/esp32/Kconfig index b22c73940..643f241de 100644 --- a/components/esp32/Kconfig +++ b/components/esp32/Kconfig @@ -68,7 +68,7 @@ menu "ESP32-specific" bool "Make RAM allocatable using heap_caps_malloc(..., MALLOC_CAP_SPIRAM)" config SPIRAM_USE_MALLOC bool "Make RAM allocatable using malloc() as well" - select SUPPORT_STATIC_ALLOCATION + select FREERTOS_SUPPORT_STATIC_ALLOCATION endchoice choice SPIRAM_TYPE diff --git a/components/freertos/Kconfig b/components/freertos/Kconfig index 343fc89ac..9aaebdae5 100644 --- a/components/freertos/Kconfig +++ b/components/freertos/Kconfig @@ -192,7 +192,7 @@ menu "FreeRTOS" For most uses, the default of 16 is OK. - config SUPPORT_STATIC_ALLOCATION + config FREERTOS_SUPPORT_STATIC_ALLOCATION bool "Enable FreeRTOS static allocation API" default n help @@ -220,9 +220,9 @@ menu "FreeRTOS" applications that simply don't allow any dynamic memory allocation (although FreeRTOS includes allocation schemes that can overcome most objections). - config ENABLE_STATIC_TASK_CLEAN_UP_HOOK + config FREERTOS_ENABLE_STATIC_TASK_CLEAN_UP bool "Enable static task clean up hook" - depends on SUPPORT_STATIC_ALLOCATION + depends on FREERTOS_SUPPORT_STATIC_ALLOCATION default n help Enable this option to make FreeRTOS call the static task clean up hook when a task is deleted. @@ -233,7 +233,7 @@ menu "FreeRTOS" // place clean up code here } - config TIMER_TASK_PRIORITY + config FREERTOS_TIMER_TASK_PRIORITY int "FreeRTOS timer task priority" range 1 25 default 1 @@ -244,7 +244,7 @@ menu "FreeRTOS" Use this constant to define the priority that the timer task will run at. - config TIMER_TASK_STACK_DEPTH + config FREERTOS_TIMER_TASK_STACK_DEPTH int "FreeRTOS timer task stack size" range 1536 32768 default 2048 @@ -255,7 +255,7 @@ menu "FreeRTOS" Use this constant to define the size (in bytes) of the stack allocated for the timer task. - config TIMER_QUEUE_LENGTH + config FREERTOS_TIMER_QUEUE_LENGTH int "FreeRTOS timer queue length" range 5 20 default 10 diff --git a/components/freertos/include/freertos/FreeRTOSConfig.h b/components/freertos/include/freertos/FreeRTOSConfig.h index 931264bf6..bd3c72db5 100644 --- a/components/freertos/include/freertos/FreeRTOSConfig.h +++ b/components/freertos/include/freertos/FreeRTOSConfig.h @@ -272,10 +272,10 @@ int xt_clock_freq(void) __attribute__((deprecated)); #define configUSE_NEWLIB_REENTRANT 1 #define configSUPPORT_DYNAMIC_ALLOCATION 1 -#define configSUPPORT_STATIC_ALLOCATION CONFIG_SUPPORT_STATIC_ALLOCATION +#define configSUPPORT_STATIC_ALLOCATION CONFIG_FREERTOS_SUPPORT_STATIC_ALLOCATION #ifndef __ASSEMBLER__ -#if CONFIG_ENABLE_STATIC_TASK_CLEAN_UP_HOOK +#if CONFIG_FREERTOS_ENABLE_STATIC_TASK_CLEAN_UP extern void vPortCleanUpTCB ( void *pxTCB ); #define portCLEAN_UP_TCB( pxTCB ) vPortCleanUpTCB( pxTCB ) #endif @@ -284,9 +284,9 @@ extern void vPortCleanUpTCB ( void *pxTCB ); /* Test FreeRTOS timers (with timer task) and more. */ /* Some files don't compile if this flag is disabled */ #define configUSE_TIMERS 1 -#define configTIMER_TASK_PRIORITY CONFIG_TIMER_TASK_PRIORITY -#define configTIMER_QUEUE_LENGTH CONFIG_TIMER_QUEUE_LENGTH -#define configTIMER_TASK_STACK_DEPTH CONFIG_TIMER_TASK_STACK_DEPTH +#define configTIMER_TASK_PRIORITY CONFIG_FREERTOS_TIMER_TASK_PRIORITY +#define configTIMER_QUEUE_LENGTH CONFIG_FREERTOS_TIMER_QUEUE_LENGTH +#define configTIMER_TASK_STACK_DEPTH CONFIG_FREERTOS_TIMER_TASK_STACK_DEPTH #define INCLUDE_xTimerPendFunctionCall 1 #define INCLUDE_eTaskGetState 1 diff --git a/components/freertos/sdkconfig.rename b/components/freertos/sdkconfig.rename new file mode 100644 index 000000000..aa282d1a9 --- /dev/null +++ b/components/freertos/sdkconfig.rename @@ -0,0 +1,8 @@ +# sdkconfig replacement configurations for deprecated options formatted as +# CONFIG_DEPRECATED_OPTION CONFIG_NEW_OPTION + +CONFIG_SUPPORT_STATIC_ALLOCATION CONFIG_FREERTOS_SUPPORT_STATIC_ALLOCATION +CONFIG_ENABLE_STATIC_TASK_CLEAN_UP_HOOK CONFIG_FREERTOS_ENABLE_STATIC_TASK_CLEAN_UP +CONFIG_TIMER_TASK_PRIORITY CONFIG_FREERTOS_TIMER_TASK_PRIORITY +CONFIG_TIMER_TASK_STACK_DEPTH CONFIG_FREERTOS_TIMER_TASK_STACK_DEPTH +CONFIG_TIMER_QUEUE_LENGTH CONFIG_FREERTOS_TIMER_QUEUE_LENGTH diff --git a/components/pthread/CMakeLists.txt b/components/pthread/CMakeLists.txt index cf727293f..5c8bc04a0 100644 --- a/components/pthread/CMakeLists.txt +++ b/components/pthread/CMakeLists.txt @@ -4,6 +4,6 @@ set(COMPONENT_SRCS "pthread.c" set(COMPONENT_ADD_INCLUDEDIRS "include") register_component() -if(CONFIG_ENABLE_STATIC_TASK_CLEAN_UP_HOOK) +if(CONFIG_FREERTOS_ENABLE_STATIC_TASK_CLEAN_UP) target_link_libraries(${COMPONENT_LIB} "-Wl,--wrap=vPortCleanUpTCB") endif() diff --git a/components/pthread/component.mk b/components/pthread/component.mk index 0dd239481..9c3eececf 100644 --- a/components/pthread/component.mk +++ b/components/pthread/component.mk @@ -8,6 +8,6 @@ COMPONENT_ADD_INCLUDEDIRS := include COMPONENT_ADD_LDFLAGS := -lpthread -ifdef CONFIG_ENABLE_STATIC_TASK_CLEAN_UP_HOOK +ifdef CONFIG_FREERTOS_ENABLE_STATIC_TASK_CLEAN_UP COMPONENT_ADD_LDFLAGS += -Wl,--wrap=vPortCleanUpTCB endif diff --git a/components/pthread/pthread_local_storage.c b/components/pthread/pthread_local_storage.c index 06445542d..5e2dbafd2 100644 --- a/components/pthread/pthread_local_storage.c +++ b/components/pthread/pthread_local_storage.c @@ -142,7 +142,7 @@ static void pthread_local_storage_thread_deleted_callback(int index, void *v_tls free(tls); } -#if defined(CONFIG_ENABLE_STATIC_TASK_CLEAN_UP_HOOK) +#if defined(CONFIG_FREERTOS_ENABLE_STATIC_TASK_CLEAN_UP) /* Called from FreeRTOS task delete hook */ void pthread_local_storage_cleanup(TaskHandle_t task) { @@ -174,7 +174,7 @@ void pthread_internal_local_storage_destructor_callback() /* remove the thread-local-storage pointer to avoid the idle task cleanup calling it again... */ -#if defined(CONFIG_ENABLE_STATIC_TASK_CLEAN_UP_HOOK) +#if defined(CONFIG_FREERTOS_ENABLE_STATIC_TASK_CLEAN_UP) vTaskSetThreadLocalStoragePointer(NULL, PTHREAD_TLS_INDEX, NULL); #else vTaskSetThreadLocalStoragePointerAndDelCallback(NULL, @@ -223,7 +223,7 @@ int pthread_setspecific(pthread_key_t key, const void *value) if (tls == NULL) { return ENOMEM; } -#if defined(CONFIG_ENABLE_STATIC_TASK_CLEAN_UP_HOOK) +#if defined(CONFIG_FREERTOS_ENABLE_STATIC_TASK_CLEAN_UP) vTaskSetThreadLocalStoragePointer(NULL, PTHREAD_TLS_INDEX, tls); #else vTaskSetThreadLocalStoragePointerAndDelCallback(NULL, diff --git a/docs/en/api-guides/freertos-smp.rst b/docs/en/api-guides/freertos-smp.rst index 5e765a00a..51752170b 100644 --- a/docs/en/api-guides/freertos-smp.rst +++ b/docs/en/api-guides/freertos-smp.rst @@ -89,7 +89,7 @@ Static Alocation ^^^^^^^^^^^^^^^^^ This feature has been backported from FreeRTOS v9.0.0 to ESP-IDF. The -:ref:`CONFIG_SUPPORT_STATIC_ALLOCATION` option must be enabled in `menuconfig` +:ref:`CONFIG_FREERTOS_SUPPORT_STATIC_ALLOCATION` option must be enabled in `menuconfig` in order for static allocation functions to be available. Once enabled, the following functions can be called... @@ -494,7 +494,7 @@ occurences of ``CONFIG_FREERTOS_UNICORE`` in the ESP-IDF components. number of Thread Local Storage Pointers each task will have in ESP-IDF FreeRTOS. -:ref:`CONFIG_SUPPORT_STATIC_ALLOCATION` will enable the backported +:ref:`CONFIG_FREERTOS_SUPPORT_STATIC_ALLOCATION` will enable the backported functionality of :cpp:func:`xTaskCreateStaticPinnedToCore` in ESP-IDF FreeRTOS :ref:`CONFIG_FREERTOS_ASSERT_ON_UNTESTED_FUNCTION` will trigger a halt in diff --git a/tools/ldgen/samples/sdkconfig b/tools/ldgen/samples/sdkconfig index d5b44b6a4..d9582a84c 100644 --- a/tools/ldgen/samples/sdkconfig +++ b/tools/ldgen/samples/sdkconfig @@ -302,10 +302,10 @@ CONFIG_FREERTOS_IDLE_TASK_STACKSIZE=1024 CONFIG_FREERTOS_ISR_STACKSIZE=1536 CONFIG_FREERTOS_LEGACY_HOOKS= CONFIG_FREERTOS_MAX_TASK_NAME_LEN=16 -CONFIG_SUPPORT_STATIC_ALLOCATION= -CONFIG_TIMER_TASK_PRIORITY=1 -CONFIG_TIMER_TASK_STACK_DEPTH=2048 -CONFIG_TIMER_QUEUE_LENGTH=10 +CONFIG_FREERTOS_SUPPORT_STATIC_ALLOCATION= +CONFIG_FREERTOS_TIMER_TASK_PRIORITY=1 +CONFIG_FREERTOS_TIMER_TASK_STACK_DEPTH=2048 +CONFIG_FREERTOS_TIMER_QUEUE_LENGTH=10 CONFIG_FREERTOS_QUEUE_REGISTRY_SIZE=0 CONFIG_FREERTOS_USE_TRACE_FACILITY= CONFIG_FREERTOS_GENERATE_RUN_TIME_STATS= diff --git a/tools/unit-test-app/sdkconfig.defaults b/tools/unit-test-app/sdkconfig.defaults index 4efe0e264..371c08bb0 100644 --- a/tools/unit-test-app/sdkconfig.defaults +++ b/tools/unit-test-app/sdkconfig.defaults @@ -23,7 +23,7 @@ CONFIG_SPI_FLASH_WRITING_DANGEROUS_REGIONS_FAILS=y CONFIG_FREERTOS_QUEUE_REGISTRY_SIZE=7 CONFIG_COMPILER_STACK_CHECK_MODE_STRONG=y CONFIG_COMPILER_STACK_CHECK=y -CONFIG_SUPPORT_STATIC_ALLOCATION=y +CONFIG_FREERTOS_SUPPORT_STATIC_ALLOCATION=y CONFIG_ESP_TIMER_PROFILING=y CONFIG_ADC2_DISABLE_DAC=n CONFIG_COMPILER_WARN_WRITE_STRINGS=y From 976d2a4b7fe5d175f003c455d66bbd629e513b51 Mon Sep 17 00:00:00 2001 From: Roland Dobai Date: Fri, 26 Apr 2019 18:47:21 +0200 Subject: [PATCH 08/21] Rename Kconfig options (components/freemodbus) --- components/freemodbus/Kconfig | 34 +++++++++---------- .../freemodbus/common/esp_modbus_slave.c | 8 ++--- .../common/include/esp_modbus_common.h | 4 +-- components/freemodbus/common/mbc_slave.h | 4 +-- .../freemodbus/modbus/include/mbconfig.h | 6 ++-- components/freemodbus/port/portevent.c | 2 +- components/freemodbus/port/portserial.c | 8 ++--- components/freemodbus/port/portserial_m.c | 8 ++--- components/freemodbus/port/porttimer.c | 14 ++++---- components/freemodbus/port/porttimer_m.c | 4 +-- components/freemodbus/sdkconfig.rename | 18 ++++++++++ .../modbus_controller/mbc_serial_slave.c | 2 +- .../modbus_controller/mbc_serial_slave.h | 4 +-- docs/en/api-reference/protocols/modbus.rst | 2 +- .../modbus_master/sdkconfig.defaults | 12 +++---- .../protocols/modbus_slave/sdkconfig.defaults | 2 +- 16 files changed, 75 insertions(+), 57 deletions(-) create mode 100644 components/freemodbus/sdkconfig.rename diff --git a/components/freemodbus/Kconfig b/components/freemodbus/Kconfig index a0ac5f882..113202d12 100644 --- a/components/freemodbus/Kconfig +++ b/components/freemodbus/Kconfig @@ -1,6 +1,6 @@ menu "Modbus configuration" - config MB_MASTER_TIMEOUT_MS_RESPOND + config FMB_MASTER_TIMEOUT_MS_RESPOND int "Slave respond timeout (Milliseconds)" default 150 range 50 400 @@ -9,7 +9,7 @@ menu "Modbus configuration" If master sends a frame which is not broadcast, it has to wait sometime for slave response. if slave is not respond in this time, the master will process timeout error. - config MB_MASTER_DELAY_MS_CONVERT + config FMB_MASTER_DELAY_MS_CONVERT int "Slave conversion delay (Milliseconds)" default 200 range 50 400 @@ -18,7 +18,7 @@ menu "Modbus configuration" If master sends a broadcast frame, it has to wait conversion time to delay, then master can send next frame. - config MB_QUEUE_LENGTH + config FMB_QUEUE_LENGTH int "Modbus serial task queue length" range 0 200 default 20 @@ -26,7 +26,7 @@ menu "Modbus configuration" Modbus serial driver queue length. It is used by event queue task. See the serial driver API for more information. - config MB_SERIAL_TASK_STACK_SIZE + config FMB_SERIAL_TASK_STACK_SIZE int "Modbus serial task stack size" range 768 8192 default 2048 @@ -34,7 +34,7 @@ menu "Modbus configuration" Modbus serial task stack size for event queue task. It may be adjusted when debugging is enabled (for example). - config MB_SERIAL_BUF_SIZE + config FMB_SERIAL_BUF_SIZE int "Modbus serial task RX/TX buffer size" range 0 2048 default 256 @@ -43,33 +43,33 @@ menu "Modbus configuration" This buffer is used for modbus frame transfer. The Modbus protocol maximum frame size is 256 bytes. Bigger size can be used for non standard implementations. - config MB_SERIAL_TASK_PRIO + config FMB_SERIAL_TASK_PRIO int "Modbus serial task priority" range 3 10 default 10 help Modbus UART driver event task priority. - The priority of Modbus controller task is equal to (CONFIG_MB_SERIAL_TASK_PRIO - 1). + The priority of Modbus controller task is equal to (CONFIG_FMB_SERIAL_TASK_PRIO - 1). - config MB_CONTROLLER_SLAVE_ID_SUPPORT + config FMB_CONTROLLER_SLAVE_ID_SUPPORT bool "Modbus controller slave ID support" default n help Modbus slave ID support enable. When enabled the Modbus command is supported by stack. - config MB_CONTROLLER_SLAVE_ID + config FMB_CONTROLLER_SLAVE_ID hex "Modbus controller slave ID" range 0 4294967295 default 0x00112233 - depends on MB_CONTROLLER_SLAVE_ID_SUPPORT + depends on FMB_CONTROLLER_SLAVE_ID_SUPPORT help Modbus slave ID value to identify modbus device in the network using command. Most significant byte of ID is used as short device ID and other three bytes used as long ID. - config MB_CONTROLLER_NOTIFY_TIMEOUT + config FMB_CONTROLLER_NOTIFY_TIMEOUT int "Modbus controller notification timeout (ms)" range 0 200 default 20 @@ -77,7 +77,7 @@ menu "Modbus configuration" Modbus controller notification timeout in milliseconds. This timeout is used to send notification about accessed parameters. - config MB_CONTROLLER_NOTIFY_QUEUE_SIZE + config FMB_CONTROLLER_NOTIFY_QUEUE_SIZE int "Modbus controller notification queue size" range 0 200 default 20 @@ -85,7 +85,7 @@ menu "Modbus configuration" Modbus controller notification queue size. The notification queue is used to get information about accessed parameters. - config MB_CONTROLLER_STACK_SIZE + config FMB_CONTROLLER_STACK_SIZE int "Modbus controller stack size" range 0 8192 default 4096 @@ -93,7 +93,7 @@ menu "Modbus configuration" Modbus controller task stack size. The Stack size may be adjusted when debug mode is used which requires more stack size (for example). - config MB_EVENT_QUEUE_TIMEOUT + config FMB_EVENT_QUEUE_TIMEOUT int "Modbus stack event queue timeout (ms)" range 0 500 default 20 @@ -101,21 +101,21 @@ menu "Modbus configuration" Modbus stack event queue timeout in milliseconds. This may help to optimize Modbus stack event processing time. - config MB_TIMER_PORT_ENABLED + config FMB_TIMER_PORT_ENABLED bool "Modbus slave stack use timer for 3.5T symbol time measurement" default y help If this option is set the Modbus stack uses timer for T3.5 time measurement. Else the internal UART TOUT timeout is used for 3.5T symbol time measurement. - config MB_TIMER_GROUP + config FMB_TIMER_GROUP int "Modbus Timer group number" range 0 1 default 0 help Modbus Timer group number that is used for timeout measurement. - config MB_TIMER_INDEX + config FMB_TIMER_INDEX int "Modbus Timer index in the group" range 0 1 default 0 diff --git a/components/freemodbus/common/esp_modbus_slave.c b/components/freemodbus/common/esp_modbus_slave.c index ad173c0e8..8883a98f2 100644 --- a/components/freemodbus/common/esp_modbus_slave.c +++ b/components/freemodbus/common/esp_modbus_slave.c @@ -21,14 +21,14 @@ #include "esp_modbus_callbacks.h" // for modbus callbacks function pointers declaration #include "mbc_serial_slave.h" // for create function of serial port -#ifdef CONFIG_MB_CONTROLLER_SLAVE_ID_SUPPORT +#ifdef CONFIG_FMB_CONTROLLER_SLAVE_ID_SUPPORT #define MB_ID_BYTE0(id) ((uint8_t)(id)) #define MB_ID_BYTE1(id) ((uint8_t)(((uint16_t)(id) >> 8) & 0xFF)) #define MB_ID_BYTE2(id) ((uint8_t)(((uint32_t)(id) >> 16) & 0xFF)) #define MB_ID_BYTE3(id) ((uint8_t)(((uint32_t)(id) >> 24) & 0xFF)) -#define MB_CONTROLLER_SLAVE_ID (CONFIG_MB_CONTROLLER_SLAVE_ID) +#define MB_CONTROLLER_SLAVE_ID (CONFIG_FMB_CONTROLLER_SLAVE_ID) #define MB_SLAVE_ID_SHORT (MB_ID_BYTE3(MB_CONTROLLER_SLAVE_ID)) // Slave ID constant @@ -127,7 +127,7 @@ esp_err_t mbc_slave_start() MB_SLAVE_CHECK((slave_interface_ptr->start != NULL), ESP_ERR_INVALID_STATE, "Slave interface is not correctly initialized."); -#ifdef CONFIG_MB_CONTROLLER_SLAVE_ID_SUPPORT +#ifdef CONFIG_FMB_CONTROLLER_SLAVE_ID_SUPPORT // Set the slave ID if the KConfig option is selected eMBErrorCode status = eMBSetSlaveID(MB_SLAVE_ID_SHORT, TRUE, (UCHAR*)mb_slave_id, sizeof(mb_slave_id)); MB_SLAVE_CHECK((status == MB_ENOERR), ESP_ERR_INVALID_STATE, "mb stack set slave ID failure."); @@ -252,4 +252,4 @@ eMBErrorCode eMBRegInputCB(UCHAR * pucRegBuffer, USHORT usAddress, "Slave interface is not correctly initialized."); error = slave_interface_ptr->slave_reg_cb_input(pucRegBuffer, usAddress, usNRegs); return error; -} \ No newline at end of file +} diff --git a/components/freemodbus/common/include/esp_modbus_common.h b/components/freemodbus/common/include/esp_modbus_common.h index d24cb2938..7bec02476 100644 --- a/components/freemodbus/common/include/esp_modbus_common.h +++ b/components/freemodbus/common/include/esp_modbus_common.h @@ -18,8 +18,8 @@ #include "driver/uart.h" // for UART types -#define MB_CONTROLLER_STACK_SIZE (CONFIG_MB_CONTROLLER_STACK_SIZE) // Stack size for Modbus controller -#define MB_CONTROLLER_PRIORITY (CONFIG_MB_SERIAL_TASK_PRIO - 1) // priority of MB controller task +#define MB_CONTROLLER_STACK_SIZE (CONFIG_FMB_CONTROLLER_STACK_SIZE) // Stack size for Modbus controller +#define MB_CONTROLLER_PRIORITY (CONFIG_FMB_SERIAL_TASK_PRIO - 1) // priority of MB controller task // Default port defines #define MB_DEVICE_ADDRESS (1) // Default slave device address in Modbus diff --git a/components/freemodbus/common/mbc_slave.h b/components/freemodbus/common/mbc_slave.h index 360547044..1565da1a7 100644 --- a/components/freemodbus/common/mbc_slave.h +++ b/components/freemodbus/common/mbc_slave.h @@ -26,8 +26,8 @@ #define MB_INST_MIN_SIZE (2) // The minimal size of Modbus registers area in bytes #define MB_INST_MAX_SIZE (65535 * 2) // The maximum size of Modbus area in bytes -#define MB_CONTROLLER_NOTIFY_QUEUE_SIZE (CONFIG_MB_CONTROLLER_NOTIFY_QUEUE_SIZE) // Number of messages in parameter notification queue -#define MB_CONTROLLER_NOTIFY_TIMEOUT (pdMS_TO_TICKS(CONFIG_MB_CONTROLLER_NOTIFY_TIMEOUT)) // notification timeout +#define MB_CONTROLLER_NOTIFY_QUEUE_SIZE (CONFIG_FMB_CONTROLLER_NOTIFY_QUEUE_SIZE) // Number of messages in parameter notification queue +#define MB_CONTROLLER_NOTIFY_TIMEOUT (pdMS_TO_TICKS(CONFIG_FMB_CONTROLLER_NOTIFY_TIMEOUT)) // notification timeout #define MB_SLAVE_TAG "MB_CONTROLLER_SLAVE" diff --git a/components/freemodbus/modbus/include/mbconfig.h b/components/freemodbus/modbus/include/mbconfig.h index 1380fc0b3..ce160d827 100644 --- a/components/freemodbus/modbus/include/mbconfig.h +++ b/components/freemodbus/modbus/include/mbconfig.h @@ -101,7 +101,7 @@ PR_BEGIN_EXTERN_C #define MB_FUNC_OTHER_REP_SLAVEID_BUF ( 32 ) /*! \brief If the Report Slave ID function should be enabled. */ -#define MB_FUNC_OTHER_REP_SLAVEID_ENABLED ( CONFIG_MB_CONTROLLER_SLAVE_ID_SUPPORT ) +#define MB_FUNC_OTHER_REP_SLAVEID_ENABLED ( CONFIG_FMB_CONTROLLER_SLAVE_ID_SUPPORT ) /*! \brief If the Read Input Registers function should be enabled. */ #define MB_FUNC_READ_INPUT_ENABLED ( 1 ) @@ -138,11 +138,11 @@ PR_BEGIN_EXTERN_C #if MB_MASTER_RTU_ENABLED || MB_MASTER_ASCII_ENABLED /*! \brief If master send a broadcast frame, the master will wait time of convert to delay, * then master can send other frame */ -#define MB_MASTER_DELAY_MS_CONVERT ( CONFIG_MB_MASTER_DELAY_MS_CONVERT ) +#define MB_MASTER_DELAY_MS_CONVERT ( CONFIG_FMB_MASTER_DELAY_MS_CONVERT ) /*! \brief If master send a frame which is not broadcast,the master will wait sometime for slave. * And if slave is not respond in this time,the master will process this timeout error. * Then master can send other frame */ -#define MB_MASTER_TIMEOUT_MS_RESPOND ( CONFIG_MB_MASTER_TIMEOUT_MS_RESPOND ) +#define MB_MASTER_TIMEOUT_MS_RESPOND ( CONFIG_FMB_MASTER_TIMEOUT_MS_RESPOND ) /*! \brief The total slaves in Modbus Master system. * \note : The slave ID must be continuous from 1.*/ #define MB_MASTER_TOTAL_SLAVE_NUM ( 247 ) diff --git a/components/freemodbus/port/portevent.c b/components/freemodbus/port/portevent.c index 247a4283d..2c6597eef 100644 --- a/components/freemodbus/port/portevent.c +++ b/components/freemodbus/port/portevent.c @@ -57,7 +57,7 @@ static xQueueHandle xQueueHdl; #define MB_EVENT_QUEUE_SIZE (1) -#define MB_EVENT_QUEUE_TIMEOUT (pdMS_TO_TICKS(CONFIG_MB_EVENT_QUEUE_TIMEOUT)) +#define MB_EVENT_QUEUE_TIMEOUT (pdMS_TO_TICKS(CONFIG_FMB_EVENT_QUEUE_TIMEOUT)) /* ----------------------- Start implementation -----------------------------*/ BOOL diff --git a/components/freemodbus/port/portserial.c b/components/freemodbus/port/portserial.c index aed86fcf5..43bc887e4 100644 --- a/components/freemodbus/port/portserial.c +++ b/components/freemodbus/port/portserial.c @@ -61,14 +61,14 @@ #define MB_UART_RTS (CONFIG_MB_UART_RTS) #define MB_BAUD_RATE_DEFAULT (115200) -#define MB_QUEUE_LENGTH (CONFIG_MB_QUEUE_LENGTH) +#define MB_QUEUE_LENGTH (CONFIG_FMB_QUEUE_LENGTH) -#define MB_SERIAL_TASK_PRIO (CONFIG_MB_SERIAL_TASK_PRIO) -#define MB_SERIAL_TASK_STACK_SIZE (CONFIG_MB_SERIAL_TASK_STACK_SIZE) +#define MB_SERIAL_TASK_PRIO (CONFIG_FMB_SERIAL_TASK_PRIO) +#define MB_SERIAL_TASK_STACK_SIZE (CONFIG_FMB_SERIAL_TASK_STACK_SIZE) #define MB_SERIAL_TOUT (3) // 3.5*8 = 28 ticks, TOUT=3 -> ~24..33 ticks // Set buffer size for transmission -#define MB_SERIAL_BUF_SIZE (CONFIG_MB_SERIAL_BUF_SIZE) +#define MB_SERIAL_BUF_SIZE (CONFIG_FMB_SERIAL_BUF_SIZE) // Note: This code uses mixed coding standard from legacy IDF code and used freemodbus stack diff --git a/components/freemodbus/port/portserial_m.c b/components/freemodbus/port/portserial_m.c index c225c3003..74a4a1be0 100644 --- a/components/freemodbus/port/portserial_m.c +++ b/components/freemodbus/port/portserial_m.c @@ -54,14 +54,14 @@ /* ----------------------- Defines ------------------------------------------*/ #define MB_BAUD_RATE_DEFAULT (115200) -#define MB_QUEUE_LENGTH (CONFIG_MB_QUEUE_LENGTH) +#define MB_QUEUE_LENGTH (CONFIG_FMB_QUEUE_LENGTH) -#define MB_SERIAL_TASK_PRIO (CONFIG_MB_SERIAL_TASK_PRIO) -#define MB_SERIAL_TASK_STACK_SIZE (CONFIG_MB_SERIAL_TASK_STACK_SIZE) +#define MB_SERIAL_TASK_PRIO (CONFIG_FMB_SERIAL_TASK_PRIO) +#define MB_SERIAL_TASK_STACK_SIZE (CONFIG_FMB_SERIAL_TASK_STACK_SIZE) #define MB_SERIAL_TOUT (3) // 3.5*8 = 28 ticks, TOUT=3 -> ~24..33 ticks // Set buffer size for transmission -#define MB_SERIAL_BUF_SIZE (CONFIG_MB_SERIAL_BUF_SIZE) +#define MB_SERIAL_BUF_SIZE (CONFIG_FMB_SERIAL_BUF_SIZE) #define MB_SERIAL_TX_TOUT_MS (100) #define MB_SERIAL_TX_TOUT_TICKS pdMS_TO_TICKS(MB_SERIAL_TX_TOUT_MS) // timeout for transmission diff --git a/components/freemodbus/port/porttimer.c b/components/freemodbus/port/porttimer.c index 928e290a0..2859aa016 100644 --- a/components/freemodbus/port/porttimer.c +++ b/components/freemodbus/port/porttimer.c @@ -51,7 +51,7 @@ #include "sdkconfig.h" #include "port_serial_slave.h" -#ifdef CONFIG_MB_TIMER_PORT_ENABLED +#ifdef CONFIG_FMB_TIMER_PORT_ENABLED #define MB_US50_FREQ (20000) // 20kHz 1/20000 = 50mks #define MB_DISCR_TIME_US (50) // 50uS = one discreet for timer @@ -61,8 +61,8 @@ #define MB_TIMER_DIVIDER ((TIMER_BASE_CLK / 1000000UL) * MB_DISCR_TIME_US - 1) // divider for 50uS #define MB_TIMER_WITH_RELOAD (1) -static const USHORT usTimerIndex = CONFIG_MB_TIMER_INDEX; // Modbus Timer index used by stack -static const USHORT usTimerGroupIndex = CONFIG_MB_TIMER_GROUP; // Modbus Timer group index used by stack +static const USHORT usTimerIndex = CONFIG_FMB_TIMER_INDEX; // Modbus Timer index used by stack +static const USHORT usTimerGroupIndex = CONFIG_FMB_TIMER_GROUP; // Modbus Timer group index used by stack static timg_dev_t *MB_TG[2] = {&TIMERG0, &TIMERG1}; @@ -82,7 +82,7 @@ static void IRAM_ATTR vTimerGroupIsr(void *param) BOOL xMBPortTimersInit(USHORT usTim1Timerout50us) { -#ifdef CONFIG_MB_TIMER_PORT_ENABLED +#ifdef CONFIG_FMB_TIMER_PORT_ENABLED MB_PORT_CHECK((usTim1Timerout50us > 0), FALSE, "Modbus timeout discreet is incorrect."); esp_err_t xErr; @@ -123,7 +123,7 @@ BOOL xMBPortTimersInit(USHORT usTim1Timerout50us) void vMBPortTimersEnable() { -#ifdef CONFIG_MB_TIMER_PORT_ENABLED +#ifdef CONFIG_FMB_TIMER_PORT_ENABLED ESP_ERROR_CHECK(timer_pause(usTimerGroupIndex, usTimerIndex)); ESP_ERROR_CHECK(timer_set_counter_value(usTimerGroupIndex, usTimerIndex, 0ULL)); ESP_ERROR_CHECK(timer_enable_intr(usTimerGroupIndex, usTimerIndex)); @@ -133,7 +133,7 @@ void vMBPortTimersEnable() void vMBPortTimersDisable() { -#ifdef CONFIG_MB_TIMER_PORT_ENABLED +#ifdef CONFIG_FMB_TIMER_PORT_ENABLED ESP_ERROR_CHECK(timer_pause(usTimerGroupIndex, usTimerIndex)); ESP_ERROR_CHECK(timer_set_counter_value(usTimerGroupIndex, usTimerIndex, 0ULL)); // Disable timer interrupt @@ -143,7 +143,7 @@ void vMBPortTimersDisable() void vMBPortTimerClose() { -#ifdef CONFIG_MB_TIMER_PORT_ENABLED +#ifdef CONFIG_FMB_TIMER_PORT_ENABLED ESP_ERROR_CHECK(timer_pause(usTimerGroupIndex, usTimerIndex)); ESP_ERROR_CHECK(timer_disable_intr(usTimerGroupIndex, usTimerIndex)); #endif diff --git a/components/freemodbus/port/porttimer_m.c b/components/freemodbus/port/porttimer_m.c index 2a5bf62fc..c2b5b423c 100644 --- a/components/freemodbus/port/porttimer_m.c +++ b/components/freemodbus/port/porttimer_m.c @@ -50,8 +50,8 @@ #define MB_TIMER_WITH_RELOAD (1) // Timer group and timer number to measure time (configurable in KConfig) -#define MB_TIMER_INDEX CONFIG_MB_TIMER_INDEX -#define MB_TIMER_GROUP CONFIG_MB_TIMER_GROUP +#define MB_TIMER_INDEX CONFIG_FMB_TIMER_INDEX +#define MB_TIMER_GROUP CONFIG_FMB_TIMER_GROUP #define MB_TIMER_IO_LED 0 diff --git a/components/freemodbus/sdkconfig.rename b/components/freemodbus/sdkconfig.rename new file mode 100644 index 000000000..41e5dbeb9 --- /dev/null +++ b/components/freemodbus/sdkconfig.rename @@ -0,0 +1,18 @@ +# sdkconfig replacement configurations for deprecated options formatted as +# CONFIG_DEPRECATED_OPTION CONFIG_NEW_OPTION + +CONFIG_MB_MASTER_TIMEOUT_MS_RESPOND CONFIG_FMB_MASTER_TIMEOUT_MS_RESPOND +CONFIG_MB_MASTER_DELAY_MS_CONVERT CONFIG_FMB_MASTER_DELAY_MS_CONVERT +CONFIG_MB_QUEUE_LENGTH CONFIG_FMB_QUEUE_LENGTH +CONFIG_MB_SERIAL_TASK_STACK_SIZE CONFIG_FMB_SERIAL_TASK_STACK_SIZE +CONFIG_MB_SERIAL_BUF_SIZE CONFIG_FMB_SERIAL_BUF_SIZE +CONFIG_MB_SERIAL_TASK_PRIO CONFIG_FMB_SERIAL_TASK_PRIO +CONFIG_MB_CONTROLLER_SLAVE_ID_SUPPORT CONFIG_FMB_CONTROLLER_SLAVE_ID_SUPPORT +CONFIG_MB_CONTROLLER_SLAVE_ID CONFIG_FMB_CONTROLLER_SLAVE_ID +CONFIG_MB_CONTROLLER_NOTIFY_TIMEOUT CONFIG_FMB_CONTROLLER_NOTIFY_TIMEOUT +CONFIG_MB_CONTROLLER_NOTIFY_QUEUE_SIZE CONFIG_FMB_CONTROLLER_NOTIFY_QUEUE_SIZE +CONFIG_MB_CONTROLLER_STACK_SIZE CONFIG_FMB_CONTROLLER_STACK_SIZE +CONFIG_MB_EVENT_QUEUE_TIMEOUT CONFIG_FMB_EVENT_QUEUE_TIMEOUT +CONFIG_MB_TIMER_PORT_ENABLED CONFIG_FMB_TIMER_PORT_ENABLED +CONFIG_MB_TIMER_GROUP CONFIG_FMB_TIMER_GROUP +CONFIG_MB_TIMER_INDEX CONFIG_FMB_TIMER_INDEX diff --git a/components/freemodbus/serial_slave/modbus_controller/mbc_serial_slave.c b/components/freemodbus/serial_slave/modbus_controller/mbc_serial_slave.c index c97b4c61c..86e9616d0 100644 --- a/components/freemodbus/serial_slave/modbus_controller/mbc_serial_slave.c +++ b/components/freemodbus/serial_slave/modbus_controller/mbc_serial_slave.c @@ -95,7 +95,7 @@ static esp_err_t mbc_serial_slave_start(void) (eMBParity)mbs_opts->mbs_comm.parity); MB_SLAVE_CHECK((status == MB_ENOERR), ESP_ERR_INVALID_STATE, "mb stack initialization failure, eMBInit() returns (0x%x).", status); -#ifdef CONFIG_MB_CONTROLLER_SLAVE_ID_SUPPORT +#ifdef CONFIG_FMB_CONTROLLER_SLAVE_ID_SUPPORT status = eMBSetSlaveID(MB_SLAVE_ID_SHORT, TRUE, (UCHAR*)mb_slave_id, sizeof(mb_slave_id)); MB_SLAVE_CHECK((status == MB_ENOERR), ESP_ERR_INVALID_STATE, "mb stack set slave ID failure."); #endif diff --git a/components/freemodbus/serial_slave/modbus_controller/mbc_serial_slave.h b/components/freemodbus/serial_slave/modbus_controller/mbc_serial_slave.h index eb851e3fe..ef37ce77f 100644 --- a/components/freemodbus/serial_slave/modbus_controller/mbc_serial_slave.h +++ b/components/freemodbus/serial_slave/modbus_controller/mbc_serial_slave.h @@ -23,8 +23,8 @@ #include "esp_modbus_common.h" // for common defines /* ----------------------- Defines ------------------------------------------*/ -#define MB_CONTROLLER_NOTIFY_QUEUE_SIZE (CONFIG_MB_CONTROLLER_NOTIFY_QUEUE_SIZE) // Number of messages in parameter notification queue -#define MB_CONTROLLER_NOTIFY_TIMEOUT (pdMS_TO_TICKS(CONFIG_MB_CONTROLLER_NOTIFY_TIMEOUT)) // notification timeout +#define MB_CONTROLLER_NOTIFY_QUEUE_SIZE (CONFIG_FMB_CONTROLLER_NOTIFY_QUEUE_SIZE) // Number of messages in parameter notification queue +#define MB_CONTROLLER_NOTIFY_TIMEOUT (pdMS_TO_TICKS(CONFIG_FMB_CONTROLLER_NOTIFY_TIMEOUT)) // notification timeout /* * @brief Initialize Modbus controller and stack diff --git a/docs/en/api-reference/protocols/modbus.rst b/docs/en/api-reference/protocols/modbus.rst index 9898eacc4..b9fb8cb99 100644 --- a/docs/en/api-reference/protocols/modbus.rst +++ b/docs/en/api-reference/protocols/modbus.rst @@ -66,7 +66,7 @@ The blocking call to function waits for event specified in the input parameter a .. doxygenfunction:: mbc_slave_get_param_info -The function gets information about accessed parameters from modbus controller event queue. The KConfig 'CONFIG_MB_CONTROLLER_NOTIFY_QUEUE_SIZE' key can be used to configure the notification queue size. The timeout parameter allows to specify timeout for waiting notification. The :cpp:type:`mb_param_info_t` structure contain information about accessed parameter. +The function gets information about accessed parameters from modbus controller event queue. The KConfig 'CONFIG_FMB_CONTROLLER_NOTIFY_QUEUE_SIZE' key can be used to configure the notification queue size. The timeout parameter allows to specify timeout for waiting notification. The :cpp:type:`mb_param_info_t` structure contain information about accessed parameter. Modbus serial master interface API overview diff --git a/examples/protocols/modbus_master/sdkconfig.defaults b/examples/protocols/modbus_master/sdkconfig.defaults index 0be6a31c3..98e7ac19f 100644 --- a/examples/protocols/modbus_master/sdkconfig.defaults +++ b/examples/protocols/modbus_master/sdkconfig.defaults @@ -1,11 +1,11 @@ # # Modbus configuration # -CONFIG_MB_TIMER_PORT_ENABLED=y -CONFIG_MB_TIMER_GROUP=0 -CONFIG_MB_TIMER_INDEX=0 -CONFIG_MB_MASTER_DELAY_MS_CONVERT=200 -CONFIG_MB_MASTER_TIMEOUT_MS_RESPOND=150 +CONFIG_FMB_TIMER_PORT_ENABLED=y +CONFIG_FMB_TIMER_GROUP=0 +CONFIG_FMB_TIMER_INDEX=0 +CONFIG_FMB_MASTER_DELAY_MS_CONVERT=200 +CONFIG_FMB_MASTER_TIMEOUT_MS_RESPOND=150 CONFIG_MB_UART_RXD=22 CONFIG_MB_UART_TXD=23 -CONFIG_MB_UART_RTS=18 \ No newline at end of file +CONFIG_MB_UART_RTS=18 diff --git a/examples/protocols/modbus_slave/sdkconfig.defaults b/examples/protocols/modbus_slave/sdkconfig.defaults index f174a74a1..e79d7fa62 100644 --- a/examples/protocols/modbus_slave/sdkconfig.defaults +++ b/examples/protocols/modbus_slave/sdkconfig.defaults @@ -3,4 +3,4 @@ # CONFIG_MB_UART_RXD=22 CONFIG_MB_UART_TXD=23 -CONFIG_MB_UART_RTS=18 \ No newline at end of file +CONFIG_MB_UART_RTS=18 From bf626f2aba91a8b6df70086bc49b2f320385cb41 Mon Sep 17 00:00:00 2001 From: Roland Dobai Date: Mon, 29 Apr 2019 12:54:02 +0200 Subject: [PATCH 09/21] Rename Kconfig options (components/esp_event) --- components/esp_event/CMakeLists.txt | 4 +- components/esp_event/Kconfig | 8 ++-- components/esp_event/component.mk | 2 +- components/esp_event/default_event_loop.c | 2 +- components/esp_event/esp_event.c | 42 +++++++++---------- components/esp_event/include/esp_event.h | 14 +++---- components/esp_event/linker.lf | 4 +- .../private_include/esp_event_internal.h | 10 ++--- components/esp_event/sdkconfig.rename | 6 +++ components/esp_event/test/test_event.c | 14 +++---- docs/en/api-reference/system/esp_event.rst | 2 +- 11 files changed, 57 insertions(+), 51 deletions(-) create mode 100644 components/esp_event/sdkconfig.rename diff --git a/components/esp_event/CMakeLists.txt b/components/esp_event/CMakeLists.txt index aadbfb72a..53aff6b0a 100644 --- a/components/esp_event/CMakeLists.txt +++ b/components/esp_event/CMakeLists.txt @@ -15,7 +15,7 @@ set(COMPONENT_ADD_LDFRAGMENTS linker.lf) register_component() -if(GCC_NOT_5_2_0 AND CONFIG_EVENT_LOOP_PROFILING) +if(GCC_NOT_5_2_0 AND CONFIG_ESP_EVENT_LOOP_PROFILING) # uses C11 atomic feature set_source_files_properties(esp_event.c PROPERTIES COMPILE_FLAGS -std=gnu11) -endif() \ No newline at end of file +endif() diff --git a/components/esp_event/Kconfig b/components/esp_event/Kconfig index f90f792f2..0ad0f9065 100644 --- a/components/esp_event/Kconfig +++ b/components/esp_event/Kconfig @@ -1,6 +1,6 @@ menu "Event Loop Library" - config EVENT_LOOP_PROFILING + config ESP_EVENT_LOOP_PROFILING bool "Enable event loop profiling" default n help @@ -8,16 +8,16 @@ menu "Event Loop Library" to/recieved by an event loop, number of callbacks involved, number of events dropped to to a full event loop queue, run time of event handlers, and number of times/run time of each event handler. - config POST_EVENTS_FROM_ISR + config ESP_EVENT_POST_FROM_ISR bool "Support posting events from ISRs" default y help Enable posting events from interrupt handlers. - config POST_EVENTS_FROM_IRAM_ISR + config ESP_EVENT_POST_FROM_IRAM_ISR bool "Support posting events from ISRs placed in IRAM" default y - depends on POST_EVENTS_FROM_ISR + depends on ESP_EVENT_POST_FROM_ISR help Enable posting events from interrupt handlers placed in IRAM. Enabling this option places API functions esp_event_post and esp_event_post_to in IRAM. diff --git a/components/esp_event/component.mk b/components/esp_event/component.mk index fd3f6fa71..c59eccc41 100644 --- a/components/esp_event/component.mk +++ b/components/esp_event/component.mk @@ -5,7 +5,7 @@ COMPONENT_ADD_INCLUDEDIRS := include COMPONENT_PRIV_INCLUDEDIRS := private_include COMPONENT_SRCDIRS := . -ifdef CONFIG_EVENT_LOOP_PROFILING +ifdef CONFIG_ESP_EVENT_LOOP_PROFILING PROFILING_ENABLED := 1 else PROFILING_ENABLED := 0 diff --git a/components/esp_event/default_event_loop.c b/components/esp_event/default_event_loop.c index 9623f04d8..fa97065fb 100644 --- a/components/esp_event/default_event_loop.c +++ b/components/esp_event/default_event_loop.c @@ -55,7 +55,7 @@ esp_err_t esp_event_post(esp_event_base_t event_base, int32_t event_id, } -#if CONFIG_POST_EVENTS_FROM_ISR +#if CONFIG_ESP_EVENT_POST_FROM_ISR esp_err_t esp_event_isr_post(esp_event_base_t event_base, int32_t event_id, void* event_data, size_t event_data_size, BaseType_t* task_unblocked) { diff --git a/components/esp_event/esp_event.c b/components/esp_event/esp_event.c index d9cca3a88..e89b7e3ca 100644 --- a/components/esp_event/esp_event.c +++ b/components/esp_event/esp_event.c @@ -23,13 +23,13 @@ #include "esp_event_internal.h" #include "esp_event_private.h" -#ifdef CONFIG_EVENT_LOOP_PROFILING +#ifdef CONFIG_ESP_EVENT_LOOP_PROFILING #include "esp_timer.h" #endif /* ---------------------------- Definitions --------------------------------- */ -#ifdef CONFIG_EVENT_LOOP_PROFILING +#ifdef CONFIG_ESP_EVENT_LOOP_PROFILING // LOOP @ rx: dr: #define LOOP_DUMP_FORMAT "LOOP @%p,%s rx:%u dr:%u\n" // handler @
ev: inv: time: @@ -47,7 +47,7 @@ static const char* TAG = "event"; static const char* esp_event_any_base = "any"; -#ifdef CONFIG_EVENT_LOOP_PROFILING +#ifdef CONFIG_ESP_EVENT_LOOP_PROFILING static SLIST_HEAD(esp_event_loop_instance_list_t, esp_event_loop_instance) s_event_loops = SLIST_HEAD_INITIALIZER(s_event_loops); @@ -57,7 +57,7 @@ static portMUX_TYPE s_event_loops_spinlock = portMUX_INITIALIZER_UNLOCKED; /* ------------------------- Static Functions ------------------------------- */ -#ifdef CONFIG_EVENT_LOOP_PROFILING +#ifdef CONFIG_ESP_EVENT_LOOP_PROFILING static int esp_event_dump_prepare() @@ -126,18 +126,18 @@ static void handler_execute(esp_event_loop_instance_t* loop, esp_event_handler_i { ESP_LOGD(TAG, "running post %s:%d with handler %p on loop %p", post.base, post.id, handler->handler, loop); -#ifdef CONFIG_EVENT_LOOP_PROFILING +#ifdef CONFIG_ESP_EVENT_LOOP_PROFILING int64_t start, diff; start = esp_timer_get_time(); #endif // Execute the handler -#if CONFIG_POST_EVENTS_FROM_ISR +#if CONFIG_ESP_EVENT_POST_FROM_ISR (*(handler->handler))(handler->arg, post.base, post.id, post.data_allocd ? post.data.ptr : &post.data.val); #else (*(handler->handler))(handler->arg, post.base, post.id, post.data); #endif -#ifdef CONFIG_EVENT_LOOP_PROFILING +#ifdef CONFIG_ESP_EVENT_LOOP_PROFILING diff = esp_timer_get_time() - start; xSemaphoreTake(loop->profiling_mutex, portMAX_DELAY); @@ -379,7 +379,7 @@ static void loop_node_remove_all_handler(esp_event_loop_node_t* loop_node) static void inline __attribute__((always_inline)) post_instance_delete(esp_event_post_instance_t* post) { -#if CONFIG_POST_EVENTS_FROM_ISR +#if CONFIG_ESP_EVENT_POST_FROM_ISR if (post->data_allocd && post->data.ptr) { free(post->data.ptr); } @@ -418,7 +418,7 @@ esp_err_t esp_event_loop_create(const esp_event_loop_args_t* event_loop_args, es goto on_err; } -#ifdef CONFIG_EVENT_LOOP_PROFILING +#ifdef CONFIG_ESP_EVENT_LOOP_PROFILING loop->profiling_mutex = xSemaphoreCreateMutex(); if (loop->profiling_mutex == NULL) { ESP_LOGE(TAG, "create event loop profiling mutex failed"); @@ -450,7 +450,7 @@ esp_err_t esp_event_loop_create(const esp_event_loop_args_t* event_loop_args, es loop->running_task = NULL; -#ifdef CONFIG_EVENT_LOOP_PROFILING +#ifdef CONFIG_ESP_EVENT_LOOP_PROFILING portENTER_CRITICAL(&s_event_loops_spinlock); SLIST_INSERT_HEAD(&s_event_loops, loop, next); portEXIT_CRITICAL(&s_event_loops_spinlock); @@ -471,7 +471,7 @@ on_err: vSemaphoreDelete(loop->mutex); } -#ifdef CONFIG_EVENT_LOOP_PROFILING +#ifdef CONFIG_ESP_EVENT_LOOP_PROFILING if(loop->profiling_mutex != NULL) { vSemaphoreDelete(loop->profiling_mutex); } @@ -582,13 +582,13 @@ esp_err_t esp_event_loop_delete(esp_event_loop_handle_t event_loop) esp_event_loop_instance_t* loop = (esp_event_loop_instance_t*) event_loop; SemaphoreHandle_t loop_mutex = loop->mutex; -#ifdef CONFIG_EVENT_LOOP_PROFILING +#ifdef CONFIG_ESP_EVENT_LOOP_PROFILING SemaphoreHandle_t loop_profiling_mutex = loop->profiling_mutex; #endif xSemaphoreTakeRecursive(loop->mutex, portMAX_DELAY); -#ifdef CONFIG_EVENT_LOOP_PROFILING +#ifdef CONFIG_ESP_EVENT_LOOP_PROFILING xSemaphoreTakeRecursive(loop->profiling_mutex, portMAX_DELAY); portENTER_CRITICAL(&s_event_loops_spinlock); SLIST_REMOVE(&s_event_loops, loop, esp_event_loop_instance, next); @@ -619,7 +619,7 @@ esp_err_t esp_event_loop_delete(esp_event_loop_handle_t event_loop) free(loop); // Free loop mutex before deleting xSemaphoreGiveRecursive(loop_mutex); -#ifdef CONFIG_EVENT_LOOP_PROFILING +#ifdef CONFIG_ESP_EVENT_LOOP_PROFILING xSemaphoreGiveRecursive(loop_profiling_mutex); vSemaphoreDelete(loop_profiling_mutex); #endif @@ -751,7 +751,7 @@ esp_err_t esp_event_post_to(esp_event_loop_handle_t event_loop, esp_event_base_t } memcpy(event_data_copy, event_data, event_data_size); -#if CONFIG_POST_EVENTS_FROM_ISR +#if CONFIG_ESP_EVENT_POST_FROM_ISR post.data.ptr = event_data_copy; post.data_allocd = true; #else @@ -790,20 +790,20 @@ esp_err_t esp_event_post_to(esp_event_loop_handle_t event_loop, esp_event_base_t if (result != pdTRUE) { post_instance_delete(&post); -#ifdef CONFIG_EVENT_LOOP_PROFILING +#ifdef CONFIG_ESP_EVENT_LOOP_PROFILING atomic_fetch_add(&loop->events_dropped, 1); #endif return ESP_ERR_TIMEOUT; } -#ifdef CONFIG_EVENT_LOOP_PROFILING +#ifdef CONFIG_ESP_EVENT_LOOP_PROFILING atomic_fetch_add(&loop->events_recieved, 1); #endif return ESP_OK; } -#if CONFIG_POST_EVENTS_FROM_ISR +#if CONFIG_ESP_EVENT_POST_FROM_ISR esp_err_t esp_event_isr_post_to(esp_event_loop_handle_t event_loop, esp_event_base_t event_base, int32_t event_id, void* event_data, size_t event_data_size, BaseType_t* task_unblocked) { @@ -837,13 +837,13 @@ esp_err_t esp_event_isr_post_to(esp_event_loop_handle_t event_loop, esp_event_ba if (result != pdTRUE) { post_instance_delete(&post); -#ifdef CONFIG_EVENT_LOOP_PROFILING +#ifdef CONFIG_ESP_EVENT_LOOP_PROFILING atomic_fetch_add(&loop->events_dropped, 1); #endif return ESP_FAIL; } -#ifdef CONFIG_EVENT_LOOP_PROFILING +#ifdef CONFIG_ESP_EVENT_LOOP_PROFILING atomic_fetch_add(&loop->events_recieved, 1); #endif @@ -853,7 +853,7 @@ esp_err_t esp_event_isr_post_to(esp_event_loop_handle_t event_loop, esp_event_ba esp_err_t esp_event_dump(FILE* file) { -#ifdef CONFIG_EVENT_LOOP_PROFILING +#ifdef CONFIG_ESP_EVENT_LOOP_PROFILING assert(file); esp_event_loop_instance_t* loop_it; diff --git a/components/esp_event/include/esp_event.h b/components/esp_event/include/esp_event.h index 824266512..c78636415 100644 --- a/components/esp_event/include/esp_event.h +++ b/components/esp_event/include/esp_event.h @@ -270,7 +270,7 @@ esp_err_t esp_event_post_to(esp_event_loop_handle_t event_loop, size_t event_data_size, TickType_t ticks_to_wait); -#if CONFIG_POST_EVENTS_FROM_ISR +#if CONFIG_ESP_EVENT_POST_FROM_ISR /** * @brief Special variant of esp_event_post for posting events from interrupt handlers. * @@ -282,9 +282,9 @@ esp_err_t esp_event_post_to(esp_event_loop_handle_t event_loop, * higher priority than currently running task has been unblocked by the posted event; * a context switch should be requested before the interrupt is existed. * - * @note this function is only available when CONFIG_POST_EVENTS_FROM_ISR is enabled + * @note this function is only available when CONFIG_ESP_EVENT_POST_FROM_ISR is enabled * @note when this function is called from an interrupt handler placed in IRAM, this function should - * be placed in IRAM as well by enabling CONFIG_POST_EVENTS_FROM_IRAM_ISR + * be placed in IRAM as well by enabling CONFIG_ESP_EVENT_POST_FROM_IRAM_ISR * * @return * - ESP_OK: Success @@ -310,9 +310,9 @@ esp_err_t esp_event_isr_post(esp_event_base_t event_base, * higher priority than currently running task has been unblocked by the posted event; * a context switch should be requested before the interrupt is existed. * - * @note this function is only available when CONFIG_POST_EVENTS_FROM_ISR is enabled + * @note this function is only available when CONFIG_ESP_EVENT_POST_FROM_ISR is enabled * @note when this function is called from an interrupt handler placed in IRAM, this function should - * be placed in IRAM as well by enabling CONFIG_POST_EVENTS_FROM_IRAM_ISR + * be placed in IRAM as well by enabling CONFIG_ESP_EVENT_POST_FROM_IRAM_ISR * * @return * - ESP_OK: Success @@ -366,7 +366,7 @@ esp_err_t esp_event_isr_post_to(esp_event_loop_handle_t event_loop, * * @param[in] file the file stream to output to * - * @note this function is a noop when CONFIG_EVENT_LOOP_PROFILING is disabled + * @note this function is a noop when CONFIG_ESP_EVENT_LOOP_PROFILING is disabled * * @return * - ESP_OK: Success @@ -379,4 +379,4 @@ esp_err_t esp_event_dump(FILE* file); } // extern "C" #endif -#endif // #ifndef ESP_EVENT_H_ \ No newline at end of file +#endif // #ifndef ESP_EVENT_H_ diff --git a/components/esp_event/linker.lf b/components/esp_event/linker.lf index fb02ff7a9..c10dc4c6d 100644 --- a/components/esp_event/linker.lf +++ b/components/esp_event/linker.lf @@ -1,6 +1,6 @@ -if POST_EVENTS_FROM_IRAM_ISR = y: +if ESP_EVENT_POST_FROM_IRAM_ISR = y: [mapping:esp_event] archive: libesp_event.a entries: esp_event:esp_event_isr_post_to (noflash) - default_event_loop:esp_event_isr_post (noflash) \ No newline at end of file + default_event_loop:esp_event_isr_post (noflash) diff --git a/components/esp_event/private_include/esp_event_internal.h b/components/esp_event/private_include/esp_event_internal.h index 4566ae1bf..d5bbb7fac 100644 --- a/components/esp_event/private_include/esp_event_internal.h +++ b/components/esp_event/private_include/esp_event_internal.h @@ -28,7 +28,7 @@ typedef SLIST_HEAD(base_nodes, base_node) base_nodes_t; typedef struct esp_event_handler_instance { esp_event_handler_t handler; /**< event handler function*/ void* arg; /**< event handler argument */ -#ifdef CONFIG_EVENT_LOOP_PROFILING +#ifdef CONFIG_ESP_EVENT_LOOP_PROFILING uint32_t invoked; /**< number of times this handler has been invoked */ int64_t time; /**< total runtime of this handler across all calls */ #endif @@ -77,7 +77,7 @@ typedef struct esp_event_loop_instance { SemaphoreHandle_t mutex; /**< mutex for updating the events linked list */ esp_event_loop_nodes_t loop_nodes; /**< set of linked lists containing the registered handlers for the loop */ -#ifdef CONFIG_EVENT_LOOP_PROFILING +#ifdef CONFIG_ESP_EVENT_LOOP_PROFILING atomic_uint_least32_t events_recieved; /**< number of events successfully posted to the loop */ atomic_uint_least32_t events_dropped; /**< number of events dropped due to queue being full */ SemaphoreHandle_t profiling_mutex; /**< mutex used for profiliing */ @@ -85,7 +85,7 @@ typedef struct esp_event_loop_instance { #endif } esp_event_loop_instance_t; -#if CONFIG_POST_EVENTS_FROM_ISR +#if CONFIG_ESP_EVENT_POST_FROM_ISR typedef union esp_event_post_data { uint32_t val; void *ptr; @@ -96,7 +96,7 @@ typedef void* esp_event_post_data_t; /// Event posted to the event queue typedef struct esp_event_post_instance { -#if CONFIG_POST_EVENTS_FROM_ISR +#if CONFIG_ESP_EVENT_POST_FROM_ISR bool data_allocd; /**< indicates whether data is alloc'd */ #endif esp_event_base_t base; /**< the event base */ @@ -108,4 +108,4 @@ typedef struct esp_event_post_instance { } // extern "C" #endif -#endif // #ifndef ESP_EVENT_INTERNAL_H_ \ No newline at end of file +#endif // #ifndef ESP_EVENT_INTERNAL_H_ diff --git a/components/esp_event/sdkconfig.rename b/components/esp_event/sdkconfig.rename new file mode 100644 index 000000000..2cd4de47e --- /dev/null +++ b/components/esp_event/sdkconfig.rename @@ -0,0 +1,6 @@ +# sdkconfig replacement configurations for deprecated options formatted as +# CONFIG_DEPRECATED_OPTION CONFIG_NEW_OPTION + +CONFIG_EVENT_LOOP_PROFILING CONFIG_ESP_EVENT_LOOP_PROFILING +CONFIG_POST_EVENTS_FROM_ISR CONFIG_ESP_EVENT_POST_FROM_ISR +CONFIG_POST_EVENTS_FROM_IRAM_ISR CONFIG_ESP_EVENT_POST_FROM_IRAM_ISR diff --git a/components/esp_event/test/test_event.c b/components/esp_event/test/test_event.c index b26877342..7153a08bb 100644 --- a/components/esp_event/test/test_event.c +++ b/components/esp_event/test/test_event.c @@ -276,7 +276,7 @@ static void test_teardown() #define TIMER_SCALE (TIMER_BASE_CLK / TIMER_DIVIDER) // convert counter value to seconds #define TIMER_INTERVAL0_SEC (2.0) // sample test interval for the first timer -#if CONFIG_POST_EVENTS_FROM_ISR +#if CONFIG_ESP_EVENT_POST_FROM_ISR static void test_handler_post_from_isr(void* event_handler_arg, esp_event_base_t event_base, int32_t event_id, void* event_data) { SemaphoreHandle_t *sem = (SemaphoreHandle_t*) event_handler_arg; @@ -287,7 +287,7 @@ static void test_handler_post_from_isr(void* event_handler_arg, esp_event_base_t } #endif -#if CONFIG_POST_EVENTS_FROM_ISR +#if CONFIG_ESP_EVENT_POST_FROM_ISR void IRAM_ATTR test_event_on_timer_alarm(void* para) { /* Retrieve the interrupt status and the counter value @@ -313,7 +313,7 @@ void IRAM_ATTR test_event_on_timer_alarm(void* para) portYIELD_FROM_ISR(); } } -#endif //CONFIG_POST_EVENTS_FROM_ISR +#endif //CONFIG_ESP_EVENT_POST_FROM_ISR TEST_CASE("can create and delete event loops", "[event]") { @@ -850,7 +850,7 @@ static void performance_test(bool dedicated_task) TEST_TEARDOWN(); -#ifdef CONFIG_EVENT_LOOP_PROFILING +#ifdef CONFIG_ESP_EVENT_LOOP_PROFILING ESP_LOGI(TAG, "events dispatched/second with profiling enabled: %d", average); // Enabling profiling will slow down event dispatch, so the set threshold // is not valid when it is enabled. @@ -860,7 +860,7 @@ static void performance_test(bool dedicated_task) #else TEST_PERFORMANCE_GREATER_THAN(EVENT_DISPATCH_PSRAM, "%d", average); #endif // CONFIG_SPIRAM_SUPPORT -#endif // CONFIG_EVENT_LOOP_PROFILING +#endif // CONFIG_ESP_EVENT_LOOP_PROFILING } TEST_CASE("performance test - dedicated task", "[event]") @@ -1148,7 +1148,7 @@ TEST_CASE("events are dispatched in the order they are registered", "[event]") TEST_TEARDOWN(); } -#if CONFIG_POST_EVENTS_FROM_ISR +#if CONFIG_ESP_EVENT_POST_FROM_ISR TEST_CASE("can post events from interrupt handler", "[event]") { SemaphoreHandle_t sem = xSemaphoreCreateBinary(); @@ -1186,7 +1186,7 @@ TEST_CASE("can post events from interrupt handler", "[event]") } #endif -#ifdef CONFIG_EVENT_LOOP_PROFILING +#ifdef CONFIG_ESP_EVENT_LOOP_PROFILING TEST_CASE("can dump event loop profile", "[event]") { /* this test aims to verify that dumping event loop statistics succeed */ diff --git a/docs/en/api-reference/system/esp_event.rst b/docs/en/api-reference/system/esp_event.rst index 524ac3de2..b0a96e4ce 100644 --- a/docs/en/api-reference/system/esp_event.rst +++ b/docs/en/api-reference/system/esp_event.rst @@ -200,7 +200,7 @@ handlers will also get executed in between. Event loop profiling -------------------- -A configuration option :ref:`CONFIG_EVENT_LOOP_PROFILING` can be enabled in order to activate statistics collection for all event loops created. +A configuration option :ref:`CONFIG_ESP_EVENT_LOOP_PROFILING` can be enabled in order to activate statistics collection for all event loops created. The function :cpp:func:`esp_event_dump` can be used to output the collected statistics to a file stream. More details on the information included in the dump can be found in the :cpp:func:`esp_event_dump` API Reference. From e9f1011b1b442f8bd6c6ee3d75bd86e7cc654e42 Mon Sep 17 00:00:00 2001 From: Roland Dobai Date: Mon, 29 Apr 2019 14:22:57 +0200 Subject: [PATCH 10/21] Rename Kconfig options (components/driver) --- components/driver/Kconfig | 4 ++-- components/driver/rtc_module.c | 2 +- components/driver/sdkconfig.rename | 4 ++++ tools/ldgen/samples/sdkconfig | 2 +- tools/unit-test-app/sdkconfig.defaults | 2 +- 5 files changed, 9 insertions(+), 5 deletions(-) create mode 100644 components/driver/sdkconfig.rename diff --git a/components/driver/Kconfig b/components/driver/Kconfig index f00d7e809..497b1a928 100644 --- a/components/driver/Kconfig +++ b/components/driver/Kconfig @@ -10,11 +10,11 @@ menu "Driver configurations" be shut off when it is not working leading to lower power consumption. However using the FSM control ADC power will increase the noise of ADC. - config ADC2_DISABLE_DAC + config ADC_DISABLE_DAC bool "Disable DAC when ADC2 is used on GPIO 25 and 26" default y help - If this is set, the ADC2 driver will disables the output of the DAC corresponding to the specified + If this is set, the ADC2 driver will disable the output of the DAC corresponding to the specified channel. This is the default value. For testing, disable this option so that we can measure the output of DAC by internal ADC. diff --git a/components/driver/rtc_module.c b/components/driver/rtc_module.c index 12afe08ae..296c183c7 100644 --- a/components/driver/rtc_module.c +++ b/components/driver/rtc_module.c @@ -1706,7 +1706,7 @@ esp_err_t adc2_get_raw(adc2_channel_t channel, adc_bits_width_t width_bit, int* } //disable other peripherals -#ifdef CONFIG_ADC2_DISABLE_DAC +#ifdef CONFIG_ADC_DISABLE_DAC adc2_dac_disable( channel ); #endif // set controller diff --git a/components/driver/sdkconfig.rename b/components/driver/sdkconfig.rename new file mode 100644 index 000000000..311467d01 --- /dev/null +++ b/components/driver/sdkconfig.rename @@ -0,0 +1,4 @@ +# sdkconfig replacement configurations for deprecated options formatted as +# CONFIG_DEPRECATED_OPTION CONFIG_NEW_OPTION + +CONFIG_ADC2_DISABLE_DAC CONFIG_ADC_DISABLE_DAC diff --git a/tools/ldgen/samples/sdkconfig b/tools/ldgen/samples/sdkconfig index d9582a84c..7903bc73f 100644 --- a/tools/ldgen/samples/sdkconfig +++ b/tools/ldgen/samples/sdkconfig @@ -125,7 +125,7 @@ CONFIG_BT_RESERVE_DRAM=0 # ADC configuration # CONFIG_ADC_FORCE_XPD_FSM= -CONFIG_ADC2_DISABLE_DAC=y +CONFIG_ADC_DISABLE_DAC=y # # ESP32-specific diff --git a/tools/unit-test-app/sdkconfig.defaults b/tools/unit-test-app/sdkconfig.defaults index 371c08bb0..0289c96f4 100644 --- a/tools/unit-test-app/sdkconfig.defaults +++ b/tools/unit-test-app/sdkconfig.defaults @@ -25,7 +25,7 @@ CONFIG_COMPILER_STACK_CHECK_MODE_STRONG=y CONFIG_COMPILER_STACK_CHECK=y CONFIG_FREERTOS_SUPPORT_STATIC_ALLOCATION=y CONFIG_ESP_TIMER_PROFILING=y -CONFIG_ADC2_DISABLE_DAC=n +CONFIG_ADC_DISABLE_DAC=n CONFIG_COMPILER_WARN_WRITE_STRINGS=y CONFIG_SPI_MASTER_IN_IRAM=y CONFIG_EFUSE_VIRTUAL=y From 92950db44eb8499aaf006edd782bca0cfe264248 Mon Sep 17 00:00:00 2001 From: Roland Dobai Date: Mon, 29 Apr 2019 14:30:13 +0200 Subject: [PATCH 11/21] Rename Kconfig options (components/lwip) --- components/esp_common/include/esp_task.h | 2 +- components/lwip/CMakeLists.txt | 2 +- components/lwip/Kconfig | 98 +++++++++---------- components/lwip/component.mk | 2 +- .../lwip/port/esp32/freertos/sys_arch.c | 2 +- components/lwip/port/esp32/include/lwipopts.h | 50 +++++----- components/lwip/sdkconfig.rename | 39 ++++++++ components/newlib/select.c | 6 +- components/vfs/README.rst | 2 +- .../protocols/pppos_client/sdkconfig.defaults | 8 +- examples/wifi/iperf/sdkconfig.defaults | 10 +- examples/wifi/iperf/sdkconfig.defaults.01 | 10 +- examples/wifi/iperf/sdkconfig.defaults.02 | 10 +- examples/wifi/iperf/sdkconfig.defaults.03 | 10 +- examples/wifi/iperf/sdkconfig.defaults.04 | 10 +- examples/wifi/iperf/sdkconfig.defaults.05 | 10 +- examples/wifi/iperf/sdkconfig.defaults.06 | 10 +- examples/wifi/iperf/sdkconfig.defaults.07 | 10 +- examples/wifi/iperf/sdkconfig.defaults.99 | 10 +- tools/ldgen/samples/sdkconfig | 32 +++--- 20 files changed, 186 insertions(+), 147 deletions(-) create mode 100644 components/lwip/sdkconfig.rename diff --git a/components/esp_common/include/esp_task.h b/components/esp_common/include/esp_task.h index 754014b55..07b08434e 100644 --- a/components/esp_common/include/esp_task.h +++ b/components/esp_common/include/esp_task.h @@ -51,7 +51,7 @@ #define ESP_TASKD_EVENT_PRIO (ESP_TASK_PRIO_MAX - 5) #define ESP_TASKD_EVENT_STACK (CONFIG_SYSTEM_EVENT_TASK_STACK_SIZE + TASK_EXTRA_STACK_SIZE) #define ESP_TASK_TCPIP_PRIO (ESP_TASK_PRIO_MAX - 7) -#define ESP_TASK_TCPIP_STACK (CONFIG_TCPIP_TASK_STACK_SIZE + TASK_EXTRA_STACK_SIZE) +#define ESP_TASK_TCPIP_STACK (CONFIG_LWIP_TCPIP_TASK_STACK_SIZE + TASK_EXTRA_STACK_SIZE) #define ESP_TASK_MAIN_PRIO (ESP_TASK_PRIO_MIN + 1) #define ESP_TASK_MAIN_STACK (CONFIG_MAIN_TASK_STACK_SIZE + TASK_EXTRA_STACK_SIZE) diff --git a/components/lwip/CMakeLists.txt b/components/lwip/CMakeLists.txt index 0a79a20da..9dde9d010 100644 --- a/components/lwip/CMakeLists.txt +++ b/components/lwip/CMakeLists.txt @@ -89,7 +89,7 @@ set(COMPONENT_SRCS "apps/dhcpserver/dhcpserver.c" "port/esp32/netif/ethernetif.c" "port/esp32/netif/wlanif.c") -if(CONFIG_PPP_SUPPORT) +if(CONFIG_LWIP_PPP_SUPPORT) list(APPEND COMPONENT_SRCS "lwip/src/netif/ppp/auth.c" "lwip/src/netif/ppp/ccp.c" "lwip/src/netif/ppp/chap-md5.c" diff --git a/components/lwip/Kconfig b/components/lwip/Kconfig index cf3e13e75..d3ad873cc 100644 --- a/components/lwip/Kconfig +++ b/components/lwip/Kconfig @@ -1,6 +1,6 @@ menu "LWIP" - config L2_TO_L3_COPY + config LWIP_L2_TO_L3_COPY bool "Enable copy between Layer2 and Layer3 packets" default n help @@ -37,7 +37,7 @@ menu "LWIP" the maximum amount of sockets here. The valid value is from 1 to 16. - config USE_ONLY_LWIP_SELECT + config LWIP_USE_ONLY_LWIP_SELECT bool "Support LWIP socket select() only" default n help @@ -128,7 +128,7 @@ menu "LWIP" So the recommendation is to disable this option. Here the LAN peer means the other side to which the ESP station or soft-AP is connected. - config ESP_GRATUITOUS_ARP + config LWIP_ESP_GRATUITOUS_ARP bool "Send gratuitous ARP periodically" default y help @@ -138,14 +138,14 @@ menu "LWIP" doesn't send ARP request to update it's ARP table, this will lead to the STA sending IP packet fail. Thus we send gratuitous ARP periodically to let AP update it's ARP table. - config GARP_TMR_INTERVAL + config LWIP_GARP_TMR_INTERVAL int "GARP timer interval(seconds)" default 60 - depends on ESP_GRATUITOUS_ARP + depends on LWIP_ESP_GRATUITOUS_ARP help Set the timer interval for gratuitous ARP. The default value is 60s - config TCPIP_RECVMBOX_SIZE + config LWIP_TCPIP_RECVMBOX_SIZE int "TCPIP task receive mail box size" default 32 range 6 64 @@ -278,21 +278,21 @@ menu "LWIP" new listening TCP connections after the limit is reached. - config TCP_MAXRTX + config LWIP_TCP_MAXRTX int "Maximum number of retransmissions of data segments" default 12 range 3 12 help Set maximum number of retransmissions of data segments. - config TCP_SYNMAXRTX + config LWIP_TCP_SYNMAXRTX int "Maximum number of retransmissions of SYN segments" default 6 range 3 12 help Set maximum number of retransmissions of SYN segments. - config TCP_MSS + config LWIP_TCP_MSS int "Maximum Segment Size (MSS)" default 1440 range 536 1460 @@ -303,13 +303,13 @@ menu "LWIP" IPv4 TCP_MSS Range: 576 <= TCP_MSS <= 1460 IPv6 TCP_MSS Range: 1220<= TCP_mSS <= 1440 - config TCP_MSL + config LWIP_TCP_MSL int "Maximum segment lifetime (MSL)" default 60000 help Set maximum segment lifetime in in milliseconds. - config TCP_SND_BUF_DEFAULT + config LWIP_TCP_SND_BUF_DEFAULT int "Default send buffer size" default 5744 # 4 * default MSS range 2440 65535 @@ -325,7 +325,7 @@ menu "LWIP" Setting a smaller default SNDBUF size can save some RAM, but will decrease performance. - config TCP_WND_DEFAULT + config LWIP_TCP_WND_DEFAULT int "Default receive window size" default 5744 # 4 * default MSS range 2440 65535 @@ -338,27 +338,27 @@ menu "LWIP" Setting a smaller default receive window size can save some RAM, but will significantly decrease performance. - config TCP_RECVMBOX_SIZE + config LWIP_TCP_RECVMBOX_SIZE int "Default TCP receive mail box size" default 6 range 6 64 help Set TCP receive mail box size. Generally bigger value means higher throughput - but more memory. The recommended value is: TCP_WND_DEFAULT/TCP_MSS + 2, e.g. if - TCP_WND_DEFAULT=14360, TCP_MSS=1436, then the recommended receive mail box size is + but more memory. The recommended value is: LWIP_TCP_WND_DEFAULT/TCP_MSS + 2, e.g. if + LWIP_TCP_WND_DEFAULT=14360, TCP_MSS=1436, then the recommended receive mail box size is (14360/1436 + 2) = 12. TCP receive mail box is a per socket mail box, when the application receives packets from TCP socket, LWIP core firstly posts the packets to TCP receive mail box and the application then fetches the packets from mail box. It means LWIP can caches maximum - TCP_RECCVMBOX_SIZE packets for each TCP socket, so the maximum possible cached TCP packets - for all TCP sockets is TCP_RECCVMBOX_SIZE multiples the maximum TCP socket number. In other - words, the bigger TCP_RECVMBOX_SIZE means more memory. + LWIP_TCP_RECCVMBOX_SIZE packets for each TCP socket, so the maximum possible cached TCP packets + for all TCP sockets is LWIP_TCP_RECCVMBOX_SIZE multiples the maximum TCP socket number. In other + words, the bigger LWIP_TCP_RECVMBOX_SIZE means more memory. On the other hand, if the receiv mail box is too small, the mail box may be full. If the mail box is full, the LWIP drops the packets. So generally we need to make sure the TCP receive mail box is big enough to avoid packet drop between LWIP core and application. - config TCP_QUEUE_OOSEQ + config LWIP_TCP_QUEUE_OOSEQ bool "Queue incoming out-of-order segments" default y help @@ -367,7 +367,7 @@ menu "LWIP" Disable this option to save some RAM during TCP sessions, at the expense of increased retransmissions if segments arrive out of order. - config ESP_TCP_KEEP_CONNECTION_WHEN_IP_CHANGES + config LWIP_TCP_KEEP_CONNECTION_WHEN_IP_CHANGES bool "Keep TCP connections when IP changed" default n help @@ -377,9 +377,9 @@ menu "LWIP" Disable this option to keep consistent with the original LWIP code behavior. - choice TCP_OVERSIZE + choice LWIP_TCP_OVERSIZE prompt "Pre-allocate transmit PBUF size" - default TCP_OVERSIZE_MSS + default LWIP_TCP_OVERSIZE_MSS help Allows enabling "oversize" allocation of TCP transmission pbufs ahead of time, which can reduce the length of pbuf chains used for transmission. @@ -392,11 +392,11 @@ menu "LWIP" have worst performance and fragmentation characteristics, but uses least RAM overall. - config TCP_OVERSIZE_MSS + config LWIP_TCP_OVERSIZE_MSS bool "MSS" - config TCP_OVERSIZE_QUARTER_MSS + config LWIP_TCP_OVERSIZE_QUARTER_MSS bool "25% MSS" - config TCP_OVERSIZE_DISABLE + config LWIP_TCP_OVERSIZE_DISABLE bool "Disabled" endchoice @@ -415,7 +415,7 @@ menu "LWIP" The practical maximum limit is determined by available heap memory at runtime. - config UDP_RECVMBOX_SIZE + config LWIP_UDP_RECVMBOX_SIZE int "Default UDP receive mail box size" default 6 range 6 64 @@ -434,7 +434,7 @@ menu "LWIP" endmenu # UDP - config TCPIP_TASK_STACK_SIZE + config LWIP_TCPIP_TASK_STACK_SIZE int "TCP/IP Task Stack Size" default 3072 # for high log levels, tcpip_adapter API calls can end up @@ -445,32 +445,32 @@ menu "LWIP" Configure TCP/IP task stack size, used by LWIP to process multi-threaded TCP/IP operations. Setting this stack too small will result in stack overflow crashes. - choice TCPIP_TASK_AFFINITY + choice LWIP_TCPIP_TASK_AFFINITY prompt "TCP/IP task affinity" - default TCPIP_TASK_AFFINITY_NO_AFFINITY + default LWIP_TCPIP_TASK_AFFINITY_NO_AFFINITY help Allows setting LwIP tasks affinity, i.e. whether the task is pinned to CPU0, pinned to CPU1, or allowed to run on any CPU. Currently this applies to "TCP/IP" task and "Ping" task. - config TCPIP_TASK_AFFINITY_NO_AFFINITY + config LWIP_TCPIP_TASK_AFFINITY_NO_AFFINITY bool "No affinity" - config TCPIP_TASK_AFFINITY_CPU0 + config LWIP_TCPIP_TASK_AFFINITY_CPU0 bool "CPU0" - config TCPIP_TASK_AFFINITY_CPU1 + config LWIP_TCPIP_TASK_AFFINITY_CPU1 bool "CPU1" depends on !FREERTOS_UNICORE endchoice - config TCPIP_TASK_AFFINITY + config LWIP_TCPIP_TASK_AFFINITY hex - default FREERTOS_NO_AFFINITY if TCPIP_TASK_AFFINITY_NO_AFFINITY - default 0x0 if TCPIP_TASK_AFFINITY_CPU0 - default 0x1 if TCPIP_TASK_AFFINITY_CPU1 + default FREERTOS_NO_AFFINITY if LWIP_TCPIP_TASK_AFFINITY_NO_AFFINITY + default 0x0 if LWIP_TCPIP_TASK_AFFINITY_CPU0 + default 0x1 if LWIP_TCPIP_TASK_AFFINITY_CPU1 - menuconfig PPP_SUPPORT + menuconfig LWIP_PPP_SUPPORT bool "Enable PPP support (new/experimental)" default n help @@ -478,44 +478,44 @@ menu "LWIP" PPP over serial support is experimental and unsupported. - config PPP_NOTIFY_PHASE_SUPPORT + config LWIP_PPP_NOTIFY_PHASE_SUPPORT bool "Enable Notify Phase Callback" - depends on PPP_SUPPORT + depends on LWIP_PPP_SUPPORT default n help Enable to set a callback which is called on change of the internal PPP state machine. - config PPP_PAP_SUPPORT + config LWIP_PPP_PAP_SUPPORT bool "Enable PAP support" - depends on PPP_SUPPORT + depends on LWIP_PPP_SUPPORT default n help Enable Password Authentication Protocol (PAP) support - config PPP_CHAP_SUPPORT + config LWIP_PPP_CHAP_SUPPORT bool "Enable CHAP support" - depends on PPP_SUPPORT + depends on LWIP_PPP_SUPPORT default n help Enable Challenge Handshake Authentication Protocol (CHAP) support - config PPP_MSCHAP_SUPPORT + config LWIP_PPP_MSCHAP_SUPPORT bool "Enable MSCHAP support" - depends on PPP_SUPPORT + depends on LWIP_PPP_SUPPORT default n help Enable Microsoft version of the Challenge-Handshake Authentication Protocol (MSCHAP) support - config PPP_MPPE_SUPPORT + config LWIP_PPP_MPPE_SUPPORT bool "Enable MPPE support" - depends on PPP_SUPPORT + depends on LWIP_PPP_SUPPORT default n help Enable Microsoft Point-to-Point Encryption (MPPE) support - config PPP_DEBUG_ON + config LWIP_PPP_DEBUG_ON bool "Enable PPP debug log output" - depends on PPP_SUPPORT + depends on LWIP_PPP_SUPPORT default n help Enable PPP debug log output diff --git a/components/lwip/component.mk b/components/lwip/component.mk index 5afc43af4..a92b88869 100644 --- a/components/lwip/component.mk +++ b/components/lwip/component.mk @@ -25,7 +25,7 @@ COMPONENT_SRCDIRS := \ port/esp32/netif \ port/esp32/debug -ifdef CONFIG_PPP_SUPPORT +ifdef CONFIG_LWIP_PPP_SUPPORT COMPONENT_SRCDIRS += lwip/src/netif/ppp lwip/src/netif/ppp/polarssl endif diff --git a/components/lwip/port/esp32/freertos/sys_arch.c b/components/lwip/port/esp32/freertos/sys_arch.c index 1168b9e89..fec80d1b9 100644 --- a/components/lwip/port/esp32/freertos/sys_arch.c +++ b/components/lwip/port/esp32/freertos/sys_arch.c @@ -412,7 +412,7 @@ sys_thread_new(const char *name, lwip_thread_fn thread, void *arg, int stacksize portBASE_TYPE result; result = xTaskCreatePinnedToCore(thread, name, stacksize, arg, prio, &created_task, - CONFIG_TCPIP_TASK_AFFINITY); + CONFIG_LWIP_TCPIP_TASK_AFFINITY); if (result != pdPASS) { return NULL; diff --git a/components/lwip/port/esp32/include/lwipopts.h b/components/lwip/port/esp32/include/lwipopts.h index d15cb0bb7..a70815724 100644 --- a/components/lwip/port/esp32/include/lwipopts.h +++ b/components/lwip/port/esp32/include/lwipopts.h @@ -309,36 +309,36 @@ * TCP_QUEUE_OOSEQ==1: TCP will queue segments that arrive out of order. * Define to 0 if your device is low on memory. */ -#define TCP_QUEUE_OOSEQ CONFIG_TCP_QUEUE_OOSEQ +#define TCP_QUEUE_OOSEQ CONFIG_LWIP_TCP_QUEUE_OOSEQ /** * ESP_TCP_KEEP_CONNECTION_WHEN_IP_CHANGES==1: Keep TCP connection when IP changed * scenario happens: 192.168.0.2 -> 0.0.0.0 -> 192.168.0.2 or 192.168.0.2 -> 0.0.0.0 */ -#define ESP_TCP_KEEP_CONNECTION_WHEN_IP_CHANGES CONFIG_ESP_TCP_KEEP_CONNECTION_WHEN_IP_CHANGES +#define ESP_TCP_KEEP_CONNECTION_WHEN_IP_CHANGES CONFIG_LWIP_TCP_KEEP_CONNECTION_WHEN_IP_CHANGES /* * LWIP_EVENT_API==1: The user defines lwip_tcp_event() to receive all * events (accept, sent, etc) that happen in the system. * LWIP_CALLBACK_API==1: The PCB callback function is called directly * for the event. This is the default. */ -#define TCP_MSS CONFIG_TCP_MSS +#define TCP_MSS CONFIG_LWIP_TCP_MSS /** * TCP_MSL: The maximum segment lifetime in milliseconds */ -#define TCP_MSL CONFIG_TCP_MSL +#define TCP_MSL CONFIG_LWIP_TCP_MSL /** * TCP_MAXRTX: Maximum number of retransmissions of data segments. */ -#define TCP_MAXRTX CONFIG_TCP_MAXRTX +#define TCP_MAXRTX CONFIG_LWIP_TCP_MAXRTX /** * TCP_SYNMAXRTX: Maximum number of retransmissions of SYN segments. */ -#define TCP_SYNMAXRTX CONFIG_TCP_SYNMAXRTX +#define TCP_SYNMAXRTX CONFIG_LWIP_TCP_SYNMAXRTX /** * TCP_LISTEN_BACKLOG: Enable the backlog option for tcp listen pcb. @@ -350,13 +350,13 @@ * TCP_OVERSIZE: The maximum number of bytes that tcp_write may * allocate ahead of time */ -#ifdef CONFIG_TCP_OVERSIZE_MSS +#ifdef CONFIG_LWIP_TCP_OVERSIZE_MSS #define TCP_OVERSIZE TCP_MSS #endif -#ifdef CONFIG_TCP_OVERSIZE_QUARTER_MSS +#ifdef CONFIG_LWIP_TCP_OVERSIZE_QUARTER_MSS #define TCP_OVERSIZE (TCP_MSS/4) #endif -#ifdef CONFIG_TCP_OVERSIZE_DISABLE +#ifdef CONFIG_LWIP_TCP_OVERSIZE_DISABLE #define TCP_OVERSIZE 0 #endif #ifndef TCP_OVERSIZE @@ -446,21 +446,21 @@ * The queue size value itself is platform-dependent, but is passed to * sys_mbox_new() when tcpip_init is called. */ -#define TCPIP_MBOX_SIZE CONFIG_TCPIP_RECVMBOX_SIZE +#define TCPIP_MBOX_SIZE CONFIG_LWIP_TCPIP_RECVMBOX_SIZE /** * DEFAULT_UDP_RECVMBOX_SIZE: The mailbox size for the incoming packets on a * NETCONN_UDP. The queue size value itself is platform-dependent, but is passed * to sys_mbox_new() when the recvmbox is created. */ -#define DEFAULT_UDP_RECVMBOX_SIZE CONFIG_UDP_RECVMBOX_SIZE +#define DEFAULT_UDP_RECVMBOX_SIZE CONFIG_LWIP_UDP_RECVMBOX_SIZE /** * DEFAULT_TCP_RECVMBOX_SIZE: The mailbox size for the incoming packets on a * NETCONN_TCP. The queue size value itself is platform-dependent, but is passed * to sys_mbox_new() when the recvmbox is created. */ -#define DEFAULT_TCP_RECVMBOX_SIZE CONFIG_TCP_RECVMBOX_SIZE +#define DEFAULT_TCP_RECVMBOX_SIZE CONFIG_LWIP_TCP_RECVMBOX_SIZE /** * DEFAULT_ACCEPTMBOX_SIZE: The mailbox size for the incoming connections. @@ -572,34 +572,34 @@ /** * PPP_SUPPORT==1: Enable PPP. */ -#define PPP_SUPPORT CONFIG_PPP_SUPPORT +#define PPP_SUPPORT CONFIG_LWIP_PPP_SUPPORT #if PPP_SUPPORT /** * PPP_NOTIFY_PHASE==1: Support PPP notify phase. */ -#define PPP_NOTIFY_PHASE CONFIG_PPP_NOTIFY_PHASE_SUPPORT +#define PPP_NOTIFY_PHASE CONFIG_LWIP_PPP_NOTIFY_PHASE_SUPPORT /** * PAP_SUPPORT==1: Support PAP. */ -#define PAP_SUPPORT CONFIG_PPP_PAP_SUPPORT +#define PAP_SUPPORT CONFIG_LWIP_PPP_PAP_SUPPORT /** * CHAP_SUPPORT==1: Support CHAP. */ -#define CHAP_SUPPORT CONFIG_PPP_CHAP_SUPPORT +#define CHAP_SUPPORT CONFIG_LWIP_PPP_CHAP_SUPPORT /** * MSCHAP_SUPPORT==1: Support MSCHAP. */ -#define MSCHAP_SUPPORT CONFIG_PPP_MSCHAP_SUPPORT +#define MSCHAP_SUPPORT CONFIG_LWIP_PPP_MSCHAP_SUPPORT /** * CCP_SUPPORT==1: Support CCP. */ -#define MPPE_SUPPORT CONFIG_PPP_MPPE_SUPPORT +#define MPPE_SUPPORT CONFIG_LWIP_PPP_MPPE_SUPPORT /** * PPP_MAXIDLEFLAG: Max Xmit idle time (in ms) before resend flag char. @@ -614,7 +614,7 @@ /** * PPP_DEBUG: Enable debugging for PPP. */ -#define PPP_DEBUG_ON CONFIG_PPP_DEBUG_ON +#define PPP_DEBUG_ON CONFIG_LWIP_PPP_DEBUG_ON #if PPP_DEBUG_ON #define PPP_DEBUG LWIP_DBG_ON @@ -749,7 +749,7 @@ #define ESP_RANDOM_TCP_PORT 1 #define ESP_IP4_ATON 1 #define ESP_LIGHT_SLEEP 1 -#define ESP_L2_TO_L3_COPY CONFIG_L2_TO_L3_COPY +#define ESP_L2_TO_L3_COPY CONFIG_LWIP_L2_TO_L3_COPY #define ESP_STATS_MEM CONFIG_LWIP_STATS #define ESP_STATS_DROP CONFIG_LWIP_STATS #define ESP_STATS_TCP 0 @@ -759,7 +759,7 @@ #define ESP_PING 1 #define ESP_HAS_SELECT 1 #define ESP_AUTO_RECV 1 -#define ESP_GRATUITOUS_ARP CONFIG_ESP_GRATUITOUS_ARP +#define ESP_GRATUITOUS_ARP CONFIG_LWIP_ESP_GRATUITOUS_ARP #ifdef ESP_IRAM_ATTR #undef ESP_IRAM_ATTR @@ -790,12 +790,12 @@ enum { #define DBG_PERF_FILTER_LEN 1000 #endif -#define TCP_SND_BUF CONFIG_TCP_SND_BUF_DEFAULT -#define TCP_WND CONFIG_TCP_WND_DEFAULT +#define TCP_SND_BUF CONFIG_LWIP_TCP_SND_BUF_DEFAULT +#define TCP_WND CONFIG_LWIP_TCP_WND_DEFAULT #if ESP_PER_SOC_TCP_WND -#define TCP_WND_DEFAULT CONFIG_TCP_WND_DEFAULT -#define TCP_SND_BUF_DEFAULT CONFIG_TCP_SND_BUF_DEFAULT +#define TCP_WND_DEFAULT CONFIG_LWIP_TCP_WND_DEFAULT +#define TCP_SND_BUF_DEFAULT CONFIG_LWIP_TCP_SND_BUF_DEFAULT #define TCP_WND(pcb) (pcb->per_soc_tcp_wnd) #define TCP_SND_BUF(pcb) (pcb->per_soc_tcp_snd_buf) #define TCP_SND_QUEUELEN(pcb) ((4 * (TCP_SND_BUF((pcb))) + (TCP_MSS - 1))/(TCP_MSS)) diff --git a/components/lwip/sdkconfig.rename b/components/lwip/sdkconfig.rename new file mode 100644 index 000000000..4c2dd3148 --- /dev/null +++ b/components/lwip/sdkconfig.rename @@ -0,0 +1,39 @@ +# sdkconfig replacement configurations for deprecated options formatted as +# CONFIG_DEPRECATED_OPTION CONFIG_NEW_OPTION + +CONFIG_L2_TO_L3_COPY CONFIG_LWIP_L2_TO_L3_COPY +CONFIG_USE_ONLY_LWIP_SELECT CONFIG_LWIP_USE_ONLY_LWIP_SELECT +CONFIG_ESP_GRATUITOUS_ARP CONFIG_LWIP_ESP_GRATUITOUS_ARP +CONFIG_GARP_TMR_INTERVAL CONFIG_LWIP_GARP_TMR_INTERVAL +CONFIG_TCPIP_RECVMBOX_SIZE CONFIG_LWIP_TCPIP_RECVMBOX_SIZE + +# TCP +CONFIG_TCP_MAXRTX CONFIG_LWIP_TCP_MAXRTX +CONFIG_TCP_SYNMAXRTX CONFIG_LWIP_TCP_SYNMAXRTX +CONFIG_TCP_MSS CONFIG_LWIP_TCP_MSS +CONFIG_TCP_MSL CONFIG_LWIP_TCP_MSL +CONFIG_TCP_SND_BUF_DEFAULT CONFIG_LWIP_TCP_SND_BUF_DEFAULT +CONFIG_TCP_WND_DEFAULT CONFIG_LWIP_TCP_WND_DEFAULT +CONFIG_TCP_RECVMBOX_SIZE CONFIG_LWIP_TCP_RECVMBOX_SIZE +CONFIG_TCP_QUEUE_OOSEQ CONFIG_LWIP_TCP_QUEUE_OOSEQ +CONFIG_ESP_TCP_KEEP_CONNECTION_WHEN_IP_CHANGES CONFIG_LWIP_TCP_KEEP_CONNECTION_WHEN_IP_CHANGES +CONFIG_TCP_OVERSIZE CONFIG_LWIP_TCP_OVERSIZE +CONFIG_TCP_OVERSIZE_MSS CONFIG_LWIP_TCP_OVERSIZE_MSS +CONFIG_TCP_OVERSIZE_QUARTER_MSS CONFIG_LWIP_TCP_OVERSIZE_QUARTER_MSS +CONFIG_TCP_OVERSIZE_DISABLE CONFIG_LWIP_TCP_OVERSIZE_DISABLE + +# UDP +CONFIG_UDP_RECVMBOX_SIZE CONFIG_LWIP_UDP_RECVMBOX_SIZE + +CONFIG_TCPIP_TASK_STACK_SIZE CONFIG_LWIP_TCPIP_TASK_STACK_SIZE +CONFIG_TCPIP_TASK_AFFINITY CONFIG_LWIP_TCPIP_TASK_AFFINITY +CONFIG_TCPIP_TASK_AFFINITY_NO_AFFINITY CONFIG_LWIP_TCPIP_TASK_AFFINITY_NO_AFFINITY +CONFIG_TCPIP_TASK_AFFINITY_CPU0 CONFIG_LWIP_TCPIP_TASK_AFFINITY_CPU0 +CONFIG_TCPIP_TASK_AFFINITY_CPU1 CONFIG_LWIP_TCPIP_TASK_AFFINITY_CPU1 +CONFIG_PPP_SUPPORT CONFIG_LWIP_PPP_SUPPORT +CONFIG_PPP_NOTIFY_PHASE_SUPPORT CONFIG_LWIP_PPP_NOTIFY_PHASE_SUPPORT +CONFIG_PPP_PAP_SUPPORT CONFIG_LWIP_PPP_PAP_SUPPORT +CONFIG_PPP_CHAP_SUPPORT CONFIG_LWIP_PPP_CHAP_SUPPORT +CONFIG_PPP_MSCHAP_SUPPORT CONFIG_LWIP_PPP_MSCHAP_SUPPORT +CONFIG_PPP_MPPE_SUPPORT CONFIG_LWIP_PPP_MPPE_SUPPORT +CONFIG_PPP_DEBUG_ON CONFIG_LWIP_PPP_DEBUG_ON diff --git a/components/newlib/select.c b/components/newlib/select.c index 606315065..38b252391 100644 --- a/components/newlib/select.c +++ b/components/newlib/select.c @@ -16,7 +16,7 @@ #include "esp_vfs.h" #include "sdkconfig.h" -#ifdef CONFIG_USE_ONLY_LWIP_SELECT +#ifdef CONFIG_LWIP_USE_ONLY_LWIP_SELECT #include "lwip/sockets.h" #ifdef CONFIG_SUPPRESS_SELECT_DEBUG_OUTPUT @@ -37,11 +37,11 @@ static void log_fd_set(const char *fds_name, const fd_set *fds) } } } -#endif //CONFIG_USE_ONLY_LWIP_SELECT +#endif //CONFIG_LWIP_USE_ONLY_LWIP_SELECT int select(int nfds, fd_set *readfds, fd_set *writefds, fd_set *errorfds, struct timeval *timeout) { -#ifdef CONFIG_USE_ONLY_LWIP_SELECT +#ifdef CONFIG_LWIP_USE_ONLY_LWIP_SELECT ESP_LOGD(TAG, "lwip_select starts with nfds = %d", nfds); if (timeout) { ESP_LOGD(TAG, "timeout is %lds + %ldus", timeout->tv_sec, timeout->tv_usec); diff --git a/components/vfs/README.rst b/components/vfs/README.rst index e7e50fd67..95ccefd84 100644 --- a/components/vfs/README.rst +++ b/components/vfs/README.rst @@ -94,7 +94,7 @@ are the :example:`peripherals/uart_select` and the :example:`system/select` examples. If :cpp:func:`select` is used for socket file descriptors only then one can -enable the :envvar:`CONFIG_USE_ONLY_LWIP_SELECT` option which can reduce the code +enable the :envvar:`CONFIG_LWIP_USE_ONLY_LWIP_SELECT` option which can reduce the code size and improve performance. Paths diff --git a/examples/protocols/pppos_client/sdkconfig.defaults b/examples/protocols/pppos_client/sdkconfig.defaults index 91833a05f..80613985f 100644 --- a/examples/protocols/pppos_client/sdkconfig.defaults +++ b/examples/protocols/pppos_client/sdkconfig.defaults @@ -1,5 +1,5 @@ # Override some defaults to enable PPP -CONFIG_PPP_SUPPORT=y -CONFIG_PPP_NOTIFY_PHASE_SUPPORT=y -CONFIG_PPP_PAP_SUPPORT=y -CONFIG_TCPIP_TASK_STACK_SIZE=4096 +CONFIG_LWIP_PPP_SUPPORT=y +CONFIG_LWIP_PPP_NOTIFY_PHASE_SUPPORT=y +CONFIG_LWIP_PPP_PAP_SUPPORT=y +CONFIG_LWIP_TCPIP_TASK_STACK_SIZE=4096 diff --git a/examples/wifi/iperf/sdkconfig.defaults b/examples/wifi/iperf/sdkconfig.defaults index 6c655bc5f..3d9d958a7 100644 --- a/examples/wifi/iperf/sdkconfig.defaults +++ b/examples/wifi/iperf/sdkconfig.defaults @@ -18,11 +18,11 @@ CONFIG_FREERTOS_HZ=1000 CONFIG_INT_WDT=n CONFIG_TASK_WDT=n -CONFIG_TCP_SND_BUF_DEFAULT=65534 -CONFIG_TCP_WND_DEFAULT=65534 -CONFIG_TCP_RECVMBOX_SIZE=64 -CONFIG_UDP_RECVMBOX_SIZE=64 -CONFIG_TCPIP_RECVMBOX_SIZE=64 +CONFIG_LWIP_TCP_SND_BUF_DEFAULT=65534 +CONFIG_LWIP_TCP_WND_DEFAULT=65534 +CONFIG_LWIP_TCP_RECVMBOX_SIZE=64 +CONFIG_LWIP_UDP_RECVMBOX_SIZE=64 +CONFIG_LWIP_TCPIP_RECVMBOX_SIZE=64 CONFIG_LWIP_ETHARP_TRUST_IP_MAC=n CONFIG_FLASHMODE_QIO=y diff --git a/examples/wifi/iperf/sdkconfig.defaults.01 b/examples/wifi/iperf/sdkconfig.defaults.01 index 846ff9efe..5984c16fd 100644 --- a/examples/wifi/iperf/sdkconfig.defaults.01 +++ b/examples/wifi/iperf/sdkconfig.defaults.01 @@ -16,10 +16,10 @@ CONFIG_ESP32_WIFI_TX_BA_WIN=12 CONFIG_ESP32_WIFI_AMPDU_RX_ENABLED=y CONFIG_ESP32_WIFI_RX_BA_WIN=12 -CONFIG_TCP_SND_BUF_DEFAULT=11488 -CONFIG_TCP_WND_DEFAULT=11488 -CONFIG_TCP_RECVMBOX_SIZE=12 -CONFIG_UDP_RECVMBOX_SIZE=12 -CONFIG_TCPIP_RECVMBOX_SIZE=48 +CONFIG_LWIP_TCP_SND_BUF_DEFAULT=11488 +CONFIG_LWIP_TCP_WND_DEFAULT=11488 +CONFIG_LWIP_TCP_RECVMBOX_SIZE=12 +CONFIG_LWIP_UDP_RECVMBOX_SIZE=12 +CONFIG_LWIP_TCPIP_RECVMBOX_SIZE=48 CONFIG_LWIP_ETHARP_TRUST_IP_MAC= diff --git a/examples/wifi/iperf/sdkconfig.defaults.02 b/examples/wifi/iperf/sdkconfig.defaults.02 index 60020741e..cbdecf189 100644 --- a/examples/wifi/iperf/sdkconfig.defaults.02 +++ b/examples/wifi/iperf/sdkconfig.defaults.02 @@ -16,10 +16,10 @@ CONFIG_ESP32_WIFI_TX_BA_WIN=32 CONFIG_ESP32_WIFI_AMPDU_RX_ENABLED=y CONFIG_ESP32_WIFI_RX_BA_WIN=32 -CONFIG_TCP_SND_BUF_DEFAULT=11488 -CONFIG_TCP_WND_DEFAULT=11488 -CONFIG_TCP_RECVMBOX_SIZE=12 -CONFIG_UDP_RECVMBOX_SIZE=12 -CONFIG_TCPIP_RECVMBOX_SIZE=48 +CONFIG_LWIP_TCP_SND_BUF_DEFAULT=11488 +CONFIG_LWIP_TCP_WND_DEFAULT=11488 +CONFIG_LWIP_TCP_RECVMBOX_SIZE=12 +CONFIG_LWIP_UDP_RECVMBOX_SIZE=12 +CONFIG_LWIP_TCPIP_RECVMBOX_SIZE=48 CONFIG_LWIP_ETHARP_TRUST_IP_MAC= diff --git a/examples/wifi/iperf/sdkconfig.defaults.03 b/examples/wifi/iperf/sdkconfig.defaults.03 index 9c5a4e41b..4a25dd2ac 100644 --- a/examples/wifi/iperf/sdkconfig.defaults.03 +++ b/examples/wifi/iperf/sdkconfig.defaults.03 @@ -16,10 +16,10 @@ CONFIG_ESP32_WIFI_TX_BA_WIN=32 CONFIG_ESP32_WIFI_AMPDU_RX_ENABLED=y CONFIG_ESP32_WIFI_RX_BA_WIN=32 -CONFIG_TCP_SND_BUF_DEFAULT=32768 -CONFIG_TCP_WND_DEFAULT=32768 -CONFIG_TCP_RECVMBOX_SIZE=64 -CONFIG_UDP_RECVMBOX_SIZE=64 -CONFIG_TCPIP_RECVMBOX_SIZE=64 +CONFIG_LWIP_TCP_SND_BUF_DEFAULT=32768 +CONFIG_LWIP_TCP_WND_DEFAULT=32768 +CONFIG_LWIP_TCP_RECVMBOX_SIZE=64 +CONFIG_LWIP_UDP_RECVMBOX_SIZE=64 +CONFIG_LWIP_TCPIP_RECVMBOX_SIZE=64 CONFIG_LWIP_ETHARP_TRUST_IP_MAC= diff --git a/examples/wifi/iperf/sdkconfig.defaults.04 b/examples/wifi/iperf/sdkconfig.defaults.04 index 01b30232c..f0401688d 100644 --- a/examples/wifi/iperf/sdkconfig.defaults.04 +++ b/examples/wifi/iperf/sdkconfig.defaults.04 @@ -16,10 +16,10 @@ CONFIG_ESP32_WIFI_TX_BA_WIN=32 CONFIG_ESP32_WIFI_AMPDU_RX_ENABLED=y CONFIG_ESP32_WIFI_RX_BA_WIN=32 -CONFIG_TCP_SND_BUF_DEFAULT=65535 -CONFIG_TCP_WND_DEFAULT=65535 -CONFIG_TCP_RECVMBOX_SIZE=64 -CONFIG_UDP_RECVMBOX_SIZE=64 -CONFIG_TCPIP_RECVMBOX_SIZE=64 +CONFIG_LWIP_TCP_SND_BUF_DEFAULT=65535 +CONFIG_LWIP_TCP_WND_DEFAULT=65535 +CONFIG_LWIP_TCP_RECVMBOX_SIZE=64 +CONFIG_LWIP_UDP_RECVMBOX_SIZE=64 +CONFIG_LWIP_TCPIP_RECVMBOX_SIZE=64 CONFIG_LWIP_ETHARP_TRUST_IP_MAC= diff --git a/examples/wifi/iperf/sdkconfig.defaults.05 b/examples/wifi/iperf/sdkconfig.defaults.05 index b0bed372c..9021754b1 100644 --- a/examples/wifi/iperf/sdkconfig.defaults.05 +++ b/examples/wifi/iperf/sdkconfig.defaults.05 @@ -16,11 +16,11 @@ CONFIG_ESP32_WIFI_TX_BA_WIN=32 CONFIG_ESP32_WIFI_AMPDU_RX_ENABLED=y CONFIG_ESP32_WIFI_RX_BA_WIN=32 -CONFIG_TCP_SND_BUF_DEFAULT=65534 -CONFIG_TCP_WND_DEFAULT=65534 -CONFIG_TCP_RECVMBOX_SIZE=64 -CONFIG_UDP_RECVMBOX_SIZE=64 -CONFIG_TCPIP_RECVMBOX_SIZE=64 +CONFIG_LWIP_TCP_SND_BUF_DEFAULT=65534 +CONFIG_LWIP_TCP_WND_DEFAULT=65534 +CONFIG_LWIP_TCP_RECVMBOX_SIZE=64 +CONFIG_LWIP_UDP_RECVMBOX_SIZE=64 +CONFIG_LWIP_TCPIP_RECVMBOX_SIZE=64 CONFIG_LWIP_ETHARP_TRUST_IP_MAC= CONFIG_FLASHMODE_QIO=y diff --git a/examples/wifi/iperf/sdkconfig.defaults.06 b/examples/wifi/iperf/sdkconfig.defaults.06 index 90b23887f..a350f2d1c 100644 --- a/examples/wifi/iperf/sdkconfig.defaults.06 +++ b/examples/wifi/iperf/sdkconfig.defaults.06 @@ -14,11 +14,11 @@ CONFIG_FREERTOS_HZ=1000 CONFIG_INT_WDT= CONFIG_TASK_WDT= -CONFIG_TCP_SND_BUF_DEFAULT=65534 -CONFIG_TCP_WND_DEFAULT=65534 -CONFIG_TCP_RECVMBOX_SIZE=64 -CONFIG_UDP_RECVMBOX_SIZE=64 -CONFIG_TCPIP_RECVMBOX_SIZE=64 +CONFIG_LWIP_TCP_SND_BUF_DEFAULT=65534 +CONFIG_LWIP_TCP_WND_DEFAULT=65534 +CONFIG_LWIP_TCP_RECVMBOX_SIZE=64 +CONFIG_LWIP_UDP_RECVMBOX_SIZE=64 +CONFIG_LWIP_TCPIP_RECVMBOX_SIZE=64 CONFIG_LWIP_ETHARP_TRUST_IP_MAC= CONFIG_FLASHMODE_QIO=y diff --git a/examples/wifi/iperf/sdkconfig.defaults.07 b/examples/wifi/iperf/sdkconfig.defaults.07 index cdd5257d3..ac11f1c6a 100644 --- a/examples/wifi/iperf/sdkconfig.defaults.07 +++ b/examples/wifi/iperf/sdkconfig.defaults.07 @@ -18,11 +18,11 @@ CONFIG_FREERTOS_HZ=1000 CONFIG_INT_WDT= CONFIG_TASK_WDT= -CONFIG_TCP_SND_BUF_DEFAULT=65534 -CONFIG_TCP_WND_DEFAULT=65534 -CONFIG_TCP_RECVMBOX_SIZE=64 -CONFIG_UDP_RECVMBOX_SIZE=64 -CONFIG_TCPIP_RECVMBOX_SIZE=64 +CONFIG_LWIP_TCP_SND_BUF_DEFAULT=65534 +CONFIG_LWIP_TCP_WND_DEFAULT=65534 +CONFIG_LWIP_TCP_RECVMBOX_SIZE=64 +CONFIG_LWIP_UDP_RECVMBOX_SIZE=64 +CONFIG_LWIP_TCPIP_RECVMBOX_SIZE=64 CONFIG_LWIP_ETHARP_TRUST_IP_MAC= CONFIG_FLASHMODE_QIO=y diff --git a/examples/wifi/iperf/sdkconfig.defaults.99 b/examples/wifi/iperf/sdkconfig.defaults.99 index 65d51174a..434e3b5b1 100644 --- a/examples/wifi/iperf/sdkconfig.defaults.99 +++ b/examples/wifi/iperf/sdkconfig.defaults.99 @@ -18,11 +18,11 @@ CONFIG_FREERTOS_HZ=1000 CONFIG_INT_WDT= CONFIG_TASK_WDT= -CONFIG_TCP_SND_BUF_DEFAULT=65534 -CONFIG_TCP_WND_DEFAULT=65534 -CONFIG_TCP_RECVMBOX_SIZE=64 -CONFIG_UDP_RECVMBOX_SIZE=64 -CONFIG_TCPIP_RECVMBOX_SIZE=64 +CONFIG_LWIP_TCP_SND_BUF_DEFAULT=65534 +CONFIG_LWIP_TCP_WND_DEFAULT=65534 +CONFIG_LWIP_TCP_RECVMBOX_SIZE=64 +CONFIG_LWIP_UDP_RECVMBOX_SIZE=64 +CONFIG_LWIP_TCPIP_RECVMBOX_SIZE=64 CONFIG_LWIP_ETHARP_TRUST_IP_MAC= CONFIG_FLASHMODE_QIO=y diff --git a/tools/ldgen/samples/sdkconfig b/tools/ldgen/samples/sdkconfig index 7903bc73f..c6d56b713 100644 --- a/tools/ldgen/samples/sdkconfig +++ b/tools/ldgen/samples/sdkconfig @@ -339,7 +339,7 @@ CONFIG_LOG_COLORS=y # # LWIP # -CONFIG_L2_TO_L3_COPY= +CONFIG_LWIP_L2_TO_L3_COPY= CONFIG_LWIP_IRAM_OPTIMIZATION= CONFIG_LWIP_MAX_SOCKETS=4 CONFIG_LWIP_SO_REUSE= @@ -349,7 +349,7 @@ CONFIG_LWIP_IP_FRAG= CONFIG_LWIP_IP_REASSEMBLY= CONFIG_LWIP_STATS= CONFIG_LWIP_ETHARP_TRUST_IP_MAC=y -CONFIG_TCPIP_RECVMBOX_SIZE=32 +CONFIG_LWIP_TCPIP_RECVMBOX_SIZE=32 CONFIG_LWIP_DHCP_DOES_ARP_CHECK=y # @@ -366,25 +366,25 @@ CONFIG_LWIP_LOOPBACK_MAX_PBUFS=8 # CONFIG_LWIP_MAX_ACTIVE_TCP=16 CONFIG_LWIP_MAX_LISTENING_TCP=16 -CONFIG_TCP_MAXRTX=12 -CONFIG_TCP_SYNMAXRTX=6 -CONFIG_TCP_MSS=1436 -CONFIG_TCP_MSL=60000 -CONFIG_TCP_SND_BUF_DEFAULT=5744 -CONFIG_TCP_WND_DEFAULT=5744 -CONFIG_TCP_RECVMBOX_SIZE=6 -CONFIG_TCP_QUEUE_OOSEQ=y -CONFIG_TCP_OVERSIZE_MSS=y -CONFIG_TCP_OVERSIZE_QUARTER_MSS= -CONFIG_TCP_OVERSIZE_DISABLE= +CONFIG_LWIP_TCP_MAXRTX=12 +CONFIG_LWIP_TCP_SYNMAXRTX=6 +CONFIG_LWIP_TCP_MSS=1436 +CONFIG_LWIP_TCP_MSL=60000 +CONFIG_LWIP_TCP_SND_BUF_DEFAULT=5744 +CONFIG_LWIP_TCP_WND_DEFAULT=5744 +CONFIG_LWIP_TCP_RECVMBOX_SIZE=6 +CONFIG_LWIP_TCP_QUEUE_OOSEQ=y +CONFIG_LWIP_TCP_OVERSIZE_MSS=y +CONFIG_LWIP_TCP_OVERSIZE_QUARTER_MSS= +CONFIG_LWIP_TCP_OVERSIZE_DISABLE= # # UDP # CONFIG_LWIP_MAX_UDP_PCBS=16 -CONFIG_UDP_RECVMBOX_SIZE=6 -CONFIG_TCPIP_TASK_STACK_SIZE=2048 -CONFIG_PPP_SUPPORT= +CONFIG_LWIP_UDP_RECVMBOX_SIZE=6 +CONFIG_LWIP_TCPIP_TASK_STACK_SIZE=2048 +CONFIG_LWIP_PPP_SUPPORT= # # ICMP From b8111ab1d50c0b96daca0215c65d319172306463 Mon Sep 17 00:00:00 2001 From: Roland Dobai Date: Mon, 29 Apr 2019 15:55:35 +0200 Subject: [PATCH 12/21] Rename Kconfig options (components/esp_wifi) --- components/esp32/cpu_start.c | 2 +- components/esp32/esp_adapter.c | 16 ++++++++-------- components/esp_wifi/Kconfig | 24 ++++++++++++------------ components/esp_wifi/sdkconfig.rename | 9 +++++++++ components/esp_wifi/src/phy_init.c | 14 +++++++------- 5 files changed, 37 insertions(+), 28 deletions(-) create mode 100644 components/esp_wifi/sdkconfig.rename diff --git a/components/esp32/cpu_start.c b/components/esp32/cpu_start.c index ed701a1a7..dc9f10b21 100644 --- a/components/esp32/cpu_start.c +++ b/components/esp32/cpu_start.c @@ -411,7 +411,7 @@ void start_cpu0_default(void) } #endif -#if CONFIG_SW_COEXIST_ENABLE +#if CONFIG_ESP32_WIFI_SW_COEXIST_ENABLE esp_coex_adapter_register(&g_coex_adapter_funcs); #endif diff --git a/components/esp32/esp_adapter.c b/components/esp32/esp_adapter.c index 1dfcb342c..3893c28dc 100644 --- a/components/esp32/esp_adapter.c +++ b/components/esp32/esp_adapter.c @@ -396,7 +396,7 @@ static void sc_ack_send_wrapper(void *param) static uint32_t coex_status_get_wrapper(void) { -#if CONFIG_SW_COEXIST_ENABLE +#if CONFIG_ESP32_WIFI_SW_COEXIST_ENABLE return coex_status_get(); #else return 0; @@ -405,7 +405,7 @@ static uint32_t coex_status_get_wrapper(void) static int coex_wifi_request_wrapper(uint32_t event, uint32_t latency, uint32_t duration) { -#if CONFIG_SW_COEXIST_ENABLE +#if CONFIG_ESP32_WIFI_SW_COEXIST_ENABLE return coex_wifi_request(event, latency, duration); #else return 0; @@ -414,7 +414,7 @@ static int coex_wifi_request_wrapper(uint32_t event, uint32_t latency, uint32_t static int coex_wifi_release_wrapper(uint32_t event) { -#if CONFIG_SW_COEXIST_ENABLE +#if CONFIG_ESP32_WIFI_SW_COEXIST_ENABLE return coex_wifi_release(event); #else return 0; @@ -423,7 +423,7 @@ static int coex_wifi_release_wrapper(uint32_t event) int IRAM_ATTR coex_bt_request_wrapper(uint32_t event, uint32_t latency, uint32_t duration) { -#if CONFIG_SW_COEXIST_ENABLE +#if CONFIG_ESP32_WIFI_SW_COEXIST_ENABLE return coex_bt_request(event, latency, duration); #else return 0; @@ -432,7 +432,7 @@ int IRAM_ATTR coex_bt_request_wrapper(uint32_t event, uint32_t latency, uint32_t int IRAM_ATTR coex_bt_release_wrapper(uint32_t event) { -#if CONFIG_SW_COEXIST_ENABLE +#if CONFIG_ESP32_WIFI_SW_COEXIST_ENABLE return coex_bt_release(event); #else return 0; @@ -441,7 +441,7 @@ int IRAM_ATTR coex_bt_release_wrapper(uint32_t event) int coex_register_bt_cb_wrapper(coex_func_cb_t cb) { -#if CONFIG_SW_COEXIST_ENABLE +#if CONFIG_ESP32_WIFI_SW_COEXIST_ENABLE return coex_register_bt_cb(cb); #else return 0; @@ -450,7 +450,7 @@ int coex_register_bt_cb_wrapper(coex_func_cb_t cb) uint32_t IRAM_ATTR coex_bb_reset_lock_wrapper(void) { -#if CONFIG_SW_COEXIST_ENABLE +#if CONFIG_ESP32_WIFI_SW_COEXIST_ENABLE return coex_bb_reset_lock(); #else return 0; @@ -459,7 +459,7 @@ uint32_t IRAM_ATTR coex_bb_reset_lock_wrapper(void) void IRAM_ATTR coex_bb_reset_unlock_wrapper(uint32_t restore) { -#if CONFIG_SW_COEXIST_ENABLE +#if CONFIG_ESP32_WIFI_SW_COEXIST_ENABLE coex_bb_reset_unlock(restore); #endif } diff --git a/components/esp_wifi/Kconfig b/components/esp_wifi/Kconfig index cea9d63b0..6aacbbcdd 100644 --- a/components/esp_wifi/Kconfig +++ b/components/esp_wifi/Kconfig @@ -1,7 +1,7 @@ menu Wi-Fi - config SW_COEXIST_ENABLE + config ESP32_WIFI_SW_COEXIST_ENABLE bool "Software controls WiFi/Bluetooth coexistence" depends on BT_ENABLED default y @@ -12,10 +12,10 @@ menu Wi-Fi If only Bluetooth is used, it is recommended to disable this option to reduce binary file size. - choice SW_COEXIST_PREFERENCE + choice ESP32_WIFI_SW_COEXIST_PREFERENCE prompt "WiFi/Bluetooth coexistence performance preference" - depends on SW_COEXIST_ENABLE - default SW_COEXIST_PREFERENCE_BALANCE + depends on ESP32_WIFI_SW_COEXIST_ENABLE + default ESP32_WIFI_SW_COEXIST_PREFERENCE_BALANCE help Choose Bluetooth/WiFi/Balance for different preference. If choose WiFi, it will make WiFi performance better. Such, keep WiFi Audio more fluent. @@ -25,23 +25,23 @@ menu Wi-Fi choose balance, the A2DP audio can play fluently, too. Except config preference in menuconfig, you can also call esp_coex_preference_set() dynamically. - config SW_COEXIST_PREFERENCE_WIFI + config ESP32_WIFI_SW_COEXIST_PREFERENCE_WIFI bool "WiFi" - config SW_COEXIST_PREFERENCE_BT + config ESP32_WIFI_SW_COEXIST_PREFERENCE_BT bool "Bluetooth(include BR/EDR and BLE)" - config SW_COEXIST_PREFERENCE_BALANCE + config ESP32_WIFI_SW_COEXIST_PREFERENCE_BALANCE bool "Balance" endchoice - config SW_COEXIST_PREFERENCE_VALUE + config ESP32_WIFI_SW_COEXIST_PREFERENCE_VALUE int - depends on SW_COEXIST_ENABLE - default 0 if SW_COEXIST_PREFERENCE_WIFI - default 1 if SW_COEXIST_PREFERENCE_BT - default 2 if SW_COEXIST_PREFERENCE_BALANCE + depends on ESP32_WIFI_SW_COEXIST_ENABLE + default 0 if ESP32_WIFI_SW_COEXIST_PREFERENCE_WIFI + default 1 if ESP32_WIFI_SW_COEXIST_PREFERENCE_BT + default 2 if ESP32_WIFI_SW_COEXIST_PREFERENCE_BALANCE config ESP32_WIFI_STATIC_RX_BUFFER_NUM int "Max number of WiFi static RX buffers" diff --git a/components/esp_wifi/sdkconfig.rename b/components/esp_wifi/sdkconfig.rename new file mode 100644 index 000000000..a9de8bd4e --- /dev/null +++ b/components/esp_wifi/sdkconfig.rename @@ -0,0 +1,9 @@ +# sdkconfig replacement configurations for deprecated options formatted as +# CONFIG_DEPRECATED_OPTION CONFIG_NEW_OPTION + +CONFIG_SW_COEXIST_ENABLE CONFIG_ESP32_WIFI_SW_COEXIST_ENABLE +CONFIG_SW_COEXIST_PREFERENCE CONFIG_ESP32_WIFI_SW_COEXIST_PREFERENCE +CONFIG_SW_COEXIST_PREFERENCE_WIFI CONFIG_ESP32_WIFI_SW_COEXIST_PREFERENCE_WIFI +CONFIG_SW_COEXIST_PREFERENCE_BT CONFIG_ESP32_WIFI_SW_COEXIST_PREFERENCE_BT +CONFIG_SW_COEXIST_PREFERENCE_BALANCE CONFIG_ESP32_WIFI_SW_COEXIST_PREFERENCE_BALANCE +CONFIG_SW_COEXIST_PREFERENCE_VALUE CONFIG_ESP32_WIFI_SW_COEXIST_PREFERENCE_VALUE diff --git a/components/esp_wifi/src/phy_init.c b/components/esp_wifi/src/phy_init.c index 2fade4e35..ba1f76745 100644 --- a/components/esp_wifi/src/phy_init.c +++ b/components/esp_wifi/src/phy_init.c @@ -165,12 +165,12 @@ esp_err_t esp_phy_rf_init(const esp_phy_init_data_t* init_data, esp_phy_calibrat } } -#if CONFIG_SW_COEXIST_ENABLE +#if CONFIG_ESP32_WIFI_SW_COEXIST_ENABLE if ((module == PHY_BT_MODULE) || (module == PHY_WIFI_MODULE)){ uint32_t phy_bt_wifi_mask = BIT(PHY_BT_MODULE) | BIT(PHY_WIFI_MODULE); if ((s_module_phy_rf_init & phy_bt_wifi_mask) == phy_bt_wifi_mask) { //both wifi & bt enabled coex_init(); - coex_preference_set(CONFIG_SW_COEXIST_PREFERENCE_VALUE); + coex_preference_set(CONFIG_ESP32_WIFI_SW_COEXIST_PREFERENCE_VALUE); coex_resume(); } } @@ -197,7 +197,7 @@ esp_err_t esp_phy_rf_deinit(phy_rf_module_t module) s_module_phy_rf_init &= ~BIT(module); esp_err_t status = ESP_OK; -#if CONFIG_SW_COEXIST_ENABLE +#if CONFIG_ESP32_WIFI_SW_COEXIST_ENABLE if ((module == PHY_BT_MODULE) || (module == PHY_WIFI_MODULE)){ if (is_both_wifi_bt_enabled == true) { coex_deinit(); @@ -246,7 +246,7 @@ esp_err_t esp_phy_rf_deinit(phy_rf_module_t module) esp_err_t esp_modem_sleep_enter(modem_sleep_module_t module) { -#if CONFIG_SW_COEXIST_ENABLE +#if CONFIG_ESP32_WIFI_SW_COEXIST_ENABLE uint32_t phy_bt_wifi_mask = BIT(PHY_BT_MODULE) | BIT(PHY_WIFI_MODULE); #endif @@ -262,7 +262,7 @@ esp_err_t esp_modem_sleep_enter(modem_sleep_module_t module) else { _lock_acquire(&s_modem_sleep_lock); s_modem_sleep_module_enter |= BIT(module); -#if CONFIG_SW_COEXIST_ENABLE +#if CONFIG_ESP32_WIFI_SW_COEXIST_ENABLE _lock_acquire(&s_phy_rf_init_lock); if (((s_module_phy_rf_init & phy_bt_wifi_mask) == phy_bt_wifi_mask) //both wifi & bt enabled && (s_modem_sleep_module_enter & (MODEM_BT_MASK | MODEM_WIFI_MASK)) != 0){ @@ -283,7 +283,7 @@ esp_err_t esp_modem_sleep_enter(modem_sleep_module_t module) esp_err_t esp_modem_sleep_exit(modem_sleep_module_t module) { -#if CONFIG_SW_COEXIST_ENABLE +#if CONFIG_ESP32_WIFI_SW_COEXIST_ENABLE uint32_t phy_bt_wifi_mask = BIT(PHY_BT_MODULE) | BIT(PHY_WIFI_MODULE); #endif @@ -305,7 +305,7 @@ esp_err_t esp_modem_sleep_exit(modem_sleep_module_t module) s_is_modem_sleep_en = false; } } -#if CONFIG_SW_COEXIST_ENABLE +#if CONFIG_ESP32_WIFI_SW_COEXIST_ENABLE _lock_acquire(&s_phy_rf_init_lock); if (((s_module_phy_rf_init & phy_bt_wifi_mask) == phy_bt_wifi_mask) //both wifi & bt enabled && (s_modem_sleep_module_enter & (MODEM_BT_MASK | MODEM_WIFI_MASK)) == 0){ From d4af5e6fff051754dcff985c214efe6b086b72e6 Mon Sep 17 00:00:00 2001 From: Roland Dobai Date: Tue, 30 Apr 2019 12:30:32 +0200 Subject: [PATCH 13/21] Rename Kconfig options (components/ethernet) --- components/ethernet/Kconfig | 12 ++++++------ components/ethernet/emac_common.h | 8 ++++---- components/ethernet/emac_main.c | 6 +++--- components/ethernet/sdkconfig.rename | 9 +++++++++ components/lwip/port/esp32/netif/ethernetif.c | 8 ++++---- examples/ethernet/iperf/sdkconfig.defaults | 2 +- tools/ldgen/samples/sdkconfig | 8 ++++---- 7 files changed, 31 insertions(+), 22 deletions(-) create mode 100644 components/ethernet/sdkconfig.rename diff --git a/components/ethernet/Kconfig b/components/ethernet/Kconfig index a5723a116..9444f78e4 100644 --- a/components/ethernet/Kconfig +++ b/components/ethernet/Kconfig @@ -1,6 +1,6 @@ menu Ethernet - config DMA_RX_BUF_NUM + config ETH_DMA_RX_BUF_NUM int "Number of DMA RX buffers" range 3 20 default 10 @@ -10,7 +10,7 @@ menu Ethernet More buffers will increase throughput. If flow ctrl is enabled, make sure this number is larger than 9. - config DMA_TX_BUF_NUM + config ETH_DMA_TX_BUF_NUM int "Number of DMA TX buffers" range 3 20 default 10 @@ -19,7 +19,7 @@ menu Ethernet These buffers are allocated dynamically. More buffers will increase throughput. - config EMAC_L2_TO_L3_RX_BUF_MODE + config ETH_EMAC_L2_TO_L3_RX_BUF_MODE bool "Enable received buffers be copied to Layer3 from Layer2" default y help @@ -30,7 +30,7 @@ menu Ethernet If this option is not selected, IP layer only uses the pointers to the DMA buffers owned by Ethernet MAC. When Ethernet MAC doesn't have any available buffers left, it will drop the incoming packets. - config EMAC_CHECK_LINK_PERIOD_MS + config ETH_CHECK_LINK_STATUS_PERIOD_MS int "Period (ms) of checking Ethernet linkup status" range 1000 5000 default 2000 @@ -38,14 +38,14 @@ menu Ethernet The emac driver uses an internal timer to check the Ethernet linkup status. Here you should choose a valid interval time. - config EMAC_TASK_PRIORITY + config ETH_EMAC_TASK_PRIORITY int "EMAC_TASK_PRIORITY" default 20 range 3 22 help Priority of Ethernet MAC task. - config EMAC_TASK_STACK_SIZE + config ETH_EMAC_TASK_STACK_SIZE int "Stack Size of EMAC Task" default 3072 range 2000 8000 diff --git a/components/ethernet/emac_common.h b/components/ethernet/emac_common.h index 64a0bf9f2..e60de6186 100644 --- a/components/ethernet/emac_common.h +++ b/components/ethernet/emac_common.h @@ -102,10 +102,10 @@ struct emac_close_cmd { int8_t err; }; -#define DMA_RX_BUF_NUM CONFIG_DMA_RX_BUF_NUM -#define DMA_TX_BUF_NUM CONFIG_DMA_TX_BUF_NUM -#define EMAC_TASK_PRIORITY CONFIG_EMAC_TASK_PRIORITY -#define EMAC_TASK_STACK_SIZE CONFIG_EMAC_TASK_STACK_SIZE +#define DMA_RX_BUF_NUM CONFIG_ETH_DMA_RX_BUF_NUM +#define DMA_TX_BUF_NUM CONFIG_ETH_DMA_TX_BUF_NUM +#define EMAC_TASK_PRIORITY CONFIG_ETH_EMAC_TASK_PRIORITY +#define EMAC_TASK_STACK_SIZE CONFIG_ETH_EMAC_TASK_STACK_SIZE #define DMA_RX_BUF_SIZE 1600 #define DMA_TX_BUF_SIZE 1600 diff --git a/components/ethernet/emac_main.c b/components/ethernet/emac_main.c index b93ea98a2..2f9feedf1 100644 --- a/components/ethernet/emac_main.c +++ b/components/ethernet/emac_main.c @@ -467,7 +467,7 @@ static uint32_t IRAM_ATTR emac_get_rxbuf_count_in_intr(void) return cnt; } -#if CONFIG_EMAC_L2_TO_L3_RX_BUF_MODE +#if CONFIG_ETH_EMAC_L2_TO_L3_RX_BUF_MODE static void emac_process_rx(void) { if (emac_config.emac_status == EMAC_RUNTIME_STOP) { @@ -649,7 +649,7 @@ static void emac_check_phy_init(void) } else { REG_CLR_BIT(EMAC_GMACCONFIG_REG, EMAC_EMACFESPEED); } -#if CONFIG_EMAC_L2_TO_L3_RX_BUF_MODE +#if CONFIG_ETH_EMAC_L2_TO_L3_RX_BUF_MODE emac_disable_flowctrl(); emac_config.emac_flow_ctrl_partner_support = false; #else @@ -768,7 +768,7 @@ void emac_link_check_func(void *pv_parameters) static bool emac_link_check_timer_init(void) { emac_timer = xTimerCreate("emac_timer", - (CONFIG_EMAC_CHECK_LINK_PERIOD_MS / portTICK_PERIOD_MS), + (CONFIG_ETH_CHECK_LINK_STATUS_PERIOD_MS / portTICK_PERIOD_MS), pdTRUE, NULL, emac_link_check_func); diff --git a/components/ethernet/sdkconfig.rename b/components/ethernet/sdkconfig.rename new file mode 100644 index 000000000..d70ede315 --- /dev/null +++ b/components/ethernet/sdkconfig.rename @@ -0,0 +1,9 @@ +# sdkconfig replacement configurations for deprecated options formatted as +# CONFIG_DEPRECATED_OPTION CONFIG_NEW_OPTION + +CONFIG_DMA_RX_BUF_NUM CONFIG_ETH_DMA_RX_BUF_NUM +CONFIG_DMA_TX_BUF_NUM CONFIG_ETH_DMA_TX_BUF_NUM +CONFIG_EMAC_L2_TO_L3_RX_BUF_MODE CONFIG_ETH_EMAC_L2_TO_L3_RX_BUF_MODE +CONFIG_EMAC_CHECK_LINK_PERIOD_MS CONFIG_ETH_CHECK_LINK_STATUS_PERIOD_MS +CONFIG_EMAC_TASK_PRIORITY CONFIG_ETH_EMAC_TASK_PRIORITY +CONFIG_EMAC_TASK_STACK_SIZE CONFIG_ETH_EMAC_TASK_STACK_SIZE diff --git a/components/lwip/port/esp32/netif/ethernetif.c b/components/lwip/port/esp32/netif/ethernetif.c index 48693a934..d61653fca 100644 --- a/components/lwip/port/esp32/netif/ethernetif.c +++ b/components/lwip/port/esp32/netif/ethernetif.c @@ -83,7 +83,7 @@ ethernet_low_level_init(struct netif *netif) #endif #endif -#ifndef CONFIG_EMAC_L2_TO_L3_RX_BUF_MODE +#ifndef CONFIG_ETH_EMAC_L2_TO_L3_RX_BUF_MODE netif->l2_buffer_free_notify = esp_eth_free_rx_buf; #endif } @@ -150,7 +150,7 @@ ethernet_low_level_output(struct netif *netif, struct pbuf *p) * @param buffer the ethernet buffer * @param len the len of buffer * - * @note When CONFIG_EMAC_L2_TO_L3_RX_BUF_MODE is enabled, a copy of buffer + * @note When CONFIG_ETH_EMAC_L2_TO_L3_RX_BUF_MODE is enabled, a copy of buffer * will be made for high layer (LWIP) and ethernet is responsible for * freeing the buffer. Otherwise, high layer and ethernet share the * same buffer and high layer is responsible for freeing the buffer. @@ -161,7 +161,7 @@ ethernetif_input(struct netif *netif, void *buffer, uint16_t len) struct pbuf *p; if(buffer== NULL || !netif_is_up(netif)) { -#ifndef CONFIG_EMAC_L2_TO_L3_RX_BUF_MODE +#ifndef CONFIG_ETH_EMAC_L2_TO_L3_RX_BUF_MODE if (buffer) { esp_eth_free_rx_buf(buffer); } @@ -169,7 +169,7 @@ ethernetif_input(struct netif *netif, void *buffer, uint16_t len) return; } -#ifdef CONFIG_EMAC_L2_TO_L3_RX_BUF_MODE +#ifdef CONFIG_ETH_EMAC_L2_TO_L3_RX_BUF_MODE p = pbuf_alloc(PBUF_RAW, len, PBUF_RAM); if (p == NULL) { return; diff --git a/examples/ethernet/iperf/sdkconfig.defaults b/examples/ethernet/iperf/sdkconfig.defaults index 74d1647a7..a07acc2dd 100644 --- a/examples/ethernet/iperf/sdkconfig.defaults +++ b/examples/ethernet/iperf/sdkconfig.defaults @@ -23,5 +23,5 @@ CONFIG_ESP32_DEFAULT_CPU_FREQ_240=y CONFIG_ESP32_DEFAULT_CPU_FREQ_MHZ=240 # Ethernet -CONFIG_EMAC_L2_TO_L3_RX_BUF_MODE=y +CONFIG_ETH_EMAC_L2_TO_L3_RX_BUF_MODE=y diff --git a/tools/ldgen/samples/sdkconfig b/tools/ldgen/samples/sdkconfig index c6d56b713..8fa6cf3c0 100644 --- a/tools/ldgen/samples/sdkconfig +++ b/tools/ldgen/samples/sdkconfig @@ -243,10 +243,10 @@ CONFIG_ADC_CAL_LUT_ENABLE=y # # Ethernet # -CONFIG_DMA_RX_BUF_NUM=10 -CONFIG_DMA_TX_BUF_NUM=10 -CONFIG_EMAC_L2_TO_L3_RX_BUF_MODE= -CONFIG_EMAC_TASK_PRIORITY=20 +CONFIG_ETH_DMA_RX_BUF_NUM=10 +CONFIG_ETH_DMA_TX_BUF_NUM=10 +CONFIG_ETH_EMAC_L2_TO_L3_RX_BUF_MODE= +CONFIG_ETH_EMAC_TASK_PRIORITY=20 # # FAT Filesystem support From 0ae53691bae8b841d35ed0d5a4d43e1f1a873d2a Mon Sep 17 00:00:00 2001 From: Roland Dobai Date: Tue, 30 Apr 2019 12:51:55 +0200 Subject: [PATCH 14/21] Rename Kconfig options (components/esp32) --- Kconfig | 6 + components/app_trace/Kconfig | 4 +- components/bootloader/Kconfig.projbuild | 2 +- .../bootloader_support/src/bootloader_clock.c | 2 +- .../bootloader_support/src/bootloader_init.c | 18 +- components/bt/Kconfig | 2 +- components/driver/test/test_spi_master.c | 2 +- components/driver/test/test_spi_slave.c | 4 +- components/driver/uart.c | 2 +- components/esp32/Kconfig | 421 +++--------------- components/esp32/brownout.c | 6 +- components/esp32/clk.c | 18 +- components/esp32/cpu_start.c | 38 +- components/esp32/dport_panic_highint_hdl.S | 2 +- components/esp32/esp_adapter.c | 12 +- components/esp32/gdbstub.c | 16 +- components/esp32/include/esp_sleep.h | 4 +- components/esp32/int_wdt.c | 12 +- components/esp32/ld/esp32.ld | 6 +- components/esp32/panic.c | 6 +- components/esp32/sdkconfig.rename | 38 ++ components/esp32/sleep_modes.c | 18 +- components/esp32/spiram.c | 2 +- components/esp32/spiram_psram.c | 6 +- components/esp32/test/test_4mpsram.c | 6 +- components/esp32/test/test_dport.c | 4 +- components/esp32/test/test_pm.c | 2 +- components/esp32/test/test_sleep.c | 6 +- .../esp32/test/test_spiram_cache_flush.c | 4 +- components/esp_common/Kconfig | 219 +++++++++ components/esp_common/include/esp_system.h | 2 +- components/esp_common/include/esp_task.h | 6 +- components/esp_common/sdkconfig.rename | 28 ++ components/esp_common/src/ipc.c | 2 +- components/esp_event/default_event_loop.c | 2 +- components/esp_event/test/test_event.c | 18 +- components/esp_wifi/CMakeLists.txt | 6 +- components/esp_wifi/Kconfig | 16 +- components/esp_wifi/component.mk | 2 +- components/esp_wifi/src/phy_init.c | 6 +- components/ethernet/emac_main.c | 2 +- components/freertos/port.c | 4 +- components/freertos/portmux_impl.h | 6 +- components/freertos/test/test_spinlocks.c | 2 +- components/mbedtls/Kconfig | 2 +- components/newlib/Kconfig | 72 +++ components/newlib/test/test_newlib.c | 4 +- components/newlib/test/test_time.c | 2 +- components/pthread/pthread.c | 4 +- components/sdmmc/test/test_sd.c | 2 +- components/soc/esp32/rtc_clk.c | 8 +- components/soc/esp32/soc_memory_layout.c | 10 +- components/soc/esp32/test/test_rtc_clk.c | 10 +- .../soc/include/soc/soc_memory_layout.h | 2 +- components/spi_flash/flash_mmap.c | 4 +- components/spi_flash/test/test_read_write.c | 4 +- components/ulp/ld/esp32.ulp.ld | 2 +- components/ulp/test/test_ulp.c | 50 +-- components/ulp/ulp.c | 4 +- components/ulp/ulp_macro.c | 2 +- components/unity/unity_port_esp32.c | 2 +- components/vfs/test/test_vfs_fd.c | 2 +- components/vfs/test/test_vfs_uart.c | 14 +- docs/en/api-guides/event-handling.rst | 2 +- docs/en/api-guides/fatal-errors.rst | 4 +- docs/en/api-reference/system/ipc.rst | 2 +- docs/en/api-reference/system/system.rst | 2 +- docs/en/api-reference/system/wdts.rst | 6 +- .../throughput_client/sdkconfig.defaults | 4 +- .../throughput_server/sdkconfig.defaults | 4 +- .../protocol_examples_common/stdin_out.c | 4 +- .../ethernet/iperf/main/iperf_example_main.c | 8 +- examples/ethernet/iperf/sdkconfig.defaults | 2 +- .../i2c_tools/main/i2ctools_example_main.c | 8 +- .../i2c/i2c_tools/sdkconfig.defaults | 2 +- .../asio/chat_client/sdkconfig.defaults | 2 +- .../asio/chat_server/sdkconfig.defaults | 2 +- .../asio/tcp_echo_server/sdkconfig.defaults | 2 +- .../asio/udp_echo_server/sdkconfig.defaults | 2 +- .../main/semihost_vfs_example_main.c | 2 +- .../components/cmd_system/cmd_system.c | 8 +- .../console/main/console_example_main.c | 8 +- examples/system/console/sdkconfig.defaults | 2 +- .../deep_sleep/main/deep_sleep_example_main.c | 8 +- examples/system/deep_sleep/sdkconfig.defaults | 6 +- examples/system/himem/sdkconfig.defaults | 2 +- .../main/light_sleep_example_main.c | 2 +- .../main/task_watchdog_example_main.c | 4 +- examples/system/ulp/sdkconfig.defaults | 4 +- examples/system/ulp_adc/sdkconfig.defaults | 4 +- .../system/unit_test/test/sdkconfig.defaults | 2 +- examples/wifi/iperf/main/iperf_example_main.c | 4 +- examples/wifi/iperf/sdkconfig.defaults | 6 +- examples/wifi/iperf/sdkconfig.defaults.00 | 6 +- examples/wifi/iperf/sdkconfig.defaults.01 | 6 +- examples/wifi/iperf/sdkconfig.defaults.02 | 6 +- examples/wifi/iperf/sdkconfig.defaults.03 | 6 +- examples/wifi/iperf/sdkconfig.defaults.04 | 6 +- examples/wifi/iperf/sdkconfig.defaults.05 | 6 +- examples/wifi/iperf/sdkconfig.defaults.06 | 6 +- examples/wifi/iperf/sdkconfig.defaults.07 | 6 +- examples/wifi/iperf/sdkconfig.defaults.99 | 6 +- .../main/simple_sniffer_example_main.c | 4 +- .../wifi/simple_sniffer/sdkconfig.defaults | 2 +- tools/check_kconfigs.py | 2 +- tools/ci/test_build_system_cmake.sh | 4 +- tools/ldgen/samples/sdkconfig | 80 ++-- tools/unit-test-app/README.md | 2 +- tools/unit-test-app/configs/psram | 2 +- tools/unit-test-app/configs/psram_2 | 2 +- tools/unit-test-app/configs/psram_8m | 2 +- tools/unit-test-app/configs/psram_hspi | 2 +- tools/unit-test-app/configs/psram_vspi | 2 +- tools/unit-test-app/sdkconfig.defaults | 4 +- .../unit-test-app/tools/ConfigDependency.yml | 2 +- tools/unit-test-app/tools/UnitTestParser.py | 2 +- 116 files changed, 773 insertions(+), 701 deletions(-) create mode 100644 components/esp32/sdkconfig.rename create mode 100644 components/esp_common/Kconfig create mode 100644 components/esp_common/sdkconfig.rename create mode 100644 components/newlib/Kconfig diff --git a/Kconfig b/Kconfig index dd61783ab..e4c1a89b1 100644 --- a/Kconfig +++ b/Kconfig @@ -4,6 +4,12 @@ # mainmenu "Espressif IoT Development Framework Configuration" + # Hidden option to support checking for this specific target in C code and Kconfig files + config IDF_TARGET_ESP32 + bool + default "y" if IDF_TARGET="esp32" + default "n" + config IDF_CMAKE bool option env="IDF_CMAKE" diff --git a/components/app_trace/Kconfig b/components/app_trace/Kconfig index 67387c661..adfe6495f 100644 --- a/components/app_trace/Kconfig +++ b/components/app_trace/Kconfig @@ -16,8 +16,8 @@ menu "Application Level Tracing" config ESP32_APPTRACE_ENABLE bool depends on !ESP32_TRAX - select MEMMAP_TRACEMEM - select MEMMAP_TRACEMEM_TWOBANKS + select ESP32_MEMMAP_TRACEMEM + select ESP32_MEMMAP_TRACEMEM_TWOBANKS default n help Enables/disable application tracing module. diff --git a/components/bootloader/Kconfig.projbuild b/components/bootloader/Kconfig.projbuild index 80973473d..c1242c297 100644 --- a/components/bootloader/Kconfig.projbuild +++ b/components/bootloader/Kconfig.projbuild @@ -140,7 +140,7 @@ menu "Bootloader config" source for slow_clk - and ends calling app_main. Re-set timeout is needed due to WDT uses a SLOW_CLK clock source. After changing a frequency slow_clk a time of WDT needs to re-set for new frequency. - slow_clk depends on ESP32_RTC_CLOCK_SOURCE (INTERNAL_RC or EXTERNAL_CRYSTAL). + slow_clk depends on ESP32_RTC_CLC_SRC (INTERNAL_RC or EXTERNAL_CRYSTAL). config BOOTLOADER_WDT_DISABLE_IN_USER_CODE bool "Allows RTC watchdog disable in user code" diff --git a/components/bootloader_support/src/bootloader_clock.c b/components/bootloader_support/src/bootloader_clock.c index 5bf283c51..2ab92d2af 100644 --- a/components/bootloader_support/src/bootloader_clock.c +++ b/components/bootloader_support/src/bootloader_clock.c @@ -53,7 +53,7 @@ void bootloader_clock_configure() * part of the start up time by enabling 32k XTAL early. * App startup code will wait until the oscillator has started up. */ -#ifdef CONFIG_ESP32_RTC_CLOCK_SOURCE_EXTERNAL_CRYSTAL +#ifdef CONFIG_ESP32_RTC_CLK_SRC_EXT_CRYS if (!rtc_clk_32k_enabled()) { rtc_clk_32k_bootstrap(CONFIG_ESP32_RTC_XTAL_BOOTSTRAP_CYCLES); } diff --git a/components/bootloader_support/src/bootloader_init.c b/components/bootloader_support/src/bootloader_init.c index 0ab814516..b6bca0b2e 100644 --- a/components/bootloader_support/src/bootloader_init.c +++ b/components/bootloader_support/src/bootloader_init.c @@ -412,11 +412,11 @@ static void IRAM_ATTR flash_gpio_configure(const esp_image_header_t* pfhdr) static void uart_console_configure(void) { -#if CONFIG_CONSOLE_UART_NONE +#if CONFIG_ESP_CONSOLE_UART_NONE ets_install_putc1(NULL); ets_install_putc2(NULL); -#else // CONFIG_CONSOLE_UART_NONE - const int uart_num = CONFIG_CONSOLE_UART_NUM; +#else // CONFIG_ESP_CONSOLE_UART_NONE + const int uart_num = CONFIG_ESP_CONSOLE_UART_NUM; uartAttach(); ets_install_uart_printf(); @@ -424,10 +424,10 @@ static void uart_console_configure(void) // Wait for UART FIFO to be empty. uart_tx_wait_idle(0); -#if CONFIG_CONSOLE_UART_CUSTOM +#if CONFIG_ESP_CONSOLE_UART_CUSTOM // Some constants to make the following code less upper-case - const int uart_tx_gpio = CONFIG_CONSOLE_UART_TX_GPIO; - const int uart_rx_gpio = CONFIG_CONSOLE_UART_RX_GPIO; + const int uart_tx_gpio = CONFIG_ESP_CONSOLE_UART_TX_GPIO; + const int uart_rx_gpio = CONFIG_ESP_CONSOLE_UART_RX_GPIO; // Switch to the new UART (this just changes UART number used for // ets_printf in ROM code). uart_tx_switch(uart_num); @@ -450,13 +450,13 @@ static void uart_console_configure(void) gpio_matrix_out(uart_tx_gpio, tx_idx, 0, 0); gpio_matrix_in(uart_rx_gpio, rx_idx, 0); } -#endif // CONFIG_CONSOLE_UART_CUSTOM +#endif // CONFIG_ESP_CONSOLE_UART_CUSTOM // Set configured UART console baud rate - const int uart_baud = CONFIG_CONSOLE_UART_BAUDRATE; + const int uart_baud = CONFIG_ESP_CONSOLE_UART_BAUDRATE; uart_div_modify(uart_num, (rtc_clk_apb_freq_get() << 4) / uart_baud); -#endif // CONFIG_CONSOLE_UART_NONE +#endif // CONFIG_ESP_CONSOLE_UART_NONE } static void wdt_reset_cpu0_info_enable(void) diff --git a/components/bt/Kconfig b/components/bt/Kconfig index 0bb8ad47d..cc3066f35 100644 --- a/components/bt/Kconfig +++ b/components/bt/Kconfig @@ -173,7 +173,7 @@ menu Bluetooth config BTDM_LPCLK_SEL_EXT_32K_XTAL bool "External 32kHz crystal" - depends on ESP32_RTC_CLOCK_SOURCE_EXTERNAL_CRYSTAL + depends on ESP32_RTC_CLK_SRC_EXT_CRYS endchoice endmenu diff --git a/components/driver/test/test_spi_master.c b/components/driver/test/test_spi_master.c index ef34f978f..82b9fcc9e 100644 --- a/components/driver/test/test_spi_master.c +++ b/components/driver/test/test_spi_master.c @@ -544,7 +544,7 @@ static const uint8_t data_drom[320+3] = { TEST_CASE("SPI Master DMA test, TX and RX in different regions", "[spi]") { -#ifdef CONFIG_SPIRAM_SUPPORT +#ifdef CONFIG_ESP32_SPIRAM_SUPPORT //test psram if enabled ESP_LOGI(TAG, "testing PSRAM..."); uint32_t* data_malloc = (uint32_t*)heap_caps_malloc(324, MALLOC_CAP_SPIRAM); diff --git a/components/driver/test/test_spi_slave.c b/components/driver/test/test_spi_slave.c index 2137fc3c6..668b78d29 100644 --- a/components/driver/test/test_spi_slave.c +++ b/components/driver/test/test_spi_slave.c @@ -11,7 +11,7 @@ #include "sdkconfig.h" #include "test/test_common_spi.h" -#ifndef CONFIG_SPIRAM_SUPPORT +#ifndef CONFIG_ESP32_SPIRAM_SUPPORT //This test should be removed once the timing test is merged. @@ -140,4 +140,4 @@ TEST_CASE("test slave send unaligned","[spi]") ESP_LOGI(MASTER_TAG, "test passed."); } -#endif // !CONFIG_SPIRAM_SUPPORT +#endif // !CONFIG_ESP32_SPIRAM_SUPPORT diff --git a/components/driver/uart.c b/components/driver/uart.c index b8f607445..411279e22 100644 --- a/components/driver/uart.c +++ b/components/driver/uart.c @@ -1452,7 +1452,7 @@ esp_err_t uart_driver_delete(uart_port_t uart_num) free(p_uart_obj[uart_num]); p_uart_obj[uart_num] = NULL; - if (uart_num != CONFIG_CONSOLE_UART_NUM ) { + if (uart_num != CONFIG_ESP_CONSOLE_UART_NUM ) { if(uart_num == UART_NUM_0) { periph_module_disable(PERIPH_UART0_MODULE); } else if(uart_num == UART_NUM_1) { diff --git a/components/esp32/Kconfig b/components/esp32/Kconfig index 643f241de..1bd63a2c0 100644 --- a/components/esp32/Kconfig +++ b/components/esp32/Kconfig @@ -1,11 +1,5 @@ menu "ESP32-specific" - # Hidden option to support checking for this specific target in C code and Kconfig files - config IDF_TARGET_ESP32 - bool - default "y" if IDF_TARGET="esp32" - default "n" - choice ESP32_DEFAULT_CPU_FREQ_MHZ prompt "CPU frequency" default ESP32_DEFAULT_CPU_FREQ_160 @@ -26,7 +20,7 @@ menu "ESP32-specific" default 160 if ESP32_DEFAULT_CPU_FREQ_160 default 240 if ESP32_DEFAULT_CPU_FREQ_240 - config SPIRAM_SUPPORT + config ESP32_SPIRAM_SUPPORT bool "Support for external, SPI-connected RAM" default "n" help @@ -34,7 +28,7 @@ menu "ESP32-specific" main SPI flash chip. menu "SPI RAM config" - depends on SPIRAM_SUPPORT + depends on ESP32_SPIRAM_SUPPORT config SPIRAM_BOOT_INIT bool "Initialize SPI RAM when booting the ESP32" @@ -175,7 +169,7 @@ menu "ESP32-specific" from the non-preferred region instead, so malloc() will not suddenly fail when either internal or external memory is full. - config WIFI_LWIP_ALLOCATION_FROM_SPIRAM_FIRST + config SPIRAM_TRY_ALLOCATE_WIFI_LWIP bool "Try to allocate memories of WiFi and LWIP in SPIRAM firstly. If failed, allocate internal memory" depends on SPIRAM_USE_CAPS_ALLOC || SPIRAM_USE_MALLOC default "n" @@ -219,7 +213,7 @@ menu "ESP32-specific" config SPIRAM_ALLOW_BSS_SEG_EXTERNAL_MEMORY bool "Allow .bss segment placed in external memory" default n - depends on SPIRAM_SUPPORT + depends on ESP32_SPIRAM_SUPPORT help If enabled the option,and add EXT_RAM_ATTR defined your variable,then your variable will be placed in PSRAM instead of internal memory, and placed most of variables of lwip,net802.11,pp,bluedroid library @@ -239,9 +233,9 @@ menu "ESP32-specific" bool "VSPI host (SPI3)" endchoice - config PICO_PSRAM_CS_IO + config SPIRAM_PICO_PSRAM_CS_IO int "PSRAM CS IO for ESP32-PICO chip" - depends on SPIRAM_SUPPORT + depends on ESP32_SPIRAM_SUPPORT range 0 33 default 10 help @@ -250,18 +244,18 @@ menu "ESP32-specific" endmenu - config MEMMAP_TRACEMEM + config ESP32_MEMMAP_TRACEMEM bool default "n" - config MEMMAP_TRACEMEM_TWOBANKS + config ESP32_MEMMAP_TRACEMEM_TWOBANKS bool default "n" config ESP32_TRAX bool "Use TRAX tracing feature" default "n" - select MEMMAP_TRACEMEM + select ESP32_MEMMAP_TRACEMEM help The ESP32 contains a feature which allows you to trace the execution path the processor has taken through the program. This is stored in a chunk of 32K (16K for single-processor) @@ -272,7 +266,7 @@ menu "ESP32-specific" bool "Reserve memory for tracing both pro as well as app cpu execution" default "n" depends on ESP32_TRAX && !FREERTOS_UNICORE - select MEMMAP_TRACEMEM_TWOBANKS + select ESP32_MEMMAP_TRACEMEM_TWOBANKS help The ESP32 contains a feature which allows you to trace the execution path the processor has taken through the program. This is stored in a chunk of 32K (16K for single-processor) @@ -280,15 +274,15 @@ menu "ESP32-specific" what this is. # Memory to reverse for trace, used in linker script - config TRACEMEM_RESERVE_DRAM + config ESP32_TRACEMEM_RESERVE_DRAM hex - default 0x8000 if MEMMAP_TRACEMEM && MEMMAP_TRACEMEM_TWOBANKS - default 0x4000 if MEMMAP_TRACEMEM && !MEMMAP_TRACEMEM_TWOBANKS + default 0x8000 if ESP32_MEMMAP_TRACEMEM && ESP32_MEMMAP_TRACEMEM_TWOBANKS + default 0x4000 if ESP32_MEMMAP_TRACEMEM && !ESP32_MEMMAP_TRACEMEM_TWOBANKS default 0x0 - choice NUMBER_OF_UNIVERSAL_MAC_ADDRESS + choice ESP32_UNIVERSAL_MAC_ADDRESSES bool "Number of universally administered (by IEEE) MAC address" - default FOUR_UNIVERSAL_MAC_ADDRESS + default ESP32_UNIVERSAL_MAC_ADDRESSES_FOUR help Configure the number of universally administered (by IEEE) MAC addresses. During initialisation, MAC addresses for each network interface are generated or derived from a @@ -305,195 +299,19 @@ menu "ESP32-specific" a custom universal MAC address range, the correct setting will depend on the allocation of MAC addresses in this range (either 2 or 4 per device.) - config TWO_UNIVERSAL_MAC_ADDRESS + config ESP32_UNIVERSAL_MAC_ADDRESSES_TWO bool "Two" - config FOUR_UNIVERSAL_MAC_ADDRESS + config ESP32_UNIVERSAL_MAC_ADDRESSES_FOUR bool "Four" endchoice - config NUMBER_OF_UNIVERSAL_MAC_ADDRESS + config ESP32_UNIVERSAL_MAC_ADDRESSES int - default 2 if TWO_UNIVERSAL_MAC_ADDRESS - default 4 if FOUR_UNIVERSAL_MAC_ADDRESS + default 2 if ESP32_UNIVERSAL_MAC_ADDRESSES_TWO + default 4 if ESP32_UNIVERSAL_MAC_ADDRESSES_FOUR - config SYSTEM_EVENT_QUEUE_SIZE - int "System event queue size" - default 32 - help - Config system event queue size in different application. - config SYSTEM_EVENT_TASK_STACK_SIZE - int "Event loop task stack size" - default 2304 - help - Config system event task stack size in different application. - - config MAIN_TASK_STACK_SIZE - int "Main task stack size" - default 3584 - help - Configure the "main task" stack size. This is the stack of the task - which calls app_main(). If app_main() returns then this task is deleted - and its stack memory is freed. - - config IPC_TASK_STACK_SIZE - int "Inter-Processor Call (IPC) task stack size" - default 1024 - range 512 65536 if !ESP32_APPTRACE_ENABLE - range 2048 65536 if ESP32_APPTRACE_ENABLE - help - Configure the IPC tasks stack size. One IPC task runs on each core - (in dual core mode), and allows for cross-core function calls. - - See IPC documentation for more details. - - The default stack size should be enough for most common use cases. - It can be shrunk if you are sure that you do not use any custom - IPC functionality. - - config TIMER_TASK_STACK_SIZE - int "High-resolution timer task stack size" - default 3584 - range 2048 65536 - help - Configure the stack size of esp_timer/ets_timer task. This task is used - to dispatch callbacks of timers created using ets_timer and esp_timer - APIs. If you are seing stack overflow errors in timer task, increase - this value. - - Note that this is not the same as FreeRTOS timer task. To configure - FreeRTOS timer task size, see "FreeRTOS timer task stack size" option - in "FreeRTOS" menu. - - choice NEWLIB_STDOUT_LINE_ENDING - prompt "Line ending for UART output" - default NEWLIB_STDOUT_LINE_ENDING_CRLF - help - This option allows configuring the desired line endings sent to UART - when a newline ('\n', LF) appears on stdout. - Three options are possible: - - CRLF: whenever LF is encountered, prepend it with CR - - LF: no modification is applied, stdout is sent as is - - CR: each occurence of LF is replaced with CR - - This option doesn't affect behavior of the UART driver (drivers/uart.h). - - config NEWLIB_STDOUT_LINE_ENDING_CRLF - bool "CRLF" - config NEWLIB_STDOUT_LINE_ENDING_LF - bool "LF" - config NEWLIB_STDOUT_LINE_ENDING_CR - bool "CR" - endchoice - - choice NEWLIB_STDIN_LINE_ENDING - prompt "Line ending for UART input" - default NEWLIB_STDIN_LINE_ENDING_CR - help - This option allows configuring which input sequence on UART produces - a newline ('\n', LF) on stdin. - Three options are possible: - - CRLF: CRLF is converted to LF - - LF: no modification is applied, input is sent to stdin as is - - CR: each occurence of CR is replaced with LF - - This option doesn't affect behavior of the UART driver (drivers/uart.h). - - config NEWLIB_STDIN_LINE_ENDING_CRLF - bool "CRLF" - config NEWLIB_STDIN_LINE_ENDING_LF - bool "LF" - config NEWLIB_STDIN_LINE_ENDING_CR - bool "CR" - endchoice - - config NEWLIB_NANO_FORMAT - bool "Enable 'nano' formatting options for printf/scanf family" - default n - help - ESP32 ROM contains parts of newlib C library, including printf/scanf family - of functions. These functions have been compiled with so-called "nano" - formatting option. This option doesn't support 64-bit integer formats and C99 - features, such as positional arguments. - - For more details about "nano" formatting option, please see newlib readme file, - search for '--enable-newlib-nano-formatted-io': - https://sourceware.org/newlib/README - - If this option is enabled, build system will use functions available in - ROM, reducing the application binary size. Functions available in ROM run - faster than functions which run from flash. Functions available in ROM can - also run when flash instruction cache is disabled. - - If you need 64-bit integer formatting support or C99 features, keep this - option disabled. - - choice CONSOLE_UART - prompt "UART for console output" - default CONSOLE_UART_DEFAULT - help - Select whether to use UART for console output (through stdout and stderr). - - - Default is to use UART0 on pins GPIO1(TX) and GPIO3(RX). - - If "Custom" is selected, UART0 or UART1 can be chosen, - and any pins can be selected. - - If "None" is selected, there will be no console output on any UART, except - for initial output from ROM bootloader. This output can be further suppressed by - bootstrapping GPIO13 pin to low logic level. - - config CONSOLE_UART_DEFAULT - bool "Default: UART0, TX=GPIO1, RX=GPIO3" - config CONSOLE_UART_CUSTOM - bool "Custom" - config CONSOLE_UART_NONE - bool "None" - endchoice - - choice CONSOLE_UART_NUM - prompt "UART peripheral to use for console output (0-1)" - depends on CONSOLE_UART_CUSTOM - default CONSOLE_UART_CUSTOM_NUM_0 - help - Due of a ROM bug, UART2 is not supported for console output - via ets_printf. - - config CONSOLE_UART_CUSTOM_NUM_0 - bool "UART0" - config CONSOLE_UART_CUSTOM_NUM_1 - bool "UART1" - endchoice - - config CONSOLE_UART_NUM - int - default 0 if CONSOLE_UART_DEFAULT || CONSOLE_UART_NONE - default 0 if CONSOLE_UART_CUSTOM_NUM_0 - default 1 if CONSOLE_UART_CUSTOM_NUM_1 - - config CONSOLE_UART_TX_GPIO - int "UART TX on GPIO#" - depends on CONSOLE_UART_CUSTOM - range 0 33 - default 19 - - config CONSOLE_UART_RX_GPIO - int "UART RX on GPIO#" - depends on CONSOLE_UART_CUSTOM - range 0 39 - default 21 - - config CONSOLE_UART_BAUDRATE - int "UART console baud rate" - depends on !CONSOLE_UART_NONE - default 115200 - range 1200 4000000 - - config ULP_COPROC_ENABLED + config ESP32_ULP_COPROC_ENABLED bool "Enable Ultra Low Power (ULP) Coprocessor" default "n" help @@ -501,13 +319,13 @@ menu "ESP32-specific" If this option is enabled, further coprocessor configuration will appear in the Components menu. - config ULP_COPROC_RESERVE_MEM + config ESP32_ULP_COPROC_RESERVE_MEM int - prompt "RTC slow memory reserved for coprocessor" if ULP_COPROC_ENABLED - default 512 if ULP_COPROC_ENABLED - range 32 8192 if ULP_COPROC_ENABLED - default 0 if !ULP_COPROC_ENABLED - range 0 0 if !ULP_COPROC_ENABLED + prompt "RTC slow memory reserved for coprocessor" if ESP32_ULP_COPROC_ENABLED + default 512 if ESP32_ULP_COPROC_ENABLED + range 32 8192 if ESP32_ULP_COPROC_ENABLED + default 0 if !ESP32_ULP_COPROC_ENABLED + range 0 0 if !ESP32_ULP_COPROC_ENABLED help Bytes of memory to reserve for ULP coprocessor firmware & data. @@ -544,23 +362,6 @@ menu "ESP32-specific" of the crash. endchoice - config GDBSTUB_SUPPORT_TASKS - bool "GDBStub: enable listing FreeRTOS tasks" - default y - depends on ESP32_PANIC_GDBSTUB - help - If enabled, GDBStub can supply the list of FreeRTOS tasks to GDB. - Thread list can be queried from GDB using 'info threads' command. - Note that if GDB task lists were corrupted, this feature may not work. - If GDBStub fails, try disabling this feature. - - config GDBSTUB_MAX_TASKS - int "GDBStub: maximum number of tasks supported" - default 32 - depends on GDBSTUB_SUPPORT_TASKS - help - Set the number of tasks which GDB Stub will support. - config ESP32_DEBUG_OCDAWARE bool "Make exception and panic handlers JTAG/OCD aware" default y @@ -576,78 +377,7 @@ menu "ESP32-specific" Debug stubs are used by OpenOCD to execute pre-compiled onboard code which does some useful debugging, e.g. GCOV data dump. - config INT_WDT - bool "Interrupt watchdog" - default y - help - This watchdog timer can detect if the FreeRTOS tick interrupt has not been called for a certain time, - either because a task turned off interrupts and did not turn them on for a long time, or because an - interrupt handler did not return. It will try to invoke the panic handler first and failing that - reset the SoC. - - config INT_WDT_TIMEOUT_MS - int "Interrupt watchdog timeout (ms)" - depends on INT_WDT - default 300 if !SPIRAM_SUPPORT - default 800 if SPIRAM_SUPPORT - range 10 10000 - help - The timeout of the watchdog, in miliseconds. Make this higher than the FreeRTOS tick rate. - - config INT_WDT_CHECK_CPU1 - bool "Also watch CPU1 tick interrupt" - depends on INT_WDT && !FREERTOS_UNICORE - default y - help - Also detect if interrupts on CPU 1 are disabled for too long. - - config TASK_WDT - bool "Initialize Task Watchdog Timer on startup" - default y - help - The Task Watchdog Timer can be used to make sure individual tasks are still - running. Enabling this option will cause the Task Watchdog Timer to be - initialized automatically at startup. The Task Watchdog timer can be - initialized after startup as well (see Task Watchdog Timer API Reference) - - config TASK_WDT_PANIC - bool "Invoke panic handler on Task Watchdog timeout" - depends on TASK_WDT - default n - help - If this option is enabled, the Task Watchdog Timer will be configured to - trigger the panic handler when it times out. This can also be configured - at run time (see Task Watchdog Timer API Reference) - - config TASK_WDT_TIMEOUT_S - int "Task Watchdog timeout period (seconds)" - depends on TASK_WDT - range 1 60 - default 5 - help - Timeout period configuration for the Task Watchdog Timer in seconds. - This is also configurable at run time (see Task Watchdog Timer API Reference) - - config TASK_WDT_CHECK_IDLE_TASK_CPU0 - bool "Watch CPU0 Idle Task" - depends on TASK_WDT - default y - help - If this option is enabled, the Task Watchdog Timer will watch the CPU0 - Idle Task. Having the Task Watchdog watch the Idle Task allows for detection - of CPU starvation as the Idle Task not being called is usually a symptom of - CPU starvation. Starvation of the Idle Task is detrimental as FreeRTOS household - tasks depend on the Idle Task getting some runtime every now and then. - - config TASK_WDT_CHECK_IDLE_TASK_CPU1 - bool "Watch CPU1 Idle Task" - depends on TASK_WDT && !FREERTOS_UNICORE - default y - help - If this option is enabled, the Task Wtachdog Timer will wach the CPU1 - Idle Task. - - config BROWNOUT_DET + config ESP32_BROWNOUT_DET #The brownout detector code is disabled (by making it depend on a nonexisting symbol) because the current #revision of ESP32 silicon has a bug in the brown-out detector, rendering it unusable for resetting the CPU. bool "Hardware brownout detect & reset" @@ -657,9 +387,9 @@ menu "ESP32-specific" a specific value. If this happens, it will reset the chip in order to prevent unintended behaviour. - choice BROWNOUT_DET_LVL_SEL + choice ESP32_BROWNOUT_DET_LVL_SEL prompt "Brownout voltage level" - depends on BROWNOUT_DET + depends on ESP32_BROWNOUT_DET default BROWNOUT_DET_LVL_SEL_25 help The brownout detector will reset the chip when the supply voltage is approximately @@ -668,40 +398,40 @@ menu "ESP32-specific" #The voltage levels here are estimates, more work needs to be done to figure out the exact voltages #of the brownout threshold levels. - config BROWNOUT_DET_LVL_SEL_0 + config ESP32_BROWNOUT_DET_LVL_SEL_0 bool "2.43V +/- 0.05" - config BROWNOUT_DET_LVL_SEL_1 + config ESP32_BROWNOUT_DET_LVL_SEL_1 bool "2.48V +/- 0.05" - config BROWNOUT_DET_LVL_SEL_2 + config ESP32_BROWNOUT_DET_LVL_SEL_2 bool "2.58V +/- 0.05" - config BROWNOUT_DET_LVL_SEL_3 + config ESP32_BROWNOUT_DET_LVL_SEL_3 bool "2.62V +/- 0.05" - config BROWNOUT_DET_LVL_SEL_4 + config ESP32_BROWNOUT_DET_LVL_SEL_4 bool "2.67V +/- 0.05" - config BROWNOUT_DET_LVL_SEL_5 + config ESP32_BROWNOUT_DET_LVL_SEL_5 bool "2.70V +/- 0.05" - config BROWNOUT_DET_LVL_SEL_6 + config ESP32_BROWNOUT_DET_LVL_SEL_6 bool "2.77V +/- 0.05" - config BROWNOUT_DET_LVL_SEL_7 + config ESP32_BROWNOUT_DET_LVL_SEL_7 bool "2.80V +/- 0.05" endchoice - config BROWNOUT_DET_LVL + config ESP32_BROWNOUT_DET_LVL int - default 0 if BROWNOUT_DET_LVL_SEL_0 - default 1 if BROWNOUT_DET_LVL_SEL_1 - default 2 if BROWNOUT_DET_LVL_SEL_2 - default 3 if BROWNOUT_DET_LVL_SEL_3 - default 4 if BROWNOUT_DET_LVL_SEL_4 - default 5 if BROWNOUT_DET_LVL_SEL_5 - default 6 if BROWNOUT_DET_LVL_SEL_6 - default 7 if BROWNOUT_DET_LVL_SEL_7 + default 0 if ESP32_BROWNOUT_DET_LVL_SEL_0 + default 1 if ESP32_BROWNOUT_DET_LVL_SEL_1 + default 2 if ESP32_BROWNOUT_DET_LVL_SEL_2 + default 3 if ESP32_BROWNOUT_DET_LVL_SEL_3 + default 4 if ESP32_BROWNOUT_DET_LVL_SEL_4 + default 5 if ESP32_BROWNOUT_DET_LVL_SEL_5 + default 6 if ESP32_BROWNOUT_DET_LVL_SEL_6 + default 7 if ESP32_BROWNOUT_DET_LVL_SEL_7 #Reduce PHY TX power when brownout reset - config REDUCE_PHY_TX_POWER + config ESP32_REDUCE_PHY_TX_POWER bool "Reduce PHY TX power when brownout reset" - depends on BROWNOUT_DET + depends on ESP32_BROWNOUT_DET default y help When brownout reset occurs, reduce PHY TX power to keep the code running @@ -742,9 +472,9 @@ menu "ESP32-specific" bool "None" endchoice - choice ESP32_RTC_CLOCK_SOURCE + choice ESP32_RTC_CLK_SRC prompt "RTC clock source" - default ESP32_RTC_CLOCK_SOURCE_INTERNAL_RC + default ESP32_RTC_CLK_SRC_INT_RC help Choose which clock is used as RTC clock source. @@ -765,19 +495,19 @@ menu "ESP32-specific" deep sleep current (by 5uA) but has better frequency stability than the internal 150kHz oscillator. It does not require external components. - config ESP32_RTC_CLOCK_SOURCE_INTERNAL_RC + config ESP32_RTC_CLK_SRC_INT_RC bool "Internal 150kHz RC oscillator" - config ESP32_RTC_CLOCK_SOURCE_EXTERNAL_CRYSTAL + config ESP32_RTC_CLK_SRC_EXT_CRYS bool "External 32kHz crystal" - config ESP32_RTC_CLOCK_SOURCE_EXTERNAL_OSC + config ESP32_RTC_CLK_SRC_EXT_OSC bool "External 32kHz oscillator at 32K_XP pin" - config ESP32_RTC_CLOCK_SOURCE_INTERNAL_8MD256 + config ESP32_RTC_CLK_SRC_INT_8MD256 bool "Internal 8.5MHz oscillator, divided by 256 (~33kHz)" endchoice - config ESP32_RTC_EXTERNAL_CRYSTAL_ADDITIONAL_CURRENT + config ESP32_RTC_EXT_CRYST_ADDIT_CURRENT bool "Additional current for external 32kHz crystal" - depends on ESP32_RTC_CLOCK_SOURCE_EXTERNAL_CRYSTAL + depends on ESP32_RTC_CLK_SRC_EXT_CRYS default "n" help Choose which additional current is used for rtc external crystal. @@ -790,10 +520,10 @@ menu "ESP32-specific" config ESP32_RTC_CLK_CAL_CYCLES int "Number of cycles for RTC_SLOW_CLK calibration" - default 3000 if ESP32_RTC_CLOCK_SOURCE_EXTERNAL_CRYSTAL - default 1024 if ESP32_RTC_CLOCK_SOURCE_INTERNAL_RC - range 0 27000 if ESP32_RTC_CLOCK_SOURCE_EXTERNAL_CRYSTAL || ESP32_RTC_CLOCK_SOURCE_EXTERNAL_OSC || ESP32_RTC_CLOCK_SOURCE_INTERNAL_8MD256 # NOERROR - range 0 32766 if ESP32_RTC_CLOCK_SOURCE_INTERNAL_RC + default 3000 if ESP32_RTC_CLK_SRC_EXT_CRYS + default 1024 if ESP32_RTC_CLK_SRC_INT_RC + range 0 27000 if ESP32_RTC_CLK_SRC_EXT_CRYS || ESP32_RTC_CLK_SRC_EXT_OSC || ESP32_RTC_CLK_SRC_INT_8MD256 + range 0 32766 if ESP32_RTC_CLK_SRC_INT_RC help When the startup code initializes RTC_SLOW_CLK, it can perform calibration by comparing the RTC_SLOW_CLK frequency with main XTAL @@ -812,7 +542,7 @@ menu "ESP32-specific" config ESP32_RTC_XTAL_BOOTSTRAP_CYCLES int "Bootstrap cycles for external 32kHz crystal" - depends on ESP32_RTC_CLOCK_SOURCE_EXTERNAL_CRYSTAL + depends on ESP32_RTC_CLK_SRC_EXT_CRYS default 5 range 0 32768 help @@ -875,7 +605,7 @@ menu "ESP32-specific" default 40 if ESP32_XTAL_FREQ_40 default 26 if ESP32_XTAL_FREQ_26 - config DISABLE_BASIC_ROM_CONSOLE + config ESP32_DISABLE_BASIC_ROM_CONSOLE bool "Permanently disable BASIC ROM Console" default n help @@ -887,7 +617,7 @@ menu "ESP32-specific" (Enabling secure boot also disables the BASIC ROM Console by default.) - config NO_BLOBS + config ESP32_NO_BLOBS bool "No Binary Blobs" depends on !BT_ENABLED default n @@ -895,18 +625,7 @@ menu "ESP32-specific" If enabled, this disables the linking of binary libraries in the application build. Note that after enabling this Wi-Fi/Bluetooth will not work. - config ESP_TIMER_PROFILING - bool "Enable esp_timer profiling features" - default n - help - If enabled, esp_timer_dump will dump information such as number of times - the timer was started, number of times the timer has triggered, and the - total time it took for the callback to run. - This option has some effect on timer performance and the amount of memory - used for timer storage, and should only be used for debugging/testing - purposes. - - config COMPATIBLE_PRE_V2_1_BOOTLOADERS + config ESP32_COMPATIBLE_PRE_V2_1_BOOTLOADERS bool "App compatible with bootloaders before IDF v2.1" default n help @@ -922,16 +641,6 @@ menu "ESP32-specific" Enabling this setting adds approximately 1KB to the app's IRAM usage. - config ESP_ERR_TO_NAME_LOOKUP - bool "Enable lookup of error code strings" - default "y" - help - Functions esp_err_to_name() and esp_err_to_name_r() return string - representations of error codes from a pre-generated lookup table. - This option can be used to turn off the use of the look-up table in - order to save memory but this comes at the price of sacrificing - distinguishable (meaningful) output string representations. - config ESP32_RTCDATA_IN_FAST_MEM bool "Place RTC_DATA_ATTR and RTC_RODATA_ATTR variables into RTC fast memory segment" default n diff --git a/components/esp32/brownout.c b/components/esp32/brownout.c index 439fd7524..1e81768ef 100644 --- a/components/esp32/brownout.c +++ b/components/esp32/brownout.c @@ -25,11 +25,11 @@ #include "driver/rtc_cntl.h" #include "freertos/FreeRTOS.h" -#ifdef CONFIG_BROWNOUT_DET_LVL -#define BROWNOUT_DET_LVL CONFIG_BROWNOUT_DET_LVL +#ifdef CONFIG_ESP32_BROWNOUT_DET_LVL +#define BROWNOUT_DET_LVL CONFIG_ESP32_BROWNOUT_DET_LVL #else #define BROWNOUT_DET_LVL 0 -#endif //CONFIG_BROWNOUT_DET_LVL +#endif //CONFIG_ESP32_BROWNOUT_DET_LVL static void rtc_brownout_isr_handler() { diff --git a/components/esp32/clk.c b/components/esp32/clk.c index 12764e0b6..02a8caa17 100644 --- a/components/esp32/clk.c +++ b/components/esp32/clk.c @@ -74,7 +74,7 @@ void esp_clk_init(void) rtc_config_t cfg = RTC_CONFIG_DEFAULT(); rtc_init(cfg); -#ifdef CONFIG_COMPATIBLE_PRE_V2_1_BOOTLOADERS +#ifdef CONFIG_ESP32_COMPATIBLE_PRE_V2_1_BOOTLOADERS /* Check the bootloader set the XTAL frequency. Bootloaders pre-v2.1 don't do this. @@ -85,7 +85,7 @@ void esp_clk_init(void) bootloader_clock_configure(); } #else - /* If this assertion fails, either upgrade the bootloader or enable CONFIG_COMPATIBLE_PRE_V2_1_BOOTLOADERS */ + /* If this assertion fails, either upgrade the bootloader or enable CONFIG_ESP32_COMPATIBLE_PRE_V2_1_BOOTLOADERS */ assert(rtc_clk_xtal_freq_get() != RTC_XTAL_FREQ_AUTO); #endif @@ -103,11 +103,11 @@ void esp_clk_init(void) rtc_wdt_protect_on(); #endif -#if defined(CONFIG_ESP32_RTC_CLOCK_SOURCE_EXTERNAL_CRYSTAL) +#if defined(CONFIG_ESP32_RTC_CLK_SRC_EXT_CRYS) select_rtc_slow_clk(SLOW_CLK_32K_XTAL); -#elif defined(CONFIG_ESP32_RTC_CLOCK_SOURCE_EXTERNAL_OSC) +#elif defined(CONFIG_ESP32_RTC_CLK_SRC_EXT_OSC) select_rtc_slow_clk(SLOW_CLK_32K_EXT_OSC); -#elif defined(CONFIG_ESP32_RTC_CLOCK_SOURCE_INTERNAL_8MD256) +#elif defined(CONFIG_ESP32_RTC_CLK_SRC_INT_8MD256) select_rtc_slow_clk(SLOW_CLK_8MD256); #else select_rtc_slow_clk(RTC_SLOW_FREQ_RTC); @@ -131,7 +131,7 @@ void esp_clk_init(void) // Wait for UART TX to finish, otherwise some UART output will be lost // when switching APB frequency - uart_tx_wait_idle(CONFIG_CONSOLE_UART_NUM); + uart_tx_wait_idle(CONFIG_ESP_CONSOLE_UART_NUM); rtc_clk_cpu_freq_set_config(&new_config); @@ -273,13 +273,13 @@ void esp_perip_clk_init(void) //Reset the communication peripherals like I2C, SPI, UART, I2S and bring them to known state. common_perip_clk |= DPORT_I2S0_CLK_EN | -#if CONFIG_CONSOLE_UART_NUM != 0 +#if CONFIG_ESP_CONSOLE_UART_NUM != 0 DPORT_UART_CLK_EN | #endif -#if CONFIG_CONSOLE_UART_NUM != 1 +#if CONFIG_ESP_CONSOLE_UART_NUM != 1 DPORT_UART1_CLK_EN | #endif -#if CONFIG_CONSOLE_UART_NUM != 2 +#if CONFIG_ESP_CONSOLE_UART_NUM != 2 DPORT_UART2_CLK_EN | #endif DPORT_SPI2_CLK_EN | diff --git a/components/esp32/cpu_start.c b/components/esp32/cpu_start.c index dc9f10b21..b8c4d86a9 100644 --- a/components/esp32/cpu_start.c +++ b/components/esp32/cpu_start.c @@ -273,13 +273,13 @@ void IRAM_ATTR call_start_cpu1() cpu_configure_region_protection(); cpu_init_memctl(); -#if CONFIG_CONSOLE_UART_NONE +#if CONFIG_ESP_CONSOLE_UART_NONE ets_install_putc1(NULL); ets_install_putc2(NULL); -#else // CONFIG_CONSOLE_UART_NONE +#else // CONFIG_ESP_CONSOLE_UART_NONE uartAttach(); ets_install_uart_printf(); - uart_tx_switch(CONFIG_CONSOLE_UART_NUM); + uart_tx_switch(CONFIG_ESP_CONSOLE_UART_NUM); #endif wdt_reset_cpu1_info_enable(); @@ -331,28 +331,28 @@ void start_cpu0_default(void) esp_perip_clk_init(); intr_matrix_clear(); -#ifndef CONFIG_CONSOLE_UART_NONE +#ifndef CONFIG_ESP_CONSOLE_UART_NONE #ifdef CONFIG_PM_ENABLE const int uart_clk_freq = REF_CLK_FREQ; /* When DFS is enabled, use REFTICK as UART clock source */ - CLEAR_PERI_REG_MASK(UART_CONF0_REG(CONFIG_CONSOLE_UART_NUM), UART_TICK_REF_ALWAYS_ON); + CLEAR_PERI_REG_MASK(UART_CONF0_REG(CONFIG_ESP_CONSOLE_UART_NUM), UART_TICK_REF_ALWAYS_ON); #else const int uart_clk_freq = APB_CLK_FREQ; #endif // CONFIG_PM_DFS_ENABLE - uart_div_modify(CONFIG_CONSOLE_UART_NUM, (uart_clk_freq << 4) / CONFIG_CONSOLE_UART_BAUDRATE); -#endif // CONFIG_CONSOLE_UART_NONE + uart_div_modify(CONFIG_ESP_CONSOLE_UART_NUM, (uart_clk_freq << 4) / CONFIG_ESP_CONSOLE_UART_BAUDRATE); +#endif // CONFIG_ESP_CONSOLE_UART_NONE -#if CONFIG_BROWNOUT_DET +#if CONFIG_ESP32_BROWNOUT_DET esp_brownout_init(); #endif -#if CONFIG_DISABLE_BASIC_ROM_CONSOLE +#if CONFIG_ESP32_DISABLE_BASIC_ROM_CONSOLE esp_efuse_disable_basic_rom_console(); #endif rtc_gpio_force_hold_dis_all(); esp_vfs_dev_uart_register(); esp_reent_init(_GLOBAL_REENT); -#ifndef CONFIG_CONSOLE_UART_NONE - const char* default_uart_dev = "/dev/uart/" STRINGIFY(CONFIG_CONSOLE_UART_NUM); +#ifndef CONFIG_ESP_CONSOLE_UART_NONE + const char* default_uart_dev = "/dev/uart/" STRINGIFY(CONFIG_ESP_CONSOLE_UART_NUM); _GLOBAL_REENT->_stdin = fopen(default_uart_dev, "r"); _GLOBAL_REENT->_stdout = fopen(default_uart_dev, "w"); _GLOBAL_REENT->_stderr = fopen(default_uart_dev, "w"); @@ -377,7 +377,7 @@ void start_cpu0_default(void) assert(err == ESP_OK && "Failed to init pthread module!"); do_global_ctors(); -#if CONFIG_INT_WDT +#if CONFIG_ESP_INT_WDT esp_int_wdt_init(); //Initialize the interrupt watch dog for CPU0. esp_int_wdt_cpu_init(); @@ -438,7 +438,7 @@ void start_cpu1_default(void) esp_err_t err = esp_apptrace_init(); assert(err == ESP_OK && "Failed to init apptrace module on APP CPU!"); #endif -#if CONFIG_INT_WDT +#if CONFIG_ESP_INT_WDT //Initialize the interrupt watch dog for CPU1. esp_int_wdt_cpu_init(); #endif @@ -495,21 +495,21 @@ static void main_task(void* args) #endif //Initialize task wdt if configured to do so -#ifdef CONFIG_TASK_WDT_PANIC - ESP_ERROR_CHECK(esp_task_wdt_init(CONFIG_TASK_WDT_TIMEOUT_S, true)); -#elif CONFIG_TASK_WDT - ESP_ERROR_CHECK(esp_task_wdt_init(CONFIG_TASK_WDT_TIMEOUT_S, false)); +#ifdef CONFIG_ESP_TASK_WDT_PANIC + ESP_ERROR_CHECK(esp_task_wdt_init(CONFIG_ESP_TASK_WDT_TIMEOUT_S, true)); +#elif CONFIG_ESP_TASK_WDT + ESP_ERROR_CHECK(esp_task_wdt_init(CONFIG_ESP_TASK_WDT_TIMEOUT_S, false)); #endif //Add IDLE 0 to task wdt -#ifdef CONFIG_TASK_WDT_CHECK_IDLE_TASK_CPU0 +#ifdef CONFIG_ESP_TASK_WDT_CHECK_IDLE_TASK_CPU0 TaskHandle_t idle_0 = xTaskGetIdleTaskHandleForCPU(0); if(idle_0 != NULL){ ESP_ERROR_CHECK(esp_task_wdt_add(idle_0)); } #endif //Add IDLE 1 to task wdt -#ifdef CONFIG_TASK_WDT_CHECK_IDLE_TASK_CPU1 +#ifdef CONFIG_ESP_TASK_WDT_CHECK_IDLE_TASK_CPU1 TaskHandle_t idle_1 = xTaskGetIdleTaskHandleForCPU(1); if(idle_1 != NULL){ ESP_ERROR_CHECK(esp_task_wdt_add(idle_1)); diff --git a/components/esp32/dport_panic_highint_hdl.S b/components/esp32/dport_panic_highint_hdl.S index a329ec7d5..924d77b2f 100644 --- a/components/esp32/dport_panic_highint_hdl.S +++ b/components/esp32/dport_panic_highint_hdl.S @@ -86,7 +86,7 @@ xt_highint4: movi a0, PANIC_RSN_CACHEERR j 9f 1: -#if CONFIG_INT_WDT_CHECK_CPU1 +#if CONFIG_ESP_INT_WDT_CHECK_CPU1 /* Check if the cause is the app cpu failing to tick.*/ movi a0, int_wdt_app_cpu_ticked l32i a0, a0, 0 diff --git a/components/esp32/esp_adapter.c b/components/esp32/esp_adapter.c index 3893c28dc..d34c2ac6e 100644 --- a/components/esp32/esp_adapter.c +++ b/components/esp32/esp_adapter.c @@ -54,12 +54,12 @@ extern void esp_dport_access_stall_other_cpu_start_wrap(void); extern void esp_dport_access_stall_other_cpu_end_wrap(void); /* - If CONFIG_WIFI_LWIP_ALLOCATION_FROM_SPIRAM_FIRST is enabled. Prefer to allocate a chunk of memory in SPIRAM firstly. + If CONFIG_SPIRAM_TRY_ALLOCATE_WIFI_LWIP is enabled. Prefer to allocate a chunk of memory in SPIRAM firstly. If failed, try to allocate it in internal memory then. */ IRAM_ATTR void *wifi_malloc( size_t size ) { -#if CONFIG_WIFI_LWIP_ALLOCATION_FROM_SPIRAM_FIRST +#if CONFIG_SPIRAM_TRY_ALLOCATE_WIFI_LWIP return heap_caps_malloc_prefer(size, 2, MALLOC_CAP_DEFAULT|MALLOC_CAP_SPIRAM, MALLOC_CAP_DEFAULT|MALLOC_CAP_INTERNAL); #else return malloc(size); @@ -67,12 +67,12 @@ IRAM_ATTR void *wifi_malloc( size_t size ) } /* - If CONFIG_WIFI_LWIP_ALLOCATION_FROM_SPIRAM_FIRST is enabled. Prefer to allocate a chunk of memory in SPIRAM firstly. + If CONFIG_SPIRAM_TRY_ALLOCATE_WIFI_LWIP is enabled. Prefer to allocate a chunk of memory in SPIRAM firstly. If failed, try to allocate it in internal memory then. */ IRAM_ATTR void *wifi_realloc( void *ptr, size_t size ) { -#if CONFIG_WIFI_LWIP_ALLOCATION_FROM_SPIRAM_FIRST +#if CONFIG_SPIRAM_TRY_ALLOCATE_WIFI_LWIP return heap_caps_realloc_prefer(ptr, size, 2, MALLOC_CAP_DEFAULT|MALLOC_CAP_SPIRAM, MALLOC_CAP_DEFAULT|MALLOC_CAP_INTERNAL); #else return realloc(ptr, size); @@ -80,12 +80,12 @@ IRAM_ATTR void *wifi_realloc( void *ptr, size_t size ) } /* - If CONFIG_WIFI_LWIP_ALLOCATION_FROM_SPIRAM_FIRST is enabled. Prefer to allocate a chunk of memory in SPIRAM firstly. + If CONFIG_SPIRAM_TRY_ALLOCATE_WIFI_LWIP is enabled. Prefer to allocate a chunk of memory in SPIRAM firstly. If failed, try to allocate it in internal memory then. */ IRAM_ATTR void *wifi_calloc( size_t n, size_t size ) { -#if CONFIG_WIFI_LWIP_ALLOCATION_FROM_SPIRAM_FIRST +#if CONFIG_SPIRAM_TRY_ALLOCATE_WIFI_LWIP return heap_caps_calloc_prefer(n, size, 2, MALLOC_CAP_DEFAULT|MALLOC_CAP_SPIRAM, MALLOC_CAP_DEFAULT|MALLOC_CAP_INTERNAL); #else return calloc(n, size); diff --git a/components/esp32/gdbstub.c b/components/esp32/gdbstub.c index 9ce9f460a..5c33045f1 100644 --- a/components/esp32/gdbstub.c +++ b/components/esp32/gdbstub.c @@ -273,9 +273,9 @@ static int sendPacket(const char * text) { return ST_OK; } -#if CONFIG_GDBSTUB_SUPPORT_TASKS +#if CONFIG_ESP_GDBSTUB_SUPPORT_TASKS -#define STUB_TASKS_NUM CONFIG_GDBSTUB_MAX_TASKS +#define STUB_TASKS_NUM CONFIG_ESP_GDBSTUB_MAX_TASKS //Remember the exception frame that caused panic since it's not saved in TCB static XtExcFrame paniced_frame; @@ -365,7 +365,7 @@ static int findCurrentTaskIndex() { return curTaskIndex; } -#endif // CONFIG_GDBSTUB_SUPPORT_TASKS +#endif // CONFIG_ESP_GDBSTUB_SUPPORT_TASKS //Handle a command as received from GDB. static int gdbHandleCommand(unsigned char *cmd, int len) { @@ -392,7 +392,7 @@ static int gdbHandleCommand(unsigned char *cmd, int len) { gdbPacketEnd(); } else if (cmd[0]=='?') { //Reply with stop reason sendReason(); -#if CONFIG_GDBSTUB_SUPPORT_TASKS +#if CONFIG_ESP_GDBSTUB_SUPPORT_TASKS } else if (handlerState != HANDLER_TASK_SUPPORT_DISABLED) { if (cmd[0]=='H') { //Continue with task if (cmd[1]=='g' || cmd[1]=='c') { @@ -473,7 +473,7 @@ static int gdbHandleCommand(unsigned char *cmd, int len) { } return sendPacket(NULL); } -#endif // CONFIG_GDBSTUB_SUPPORT_TASKS +#endif // CONFIG_ESP_GDBSTUB_SUPPORT_TASKS } else { //We don't recognize or support whatever GDB just sent us. return sendPacket(NULL); @@ -532,7 +532,7 @@ static int gdbReadCommand() { void esp_gdbstub_panic_handler(XtExcFrame *frame) { -#if CONFIG_GDBSTUB_SUPPORT_TASKS +#if CONFIG_ESP_GDBSTUB_SUPPORT_TASKS if (handlerState == HANDLER_STARTED) { //We have re-entered GDB Stub. Try disabling task support. handlerState = HANDLER_TASK_SUPPORT_DISABLED; @@ -542,9 +542,9 @@ void esp_gdbstub_panic_handler(XtExcFrame *frame) { memcpy(&paniced_frame, frame, sizeof(paniced_frame)); dumpHwToRegfile(&paniced_frame); } -#else // CONFIG_GDBSTUB_SUPPORT_TASKS +#else // CONFIG_ESP_GDBSTUB_SUPPORT_TASKS dumpHwToRegfile(frame); -#endif // CONFIG_GDBSTUB_SUPPORT_TASKS +#endif // CONFIG_ESP_GDBSTUB_SUPPORT_TASKS //Make sure txd/rxd are enabled gpio_pullup_dis(1); diff --git a/components/esp32/include/esp_sleep.h b/components/esp32/include/esp_sleep.h index c21f26add..7791de6f7 100644 --- a/components/esp32/include/esp_sleep.h +++ b/components/esp32/include/esp_sleep.h @@ -95,7 +95,7 @@ esp_err_t esp_sleep_disable_wakeup_source(esp_sleep_source_t source); * source is used. * @return * - ESP_OK on success - * - ESP_ERR_NOT_SUPPORTED if additional current by touch (CONFIG_ESP32_RTC_EXTERNAL_CRYSTAL_ADDITIONAL_CURRENT) is enabled. + * - ESP_ERR_NOT_SUPPORTED if additional current by touch (CONFIG_ESP32_RTC_EXT_CRYST_ADDIT_CURRENT) is enabled. * - ESP_ERR_INVALID_STATE if ULP co-processor is not enabled or if wakeup triggers conflict */ esp_err_t esp_sleep_enable_ulp_wakeup(); @@ -122,7 +122,7 @@ esp_err_t esp_sleep_enable_timer_wakeup(uint64_t time_in_us); * * @return * - ESP_OK on success - * - ESP_ERR_NOT_SUPPORTED if additional current by touch (CONFIG_ESP32_RTC_EXTERNAL_CRYSTAL_ADDITIONAL_CURRENT) is enabled. + * - ESP_ERR_NOT_SUPPORTED if additional current by touch (CONFIG_ESP32_RTC_EXT_CRYST_ADDIT_CURRENT) is enabled. * - ESP_ERR_INVALID_STATE if wakeup triggers conflict */ esp_err_t esp_sleep_enable_touchpad_wakeup(); diff --git a/components/esp32/int_wdt.c b/components/esp32/int_wdt.c index 38e4aabdf..b384dceba 100644 --- a/components/esp32/int_wdt.c +++ b/components/esp32/int_wdt.c @@ -32,14 +32,14 @@ #include "driver/periph_ctrl.h" #include "esp_int_wdt.h" -#if CONFIG_INT_WDT +#if CONFIG_ESP_INT_WDT #define WDT_INT_NUM 24 //Take care: the tick hook can also be called before esp_int_wdt_init() is called. -#if CONFIG_INT_WDT_CHECK_CPU1 +#if CONFIG_ESP_INT_WDT_CHECK_CPU1 //Not static; the ISR assembly checks this. bool int_wdt_app_cpu_ticked=false; @@ -50,8 +50,8 @@ static void IRAM_ATTR tick_hook(void) { //Only feed wdt if app cpu also ticked. if (int_wdt_app_cpu_ticked) { TIMERG1.wdt_wprotect=TIMG_WDT_WKEY_VALUE; - TIMERG1.wdt_config2=CONFIG_INT_WDT_TIMEOUT_MS*2; //Set timeout before interrupt - TIMERG1.wdt_config3=CONFIG_INT_WDT_TIMEOUT_MS*4; //Set timeout before reset + TIMERG1.wdt_config2=CONFIG_ESP_INT_WDT_TIMEOUT_MS*2; //Set timeout before interrupt + TIMERG1.wdt_config3=CONFIG_ESP_INT_WDT_TIMEOUT_MS*4; //Set timeout before reset TIMERG1.wdt_feed=1; TIMERG1.wdt_wprotect=0; int_wdt_app_cpu_ticked=false; @@ -62,8 +62,8 @@ static void IRAM_ATTR tick_hook(void) { static void IRAM_ATTR tick_hook(void) { if (xPortGetCoreID()!=0) return; TIMERG1.wdt_wprotect=TIMG_WDT_WKEY_VALUE; - TIMERG1.wdt_config2=CONFIG_INT_WDT_TIMEOUT_MS*2; //Set timeout before interrupt - TIMERG1.wdt_config3=CONFIG_INT_WDT_TIMEOUT_MS*4; //Set timeout before reset + TIMERG1.wdt_config2=CONFIG_ESP_INT_WDT_TIMEOUT_MS*2; //Set timeout before interrupt + TIMERG1.wdt_config3=CONFIG_ESP_INT_WDT_TIMEOUT_MS*4; //Set timeout before reset TIMERG1.wdt_feed=1; TIMERG1.wdt_wprotect=0; } diff --git a/components/esp32/ld/esp32.ld b/components/esp32/ld/esp32.ld index 11873b9d3..c50c70a7f 100644 --- a/components/esp32/ld/esp32.ld +++ b/components/esp32/ld/esp32.ld @@ -69,8 +69,8 @@ MEMORY Start of RTC slow memory is reserved for ULP co-processor code + data, if enabled. */ - rtc_slow_seg(RW) : org = 0x50000000 + CONFIG_ULP_COPROC_RESERVE_MEM, - len = 0x1000 - CONFIG_ULP_COPROC_RESERVE_MEM + rtc_slow_seg(RW) : org = 0x50000000 + CONFIG_ESP32_ULP_COPROC_RESERVE_MEM, + len = 0x1000 - CONFIG_ESP32_ULP_COPROC_RESERVE_MEM /* external memory ,including data and text */ extern_ram_seg(RWX) : org = 0x3F800000, @@ -78,7 +78,7 @@ MEMORY } /* Heap ends at top of dram0_0_seg */ -_heap_end = 0x40000000 - CONFIG_TRACEMEM_RESERVE_DRAM; +_heap_end = 0x40000000 - CONFIG_ESP32_TRACEMEM_RESERVE_DRAM; _data_seg_org = ORIGIN(rtc_data_seg); diff --git a/components/esp32/panic.c b/components/esp32/panic.c index 4f3488623..719d6f01a 100644 --- a/components/esp32/panic.c +++ b/components/esp32/panic.c @@ -67,8 +67,8 @@ //printf may be broken, so we fix our own printing fns... static void panicPutChar(char c) { - while (((READ_PERI_REG(UART_STATUS_REG(CONFIG_CONSOLE_UART_NUM)) >> UART_TXFIFO_CNT_S)&UART_TXFIFO_CNT) >= 126) ; - WRITE_PERI_REG(UART_FIFO_REG(CONFIG_CONSOLE_UART_NUM), c); + while (((READ_PERI_REG(UART_STATUS_REG(CONFIG_ESP_CONSOLE_UART_NUM)) >> UART_TXFIFO_CNT_S)&UART_TXFIFO_CNT) >= 126) ; + WRITE_PERI_REG(UART_FIFO_REG(CONFIG_ESP_CONSOLE_UART_NUM), c); } static void panicPutStr(const char *c) @@ -434,7 +434,7 @@ static void esp_panic_dig_reset() __attribute__((noreturn)); static void esp_panic_dig_reset() { // make sure all the panic handler output is sent from UART FIFO - uart_tx_wait_idle(CONFIG_CONSOLE_UART_NUM); + uart_tx_wait_idle(CONFIG_ESP_CONSOLE_UART_NUM); // switch to XTAL (otherwise we will keep running from the PLL) rtc_clk_cpu_freq_set_xtal(); // reset the digital part diff --git a/components/esp32/sdkconfig.rename b/components/esp32/sdkconfig.rename new file mode 100644 index 000000000..15b1a55c0 --- /dev/null +++ b/components/esp32/sdkconfig.rename @@ -0,0 +1,38 @@ +# sdkconfig replacement configurations for deprecated options formatted as +# CONFIG_DEPRECATED_OPTION CONFIG_NEW_OPTION + +# ESP32-specific +CONFIG_SPIRAM_SUPPORT CONFIG_ESP32_SPIRAM_SUPPORT +CONFIG_MEMMAP_TRACEMEM CONFIG_ESP32_MEMMAP_TRACEMEM +CONFIG_MEMMAP_TRACEMEM_TWOBANKS CONFIG_ESP32_MEMMAP_TRACEMEM_TWOBANKS +CONFIG_TRACEMEM_RESERVE_DRAM CONFIG_ESP32_TRACEMEM_RESERVE_DRAM +CONFIG_NUMBER_OF_UNIVERSAL_MAC_ADDRESS CONFIG_ESP32_UNIVERSAL_MAC_ADDRESSES +CONFIG_TWO_UNIVERSAL_MAC_ADDRESS CONFIG_ESP32_UNIVERSAL_MAC_ADDRESSES_TWO +CONFIG_FOUR_UNIVERSAL_MAC_ADDRESS CONFIG_ESP32_UNIVERSAL_MAC_ADDRESSES_FOUR +CONFIG_ESP32_RTC_EXTERNAL_CRYSTAL_ADDITIONAL_CURRENT CONFIG_ESP32_RTC_EXT_CRYST_ADDIT_CURRENT +CONFIG_ESP32_RTC_CLOCK_SOURCE CONFIG_ESP32_RTC_CLK_SRC +CONFIG_ESP32_RTC_CLOCK_SOURCE_INTERNAL_RC CONFIG_ESP32_RTC_CLK_SRC_INT_RC +CONFIG_ESP32_RTC_CLOCK_SOURCE_EXTERNAL_CRYSTAL CONFIG_ESP32_RTC_CLK_SRC_EXT_CRYS +CONFIG_ESP32_RTC_CLOCK_SOURCE_EXTERNAL_OSC CONFIG_ESP32_RTC_CLK_SRC_EXT_OSC +CONFIG_ESP32_RTC_CLOCK_SOURCE_INTERNAL_8MD256 CONFIG_ESP32_RTC_CLK_SRC_INT_8MD256 +CONFIG_DISABLE_BASIC_ROM_CONSOLE CONFIG_ESP32_DISABLE_BASIC_ROM_CONSOLE +CONFIG_NO_BLOBS CONFIG_ESP32_NO_BLOBS +CONFIG_COMPATIBLE_PRE_V2_1_BOOTLOADERS CONFIG_ESP32_COMPATIBLE_PRE_V2_1_BOOTLOADERS +CONFIG_ULP_COPROC_ENABLED CONFIG_ESP32_ULP_COPROC_ENABLED +CONFIG_ULP_COPROC_RESERVE_MEM CONFIG_ESP32_ULP_COPROC_RESERVE_MEM +CONFIG_BROWNOUT_DET CONFIG_ESP32_BROWNOUT_DET +CONFIG_BROWNOUT_DET_LVL_SEL CONFIG_ESP32_BROWNOUT_DET_LVL_SEL +CONFIG_BROWNOUT_DET_LVL_SEL_0 CONFIG_ESP32_BROWNOUT_DET_LVL_SEL_0 +CONFIG_BROWNOUT_DET_LVL_SEL_1 CONFIG_ESP32_BROWNOUT_DET_LVL_SEL_1 +CONFIG_BROWNOUT_DET_LVL_SEL_2 CONFIG_ESP32_BROWNOUT_DET_LVL_SEL_2 +CONFIG_BROWNOUT_DET_LVL_SEL_3 CONFIG_ESP32_BROWNOUT_DET_LVL_SEL_3 +CONFIG_BROWNOUT_DET_LVL_SEL_4 CONFIG_ESP32_BROWNOUT_DET_LVL_SEL_4 +CONFIG_BROWNOUT_DET_LVL_SEL_5 CONFIG_ESP32_BROWNOUT_DET_LVL_SEL_5 +CONFIG_BROWNOUT_DET_LVL_SEL_6 CONFIG_ESP32_BROWNOUT_DET_LVL_SEL_6 +CONFIG_BROWNOUT_DET_LVL_SEL_7 CONFIG_ESP32_BROWNOUT_DET_LVL_SEL_7 +CONFIG_BROWNOUT_DET_LVL CONFIG_ESP32_BROWNOUT_DET_LVL +CONFIG_REDUCE_PHY_TX_POWER CONFIG_ESP32_REDUCE_PHY_TX_POWER + +# SPI RAM config +CONFIG_WIFI_LWIP_ALLOCATION_FROM_SPIRAM_FIRST CONFIG_SPIRAM_TRY_ALLOCATE_WIFI_LWIP +CONFIG_PICO_PSRAM_CS_IO CONFIG_SPIRAM_PICO_PSRAM_CS_IO diff --git a/components/esp32/sleep_modes.c b/components/esp32/sleep_modes.c index 7e5a69c83..25d5c8594 100644 --- a/components/esp32/sleep_modes.c +++ b/components/esp32/sleep_modes.c @@ -48,13 +48,13 @@ // Extra time it takes to enter and exit light sleep and deep sleep // For deep sleep, this is until the wake stub runs (not the app). -#ifdef CONFIG_ESP32_RTC_CLOCK_SOURCE_EXTERNAL_CRYSTAL +#ifdef CONFIG_ESP32_RTC_CLK_SRC_EXT_CRYS #define LIGHT_SLEEP_TIME_OVERHEAD_US (650 + 30 * 240 / CONFIG_ESP32_DEFAULT_CPU_FREQ_MHZ) #define DEEP_SLEEP_TIME_OVERHEAD_US (650 + 100 * 240 / CONFIG_ESP32_DEFAULT_CPU_FREQ_MHZ) #else #define LIGHT_SLEEP_TIME_OVERHEAD_US (250 + 30 * 240 / CONFIG_ESP32_DEFAULT_CPU_FREQ_MHZ) #define DEEP_SLEEP_TIME_OVERHEAD_US (250 + 100 * 240 / CONFIG_ESP32_DEFAULT_CPU_FREQ_MHZ) -#endif // CONFIG_ESP32_RTC_CLOCK_SOURCE +#endif // CONFIG_ESP32_RTC_CLK_SRC // Minimal amount of time we can sleep for #define LIGHT_SLEEP_MIN_TIME_US 200 @@ -305,7 +305,7 @@ esp_err_t esp_light_sleep_start() const uint32_t flash_enable_time_us = VDD_SDIO_POWERUP_TO_FLASH_READ_US + CONFIG_ESP32_DEEP_SLEEP_WAKEUP_DELAY; -#ifndef CONFIG_SPIRAM_SUPPORT +#ifndef CONFIG_ESP32_SPIRAM_SUPPORT const uint32_t vddsdio_pd_sleep_duration = MAX(FLASH_PD_MIN_SLEEP_TIME_US, flash_enable_time_us + LIGHT_SLEEP_TIME_OVERHEAD_US + LIGHT_SLEEP_MIN_TIME_US); @@ -313,7 +313,7 @@ esp_err_t esp_light_sleep_start() pd_flags |= RTC_SLEEP_PD_VDDSDIO; s_config.sleep_time_adjustment += flash_enable_time_us; } -#endif //CONFIG_SPIRAM_SUPPORT +#endif //CONFIG_ESP32_SPIRAM_SUPPORT rtc_vddsdio_config_t vddsdio_config = rtc_vddsdio_get_config(); @@ -390,7 +390,7 @@ esp_err_t esp_sleep_disable_wakeup_source(esp_sleep_source_t source) } else if (CHECK_SOURCE(source, ESP_SLEEP_WAKEUP_UART, (RTC_UART0_TRIG_EN | RTC_UART1_TRIG_EN))) { s_config.wakeup_triggers &= ~(RTC_UART0_TRIG_EN | RTC_UART1_TRIG_EN); } -#ifdef CONFIG_ULP_COPROC_ENABLED +#ifdef CONFIG_ESP32_ULP_COPROC_ENABLED else if (CHECK_SOURCE(source, ESP_SLEEP_WAKEUP_ULP, RTC_ULP_TRIG_EN)) { s_config.wakeup_triggers &= ~RTC_ULP_TRIG_EN; } @@ -404,10 +404,10 @@ esp_err_t esp_sleep_disable_wakeup_source(esp_sleep_source_t source) esp_err_t esp_sleep_enable_ulp_wakeup() { -#ifdef CONFIG_ESP32_RTC_EXTERNAL_CRYSTAL_ADDITIONAL_CURRENT +#ifdef CONFIG_ESP32_RTC_EXT_CRYST_ADDIT_CURRENT return ESP_ERR_NOT_SUPPORTED; #endif -#ifdef CONFIG_ULP_COPROC_ENABLED +#ifdef CONFIG_ESP32_ULP_COPROC_ENABLED if(s_config.wakeup_triggers & RTC_EXT0_TRIG_EN) { ESP_LOGE(TAG, "Conflicting wake-up trigger: ext0"); return ESP_ERR_INVALID_STATE; @@ -440,7 +440,7 @@ static void timer_wakeup_prepare() esp_err_t esp_sleep_enable_touchpad_wakeup() { -#ifdef CONFIG_ESP32_RTC_EXTERNAL_CRYSTAL_ADDITIONAL_CURRENT +#ifdef CONFIG_ESP32_RTC_EXT_CRYST_ADDIT_CURRENT return ESP_ERR_NOT_SUPPORTED; #endif if (s_config.wakeup_triggers & (RTC_EXT0_TRIG_EN)) { @@ -705,7 +705,7 @@ static uint32_t get_power_down_flags() if ((s_config.wakeup_triggers & (RTC_TOUCH_TRIG_EN | RTC_ULP_TRIG_EN)) == 0) { // If enabled EXT1 only and enable the additional current by touch, should be keep RTC_PERIPH power on. -#if ((defined CONFIG_ESP32_RTC_CLOCK_SOURCE_EXTERNAL_CRYSTAL) && (defined CONFIG_ESP32_RTC_EXTERNAL_CRYSTAL_ADDITIONAL_CURRENT)) +#if ((defined CONFIG_ESP32_RTC_CLK_SRC_EXT_CRYS) && (defined CONFIG_ESP32_RTC_EXT_CRYST_ADDIT_CURRENT)) pd_flags &= ~RTC_SLEEP_PD_RTC_PERIPH; #endif } diff --git a/components/esp32/spiram.c b/components/esp32/spiram.c index d090c4e7c..fc4a9a619 100644 --- a/components/esp32/spiram.c +++ b/components/esp32/spiram.c @@ -46,7 +46,7 @@ we add more types of external RAM memory, this can be made into a more intellige #endif #endif -#if CONFIG_SPIRAM_SUPPORT +#if CONFIG_ESP32_SPIRAM_SUPPORT static const char* TAG = "spiram"; diff --git a/components/esp32/spiram_psram.c b/components/esp32/spiram_psram.c index a0c5b9a60..f6cda3fa3 100644 --- a/components/esp32/spiram_psram.c +++ b/components/esp32/spiram_psram.c @@ -36,7 +36,7 @@ #include "driver/spi_common.h" #include "driver/periph_ctrl.h" -#if CONFIG_SPIRAM_SUPPORT +#if CONFIG_ESP32_SPIRAM_SUPPORT #include "soc/rtc.h" //Commands for PSRAM chip @@ -118,7 +118,7 @@ typedef enum { #define PICO_FLASH_SPIHD_SD2_IO 11 #define PICO_PSRAM_CLK_IO 6 -#define PICO_PSRAM_CS_IO CONFIG_PICO_PSRAM_CS_IO +#define PICO_PSRAM_CS_IO CONFIG_SPIRAM_PICO_PSRAM_CS_IO #define PICO_PSRAM_SPIQ_SD0_IO 17 #define PICO_PSRAM_SPID_SD1_IO 8 #define PICO_PSRAM_SPIWP_SD3_IO 7 @@ -836,4 +836,4 @@ static void IRAM_ATTR psram_cache_init(psram_cache_mode_t psram_cache_mode, psra CLEAR_PERI_REG_MASK(SPI_PIN_REG(0), SPI_CS1_DIS_M); //ENABLE SPI0 CS1 TO PSRAM(CS0--FLASH; CS1--SRAM) } -#endif // CONFIG_SPIRAM_SUPPORT +#endif // CONFIG_ESP32_SPIRAM_SUPPORT diff --git a/components/esp32/test/test_4mpsram.c b/components/esp32/test/test_4mpsram.c index a1cd36023..da173a19b 100644 --- a/components/esp32/test/test_4mpsram.c +++ b/components/esp32/test/test_4mpsram.c @@ -6,7 +6,7 @@ static const char TAG[] = "test_psram"; -#ifdef CONFIG_SPIRAM_SUPPORT +#ifdef CONFIG_ESP32_SPIRAM_SUPPORT static void test_psram_content() { const int test_size = 2048; @@ -40,7 +40,7 @@ static void test_psram_content() TEST_CASE("can use spi when not being used by psram", "[psram_4m]") { spi_host_device_t host; -#if !CONFIG_SPIRAM_SUPPORT || !CONFIG_SPIRAM_SPEED_80M || CONFIG_SPIRAM_BANKSWITCH_ENABLE +#if !CONFIG_ESP32_SPIRAM_SUPPORT || !CONFIG_SPIRAM_SPEED_80M || CONFIG_SPIRAM_BANKSWITCH_ENABLE //currently all 8M psram don't need more SPI peripherals host = -1; #elif CONFIG_SPIRAM_OCCUPY_HSPI_HOST @@ -66,7 +66,7 @@ TEST_CASE("can use spi when not being used by psram", "[psram_4m]") TEST_ASSERT(claim_vspi==true); } -#ifdef CONFIG_SPIRAM_SUPPORT +#ifdef CONFIG_ESP32_SPIRAM_SUPPORT test_psram_content(); #endif } diff --git a/components/esp32/test/test_dport.c b/components/esp32/test/test_dport.c index 7fd30e4f5..212c5d82b 100644 --- a/components/esp32/test/test_dport.c +++ b/components/esp32/test/test_dport.c @@ -107,8 +107,8 @@ TEST_CASE("access DPORT and APB at same time", "[esp32]") void run_tasks_with_change_freq_cpu(int cpu_freq_mhz) { - const int uart_num = CONFIG_CONSOLE_UART_NUM; - const int uart_baud = CONFIG_CONSOLE_UART_BAUDRATE; + const int uart_num = CONFIG_ESP_CONSOLE_UART_NUM; + const int uart_baud = CONFIG_ESP_CONSOLE_UART_BAUDRATE; dport_test_result = false; apb_test_result = false; rtc_cpu_freq_config_t old_config; diff --git a/components/esp32/test/test_pm.c b/components/esp32/test/test_pm.c index 01e1e17bc..ba3850daa 100644 --- a/components/esp32/test/test_pm.c +++ b/components/esp32/test/test_pm.c @@ -122,7 +122,7 @@ TEST_CASE("Automatic light occurs when tasks are suspended", "[pm]") TEST_CASE("Can wake up from automatic light sleep by GPIO", "[pm]") { - assert(CONFIG_ULP_COPROC_RESERVE_MEM >= 16 && "this test needs ULP_COPROC_RESERVE_MEM option set in menuconfig"); + assert(CONFIG_ESP32_ULP_COPROC_RESERVE_MEM >= 16 && "this test needs ESP32_ULP_COPROC_RESERVE_MEM option set in menuconfig"); /* Set up GPIO used to wake up RTC */ const int ext1_wakeup_gpio = 25; diff --git a/components/esp32/test/test_sleep.c b/components/esp32/test/test_sleep.c index eebec7963..fbda5f6da 100644 --- a/components/esp32/test/test_sleep.c +++ b/components/esp32/test/test_sleep.c @@ -125,7 +125,7 @@ TEST_CASE("light sleep stress test with periodic esp_timer", "[deepsleep]") } -#ifdef CONFIG_ESP32_RTC_CLOCK_SOURCE_EXTERNAL_CRYSTAL +#ifdef CONFIG_ESP32_RTC_CLK_SRC_EXT_CRYS #define MAX_SLEEP_TIME_ERROR_US 200 #else #define MAX_SLEEP_TIME_ERROR_US 100 @@ -176,8 +176,8 @@ TEST_CASE("light sleep and frequency switching", "[deepsleep]") { #ifndef CONFIG_PM_ENABLE const int uart_clk_freq = REF_CLK_FREQ; - CLEAR_PERI_REG_MASK(UART_CONF0_REG(CONFIG_CONSOLE_UART_NUM), UART_TICK_REF_ALWAYS_ON); - uart_div_modify(CONFIG_CONSOLE_UART_NUM, (uart_clk_freq << 4) / CONFIG_CONSOLE_UART_BAUDRATE); + CLEAR_PERI_REG_MASK(UART_CONF0_REG(CONFIG_ESP_CONSOLE_UART_NUM), UART_TICK_REF_ALWAYS_ON); + uart_div_modify(CONFIG_ESP_CONSOLE_UART_NUM, (uart_clk_freq << 4) / CONFIG_ESP_CONSOLE_UART_BAUDRATE); #endif rtc_cpu_freq_config_t config_xtal, config_default; diff --git a/components/esp32/test/test_spiram_cache_flush.c b/components/esp32/test/test_spiram_cache_flush.c index a01d9bddd..92116c3fd 100644 --- a/components/esp32/test/test_spiram_cache_flush.c +++ b/components/esp32/test/test_spiram_cache_flush.c @@ -23,7 +23,7 @@ This code tests the interaction between PSRAM and SPI flash routines. #include "esp_partition.h" #include "test_utils.h" -#if CONFIG_SPIRAM_SUPPORT +#if CONFIG_ESP32_SPIRAM_SUPPORT #if CONFIG_SPIRAM_USE_CAPS_ALLOC || CONFIG_SPIRAM_USE_MALLOC #define USE_CAPS_ALLOC 1 @@ -181,4 +181,4 @@ IRAM_ATTR TEST_CASE("Spiram memcmp weirdness at 80MHz", "[spiram]") { #endif } -#endif // CONFIG_SPIRAM_SUPPORT +#endif // CONFIG_ESP32_SPIRAM_SUPPORT diff --git a/components/esp_common/Kconfig b/components/esp_common/Kconfig new file mode 100644 index 000000000..80f20e606 --- /dev/null +++ b/components/esp_common/Kconfig @@ -0,0 +1,219 @@ +menu "Common ESP-related" + + config ESP_TIMER_PROFILING + bool "Enable esp_timer profiling features" + default n + help + If enabled, esp_timer_dump will dump information such as number of times the timer was started, number of + times the timer has triggered, and the total time it took for the callback to run. This option has some + effect on timer performance and the amount of memory used for timer storage, and should only be used for + debugging/testing purposes. + + config ESP_ERR_TO_NAME_LOOKUP + bool "Enable lookup of error code strings" + default "y" + help + Functions esp_err_to_name() and esp_err_to_name_r() return string representations of error codes from a + pre-generated lookup table. This option can be used to turn off the use of the look-up table in order to + save memory but this comes at the price of sacrificing distinguishable (meaningful) output string + representations. + + config ESP_SYSTEM_EVENT_QUEUE_SIZE + int "System event queue size" + default 32 + help + Config system event queue size in different application. + + config ESP_SYSTEM_EVENT_TASK_STACK_SIZE + int "Event loop task stack size" + default 2304 + help + Config system event task stack size in different application. + + config ESP_MAIN_TASK_STACK_SIZE + int "Main task stack size" + default 3584 + help + Configure the "main task" stack size. This is the stack of the task + which calls app_main(). If app_main() returns then this task is deleted + and its stack memory is freed. + + config ESP_IPC_TASK_STACK_SIZE + int "Inter-Processor Call (IPC) task stack size" + default 1024 + range 512 65536 if !ESP32_APPTRACE_ENABLE + range 2048 65536 if ESP32_APPTRACE_ENABLE + help + Configure the IPC tasks stack size. One IPC task runs on each core + (in dual core mode), and allows for cross-core function calls. + + See IPC documentation for more details. + + The default stack size should be enough for most common use cases. + It can be shrunk if you are sure that you do not use any custom + IPC functionality. + + config ESP_TIMER_TASK_STACK_SIZE + int "High-resolution timer task stack size" + default 3584 + range 2048 65536 + help + Configure the stack size of esp_timer/ets_timer task. This task is used + to dispatch callbacks of timers created using ets_timer and esp_timer + APIs. If you are seing stack overflow errors in timer task, increase + this value. + + Note that this is not the same as FreeRTOS timer task. To configure + FreeRTOS timer task size, see "FreeRTOS timer task stack size" option + in "FreeRTOS" menu. + + choice ESP_CONSOLE_UART + prompt "UART for console output" + default ESP_CONSOLE_UART_DEFAULT + help + Select whether to use UART for console output (through stdout and stderr). + + - Default is to use UART0 on pins GPIO1(TX) and GPIO3(RX). + - If "Custom" is selected, UART0 or UART1 can be chosen, + and any pins can be selected. + - If "None" is selected, there will be no console output on any UART, except + for initial output from ROM bootloader. This output can be further suppressed by + bootstrapping GPIO13 pin to low logic level. + + config ESP_CONSOLE_UART_DEFAULT + bool "Default: UART0, TX=GPIO1, RX=GPIO3" + config ESP_CONSOLE_UART_CUSTOM + bool "Custom" + config ESP_CONSOLE_UART_NONE + bool "None" + endchoice + + choice ESP_CONSOLE_UART_NUM + prompt "UART peripheral to use for console output (0-1)" + depends on ESP_CONSOLE_UART_CUSTOM + default ESP_CONSOLE_UART_CUSTOM_NUM_0 + help + Due of a ROM bug, UART2 is not supported for console output + via ets_printf. + + config ESP_CONSOLE_UART_CUSTOM_NUM_0 + bool "UART0" + config ESP_CONSOLE_UART_CUSTOM_NUM_1 + bool "UART1" + endchoice + + config ESP_CONSOLE_UART_NUM + int + default 0 if ESP_CONSOLE_UART_DEFAULT || ESP_CONSOLE_UART_NONE + default 0 if ESP_CONSOLE_UART_CUSTOM_NUM_0 + default 1 if ESP_CONSOLE_UART_CUSTOM_NUM_1 + + config ESP_CONSOLE_UART_TX_GPIO + int "UART TX on GPIO#" + depends on ESP_CONSOLE_UART_CUSTOM + range 0 33 + default 19 + + config ESP_CONSOLE_UART_RX_GPIO + int "UART RX on GPIO#" + depends on ESP_CONSOLE_UART_CUSTOM + range 0 39 + default 21 + + config ESP_CONSOLE_UART_BAUDRATE + int "UART console baud rate" + depends on !ESP_CONSOLE_UART_NONE + default 115200 + range 1200 4000000 + + + config ESP_GDBSTUB_SUPPORT_TASKS + bool "GDBStub: enable listing FreeRTOS tasks" + default y + depends on ESP32_PANIC_GDBSTUB + help + If enabled, GDBStub can supply the list of FreeRTOS tasks to GDB. + Thread list can be queried from GDB using 'info threads' command. + Note that if GDB task lists were corrupted, this feature may not work. + If GDBStub fails, try disabling this feature. + + config ESP_GDBSTUB_MAX_TASKS + int "GDBStub: maximum number of tasks supported" + default 32 + depends on ESP_GDBSTUB_SUPPORT_TASKS + help + Set the number of tasks which GDB Stub will support. + + + config ESP_INT_WDT + bool "Interrupt watchdog" + default y + help + This watchdog timer can detect if the FreeRTOS tick interrupt has not been called for a certain time, + either because a task turned off interrupts and did not turn them on for a long time, or because an + interrupt handler did not return. It will try to invoke the panic handler first and failing that + reset the SoC. + + config ESP_INT_WDT_TIMEOUT_MS + int "Interrupt watchdog timeout (ms)" + depends on ESP_INT_WDT + default 300 if !ESP32_SPIRAM_SUPPORT + default 800 if ESP32_SPIRAM_SUPPORT + range 10 10000 + help + The timeout of the watchdog, in miliseconds. Make this higher than the FreeRTOS tick rate. + + config ESP_INT_WDT_CHECK_CPU1 + bool "Also watch CPU1 tick interrupt" + depends on ESP_INT_WDT && !FREERTOS_UNICORE + default y + help + Also detect if interrupts on CPU 1 are disabled for too long. + + config ESP_TASK_WDT + bool "Initialize Task Watchdog Timer on startup" + default y + help + The Task Watchdog Timer can be used to make sure individual tasks are still + running. Enabling this option will cause the Task Watchdog Timer to be + initialized automatically at startup. The Task Watchdog timer can be + initialized after startup as well (see Task Watchdog Timer API Reference) + + config ESP_TASK_WDT_PANIC + bool "Invoke panic handler on Task Watchdog timeout" + depends on ESP_TASK_WDT + default n + help + If this option is enabled, the Task Watchdog Timer will be configured to + trigger the panic handler when it times out. This can also be configured + at run time (see Task Watchdog Timer API Reference) + + config ESP_TASK_WDT_TIMEOUT_S + int "Task Watchdog timeout period (seconds)" + depends on ESP_TASK_WDT + range 1 60 + default 5 + help + Timeout period configuration for the Task Watchdog Timer in seconds. + This is also configurable at run time (see Task Watchdog Timer API Reference) + + config ESP_TASK_WDT_CHECK_IDLE_TASK_CPU0 + bool "Watch CPU0 Idle Task" + depends on ESP_TASK_WDT + default y + help + If this option is enabled, the Task Watchdog Timer will watch the CPU0 + Idle Task. Having the Task Watchdog watch the Idle Task allows for detection + of CPU starvation as the Idle Task not being called is usually a symptom of + CPU starvation. Starvation of the Idle Task is detrimental as FreeRTOS household + tasks depend on the Idle Task getting some runtime every now and then. + + config ESP_TASK_WDT_CHECK_IDLE_TASK_CPU1 + bool "Watch CPU1 Idle Task" + depends on ESP_TASK_WDT && !FREERTOS_UNICORE + default y + help + If this option is enabled, the Task Wtachdog Timer will wach the CPU1 + Idle Task. + +endmenu # Common ESP-related diff --git a/components/esp_common/include/esp_system.h b/components/esp_common/include/esp_system.h index 97dc91622..c57502c21 100644 --- a/components/esp_common/include/esp_system.h +++ b/components/esp_common/include/esp_system.h @@ -37,7 +37,7 @@ typedef enum { /** @cond */ #define TWO_UNIVERSAL_MAC_ADDR 2 #define FOUR_UNIVERSAL_MAC_ADDR 4 -#define UNIVERSAL_MAC_ADDR_NUM CONFIG_NUMBER_OF_UNIVERSAL_MAC_ADDRESS +#define UNIVERSAL_MAC_ADDR_NUM CONFIG_ESP32_UNIVERSAL_MAC_ADDRESSES /** @endcond */ /** diff --git a/components/esp_common/include/esp_task.h b/components/esp_common/include/esp_task.h index 07b08434e..57e41d333 100644 --- a/components/esp_common/include/esp_task.h +++ b/components/esp_common/include/esp_task.h @@ -47,12 +47,12 @@ /* idf task */ #define ESP_TASK_TIMER_PRIO (ESP_TASK_PRIO_MAX - 3) -#define ESP_TASK_TIMER_STACK (CONFIG_TIMER_TASK_STACK_SIZE + TASK_EXTRA_STACK_SIZE) +#define ESP_TASK_TIMER_STACK (CONFIG_ESP_TIMER_TASK_STACK_SIZE + TASK_EXTRA_STACK_SIZE) #define ESP_TASKD_EVENT_PRIO (ESP_TASK_PRIO_MAX - 5) -#define ESP_TASKD_EVENT_STACK (CONFIG_SYSTEM_EVENT_TASK_STACK_SIZE + TASK_EXTRA_STACK_SIZE) +#define ESP_TASKD_EVENT_STACK (CONFIG_ESP_SYSTEM_EVENT_TASK_STACK_SIZE + TASK_EXTRA_STACK_SIZE) #define ESP_TASK_TCPIP_PRIO (ESP_TASK_PRIO_MAX - 7) #define ESP_TASK_TCPIP_STACK (CONFIG_LWIP_TCPIP_TASK_STACK_SIZE + TASK_EXTRA_STACK_SIZE) #define ESP_TASK_MAIN_PRIO (ESP_TASK_PRIO_MIN + 1) -#define ESP_TASK_MAIN_STACK (CONFIG_MAIN_TASK_STACK_SIZE + TASK_EXTRA_STACK_SIZE) +#define ESP_TASK_MAIN_STACK (CONFIG_ESP_MAIN_TASK_STACK_SIZE + TASK_EXTRA_STACK_SIZE) #endif diff --git a/components/esp_common/sdkconfig.rename b/components/esp_common/sdkconfig.rename new file mode 100644 index 000000000..9e65f1033 --- /dev/null +++ b/components/esp_common/sdkconfig.rename @@ -0,0 +1,28 @@ +# sdkconfig replacement configurations for deprecated options formatted as +# CONFIG_DEPRECATED_OPTION CONFIG_NEW_OPTION + +CONFIG_SYSTEM_EVENT_QUEUE_SIZE CONFIG_ESP_SYSTEM_EVENT_QUEUE_SIZE +CONFIG_SYSTEM_EVENT_TASK_STACK_SIZE CONFIG_ESP_SYSTEM_EVENT_TASK_STACK_SIZE +CONFIG_MAIN_TASK_STACK_SIZE CONFIG_ESP_MAIN_TASK_STACK_SIZE +CONFIG_IPC_TASK_STACK_SIZE CONFIG_ESP_IPC_TASK_STACK_SIZE +CONFIG_TIMER_TASK_STACK_SIZE CONFIG_ESP_TIMER_TASK_STACK_SIZE +CONFIG_CONSOLE_UART CONFIG_ESP_CONSOLE_UART +CONFIG_CONSOLE_UART_DEFAULT CONFIG_ESP_CONSOLE_UART_DEFAULT +CONFIG_CONSOLE_UART_CUSTOM CONFIG_ESP_CONSOLE_UART_CUSTOM +CONFIG_CONSOLE_UART_NONE CONFIG_ESP_CONSOLE_UART_NONE +CONFIG_CONSOLE_UART_NUM CONFIG_ESP_CONSOLE_UART_NUM +CONFIG_CONSOLE_UART_CUSTOM_NUM_0 CONFIG_ESP_CONSOLE_UART_CUSTOM_NUM_0 +CONFIG_CONSOLE_UART_CUSTOM_NUM_1 CONFIG_ESP_CONSOLE_UART_CUSTOM_NUM_1 +CONFIG_CONSOLE_UART_TX_GPIO CONFIG_ESP_CONSOLE_UART_TX_GPIO +CONFIG_CONSOLE_UART_RX_GPIO CONFIG_ESP_CONSOLE_UART_RX_GPIO +CONFIG_CONSOLE_UART_BAUDRATE CONFIG_ESP_CONSOLE_UART_BAUDRATE +CONFIG_GDBSTUB_SUPPORT_TASKS CONFIG_ESP_GDBSTUB_SUPPORT_TASKS +CONFIG_GDBSTUB_MAX_TASKS CONFIG_ESP_GDBSTUB_MAX_TASKS +CONFIG_INT_WDT CONFIG_ESP_INT_WDT +CONFIG_INT_WDT_TIMEOUT_MS CONFIG_ESP_INT_WDT_TIMEOUT_MS +CONFIG_INT_WDT_CHECK_CPU1 CONFIG_ESP_INT_WDT_CHECK_CPU1 +CONFIG_TASK_WDT CONFIG_ESP_TASK_WDT +CONFIG_TASK_WDT_PANIC CONFIG_ESP_TASK_WDT_PANIC +CONFIG_TASK_WDT_TIMEOUT_S CONFIG_ESP_TASK_WDT_TIMEOUT_S +CONFIG_TASK_WDT_CHECK_IDLE_TASK_CPU0 CONFIG_ESP_TASK_WDT_CHECK_IDLE_TASK_CPU0 +CONFIG_TASK_WDT_CHECK_IDLE_TASK_CPU1 CONFIG_ESP_TASK_WDT_CHECK_IDLE_TASK_CPU1 diff --git a/components/esp_common/src/ipc.c b/components/esp_common/src/ipc.c index b54ae2846..927db9087 100644 --- a/components/esp_common/src/ipc.c +++ b/components/esp_common/src/ipc.c @@ -92,7 +92,7 @@ static void esp_ipc_init() for (int i = 0; i < portNUM_PROCESSORS; ++i) { snprintf(task_name, sizeof(task_name), "ipc%d", i); s_ipc_sem[i] = xSemaphoreCreateBinary(); - portBASE_TYPE res = xTaskCreatePinnedToCore(ipc_task, task_name, CONFIG_IPC_TASK_STACK_SIZE, (void*) i, + portBASE_TYPE res = xTaskCreatePinnedToCore(ipc_task, task_name, CONFIG_ESP_IPC_TASK_STACK_SIZE, (void*) i, configMAX_PRIORITIES - 1, NULL, i); assert(res == pdTRUE); } diff --git a/components/esp_event/default_event_loop.c b/components/esp_event/default_event_loop.c index fa97065fb..9cad68887 100644 --- a/components/esp_event/default_event_loop.c +++ b/components/esp_event/default_event_loop.c @@ -76,7 +76,7 @@ esp_err_t esp_event_loop_create_default() } esp_event_loop_args_t loop_args = { - .queue_size = CONFIG_SYSTEM_EVENT_QUEUE_SIZE, + .queue_size = CONFIG_ESP_SYSTEM_EVENT_QUEUE_SIZE, .task_name = "sys_evt", .task_stack_size = ESP_TASKD_EVENT_STACK, .task_priority = ESP_TASKD_EVENT_PRIO, diff --git a/components/esp_event/test/test_event.c b/components/esp_event/test/test_event.c index 7153a08bb..3b2ff0c68 100644 --- a/components/esp_event/test/test_event.c +++ b/components/esp_event/test/test_event.c @@ -42,7 +42,7 @@ static const char* TAG = "test_event"; #define TEST_TEARDOWN() \ test_teardown(); \ - vTaskDelay(pdMS_TO_TICKS(CONFIG_INT_WDT_TIMEOUT_MS * TEST_CONFIG_WAIT_MULTIPLIER)); \ + vTaskDelay(pdMS_TO_TICKS(CONFIG_ESP_INT_WDT_TIMEOUT_MS * TEST_CONFIG_WAIT_MULTIPLIER)); \ TEST_ASSERT_EQUAL(free_mem_before, heap_caps_get_free_size(MALLOC_CAP_DEFAULT)); typedef struct { @@ -118,7 +118,7 @@ static BaseType_t test_event_get_core() static esp_event_loop_args_t test_event_get_default_loop_args() { esp_event_loop_args_t loop_config = { - .queue_size = CONFIG_SYSTEM_EVENT_QUEUE_SIZE, + .queue_size = CONFIG_ESP_SYSTEM_EVENT_QUEUE_SIZE, .task_name = "loop", .task_priority = s_test_priority, .task_stack_size = 2048, @@ -855,11 +855,11 @@ static void performance_test(bool dedicated_task) // Enabling profiling will slow down event dispatch, so the set threshold // is not valid when it is enabled. #else -#ifndef CONFIG_SPIRAM_SUPPORT +#ifndef CONFIG_ESP32_SPIRAM_SUPPORT TEST_PERFORMANCE_GREATER_THAN(EVENT_DISPATCH, "%d", average); #else TEST_PERFORMANCE_GREATER_THAN(EVENT_DISPATCH_PSRAM, "%d", average); -#endif // CONFIG_SPIRAM_SUPPORT +#endif // CONFIG_ESP32_SPIRAM_SUPPORT #endif // CONFIG_ESP_EVENT_LOOP_PROFILING } @@ -912,11 +912,11 @@ TEST_CASE("can post to loop from handler - dedicated task", "[event]") } TEST_ASSERT_EQUAL(ESP_ERR_TIMEOUT, esp_event_post_to(loop_w_task, s_test_base1, TEST_EVENT_BASE1_EV2, NULL, 0, - pdMS_TO_TICKS(CONFIG_INT_WDT_TIMEOUT_MS * TEST_CONFIG_WAIT_MULTIPLIER))); + pdMS_TO_TICKS(CONFIG_ESP_INT_WDT_TIMEOUT_MS * TEST_CONFIG_WAIT_MULTIPLIER))); xSemaphoreGive(arg.mutex); - vTaskDelay(pdMS_TO_TICKS(CONFIG_INT_WDT_TIMEOUT_MS * TEST_CONFIG_WAIT_MULTIPLIER)); + vTaskDelay(pdMS_TO_TICKS(CONFIG_ESP_INT_WDT_TIMEOUT_MS * TEST_CONFIG_WAIT_MULTIPLIER)); TEST_ASSERT_EQUAL(ESP_OK, esp_event_loop_delete(loop_w_task)); @@ -964,15 +964,15 @@ TEST_CASE("can post to loop from handler - no dedicated task", "[event]") TEST_ASSERT_EQUAL(ESP_OK, esp_event_post_to(loop_wo_task, s_test_base1, TEST_EVENT_BASE1_EV1, &loop_wo_task, sizeof(&loop_wo_task), portMAX_DELAY)); - vTaskDelay(pdMS_TO_TICKS(CONFIG_INT_WDT_TIMEOUT_MS * TEST_CONFIG_WAIT_MULTIPLIER)); + vTaskDelay(pdMS_TO_TICKS(CONFIG_ESP_INT_WDT_TIMEOUT_MS * TEST_CONFIG_WAIT_MULTIPLIER)); // For loop without tasks, posting is more restrictive. Posting should wait until execution of handler finishes TEST_ASSERT_EQUAL(ESP_ERR_TIMEOUT, esp_event_post_to(loop_wo_task, s_test_base1, TEST_EVENT_BASE1_EV2, NULL, 0, - pdMS_TO_TICKS(CONFIG_INT_WDT_TIMEOUT_MS * TEST_CONFIG_WAIT_MULTIPLIER))); + pdMS_TO_TICKS(CONFIG_ESP_INT_WDT_TIMEOUT_MS * TEST_CONFIG_WAIT_MULTIPLIER))); xSemaphoreGive(arg.mutex); - vTaskDelay(pdMS_TO_TICKS(CONFIG_INT_WDT_TIMEOUT_MS * TEST_CONFIG_WAIT_MULTIPLIER)); + vTaskDelay(pdMS_TO_TICKS(CONFIG_ESP_INT_WDT_TIMEOUT_MS * TEST_CONFIG_WAIT_MULTIPLIER)); vTaskDelete(mtask); diff --git a/components/esp_wifi/CMakeLists.txt b/components/esp_wifi/CMakeLists.txt index b87c51881..218b4b644 100644 --- a/components/esp_wifi/CMakeLists.txt +++ b/components/esp_wifi/CMakeLists.txt @@ -11,14 +11,14 @@ set(COMPONENT_PRIV_INCLUDEDIRS) set(COMPONENT_REQUIRES) set(COMPONENT_PRIV_REQUIRES "wpa_supplicant" "nvs_flash") -if(NOT CONFIG_NO_BLOBS) +if(NOT CONFIG_ESP32_NO_BLOBS) set(COMPONENT_ADD_LDFRAGMENTS "linker.lf") endif() register_component() target_link_libraries(${COMPONENT_LIB} "-L ${CMAKE_CURRENT_SOURCE_DIR}/lib_${IDF_TARGET}") -if(NOT CONFIG_NO_BLOBS) +if(NOT CONFIG_ESP32_NO_BLOBS) target_link_libraries(${COMPONENT_LIB} "-L ${CMAKE_CURRENT_SOURCE_DIR}/lib_${IDF_TARGET}") target_link_libraries(${COMPONENT_LIB} coexist core espnow mesh net80211 phy pp rtc smartconfig wpa2 wpa wps) endif() @@ -43,4 +43,4 @@ if(CONFIG_ESP32_PHY_INIT_DATA_IN_PARTITION) add_dependencies(app phy_init_data) esptool_py_flash_project_args(phy ${phy_partition_offset} ${phy_init_data_bin} FLASH_IN_PROJECT) -endif() \ No newline at end of file +endif() diff --git a/components/esp_wifi/Kconfig b/components/esp_wifi/Kconfig index 6aacbbcdd..89d2b44b3 100644 --- a/components/esp_wifi/Kconfig +++ b/components/esp_wifi/Kconfig @@ -45,10 +45,10 @@ menu Wi-Fi config ESP32_WIFI_STATIC_RX_BUFFER_NUM int "Max number of WiFi static RX buffers" - range 2 25 if !WIFI_LWIP_ALLOCATION_FROM_SPIRAM_FIRST - range 8 25 if WIFI_LWIP_ALLOCATION_FROM_SPIRAM_FIRST - default 10 if !WIFI_LWIP_ALLOCATION_FROM_SPIRAM_FIRST - default 16 if WIFI_LWIP_ALLOCATION_FROM_SPIRAM_FIRST + range 2 25 if !SPIRAM_TRY_ALLOCATE_WIFI_LWIP + range 8 25 if SPIRAM_TRY_ALLOCATE_WIFI_LWIP + default 10 if !SPIRAM_TRY_ALLOCATE_WIFI_LWIP + default 16 if SPIRAM_TRY_ALLOCATE_WIFI_LWIP help Set the number of WiFi static RX buffers. Each buffer takes approximately 1.6KB of RAM. The static rx buffers are allocated when esp_wifi_init is called, they are not freed @@ -170,10 +170,10 @@ menu Wi-Fi config ESP32_WIFI_RX_BA_WIN int "WiFi AMPDU RX BA window size" depends on ESP32_WIFI_AMPDU_RX_ENABLED - range 2 32 if !WIFI_LWIP_ALLOCATION_FROM_SPIRAM_FIRST - range 16 32 if WIFI_LWIP_ALLOCATION_FROM_SPIRAM_FIRST - default 6 if !WIFI_LWIP_ALLOCATION_FROM_SPIRAM_FIRST - default 16 if WIFI_LWIP_ALLOCATION_FROM_SPIRAM_FIRST + range 2 32 if !SPIRAM_TRY_ALLOCATE_WIFI_LWIP + range 16 32 if SPIRAM_TRY_ALLOCATE_WIFI_LWIP + default 6 if !SPIRAM_TRY_ALLOCATE_WIFI_LWIP + default 16 if SPIRAM_TRY_ALLOCATE_WIFI_LWIP help Set the size of WiFi Block Ack RX window. Generally a bigger value means higher throughput and better compatibility but more memory. Most of time we should NOT change the default value unless special diff --git a/components/esp_wifi/component.mk b/components/esp_wifi/component.mk index a95dc1e96..a72ad1ccd 100644 --- a/components/esp_wifi/component.mk +++ b/components/esp_wifi/component.mk @@ -5,7 +5,7 @@ COMPONENT_ADD_INCLUDEDIRS := include COMPONENT_SRCDIRS := src -ifndef CONFIG_NO_BLOBS +ifndef CONFIG_ESP32_NO_BLOBS LIBS := core rtc net80211 pp wpa smartconfig coexist wps wpa2 espnow phy mesh COMPONENT_ADD_LDFLAGS += -L$(COMPONENT_PATH)/lib_$(IDF_TARGET) \ $(addprefix -l,$(LIBS)) diff --git a/components/esp_wifi/src/phy_init.c b/components/esp_wifi/src/phy_init.c index ba1f76745..c587e7140 100644 --- a/components/esp_wifi/src/phy_init.c +++ b/components/esp_wifi/src/phy_init.c @@ -582,7 +582,7 @@ static esp_err_t store_cal_data_to_nvs_handle(nvs_handle handle, return err; } -#if CONFIG_REDUCE_PHY_TX_POWER +#if CONFIG_ESP32_REDUCE_PHY_TX_POWER static void esp_phy_reduce_tx_power(esp_phy_init_data_t* init_data) { uint8_t i; @@ -603,7 +603,7 @@ void esp_phy_load_cal_and_init(phy_rf_module_t module) abort(); } -#if CONFIG_REDUCE_PHY_TX_POWER +#if CONFIG_ESP32_REDUCE_PHY_TX_POWER const esp_phy_init_data_t* phy_init_data = esp_phy_get_init_data(); if (phy_init_data == NULL) { ESP_LOGE(TAG, "failed to obtain PHY init data"); @@ -653,7 +653,7 @@ void esp_phy_load_cal_and_init(phy_rf_module_t module) esp_phy_rf_init(init_data, PHY_RF_CAL_FULL, cal_data, module); #endif -#if CONFIG_REDUCE_PHY_TX_POWER +#if CONFIG_ESP32_REDUCE_PHY_TX_POWER esp_phy_release_init_data(phy_init_data); free(init_data); #else diff --git a/components/ethernet/emac_main.c b/components/ethernet/emac_main.c index 2f9feedf1..7b087772d 100644 --- a/components/ethernet/emac_main.c +++ b/components/ethernet/emac_main.c @@ -1116,7 +1116,7 @@ esp_err_t esp_eth_init_internal(eth_config_t *config) periph_module_enable(PERIPH_EMAC_MODULE); if (emac_config.clock_mode != ETH_CLOCK_GPIO0_IN) { -#if CONFIG_SPIRAM_SUPPORT +#if CONFIG_ESP32_SPIRAM_SUPPORT if (esp_spiram_is_initialized()) { ESP_LOGE(TAG, "GPIO16 and GPIO17 has been occupied by PSRAM, Only ETH_CLOCK_GPIO_IN is supported!"); ret = ESP_FAIL; diff --git a/components/freertos/port.c b/components/freertos/port.c index b00a9a853..04e5efa30 100644 --- a/components/freertos/port.c +++ b/components/freertos/port.c @@ -435,7 +435,7 @@ void vPortSetStackWatchpoint( void* pxStackStart ) { esp_set_watchpoint(1, (char*)addr, 32, ESP_WATCHPOINT_STORE); } -#if defined(CONFIG_SPIRAM_SUPPORT) +#if defined(CONFIG_ESP32_SPIRAM_SUPPORT) /* * Compare & set (S32C1) does not work in external RAM. Instead, this routine uses a mux (in internal memory) to fake it. */ @@ -459,7 +459,7 @@ void uxPortCompareSetExtram(volatile uint32_t *addr, uint32_t compare, uint32_t vPortCPUReleaseMutexIntsDisabled(&extram_mux); #endif } -#endif //defined(CONFIG_SPIRAM_SUPPORT) +#endif //defined(CONFIG_ESP32_SPIRAM_SUPPORT) diff --git a/components/freertos/portmux_impl.h b/components/freertos/portmux_impl.h index 819a7291a..5aef351b6 100644 --- a/components/freertos/portmux_impl.h +++ b/components/freertos/portmux_impl.h @@ -64,7 +64,7 @@ #undef PORTMUX_COMPARE_SET_FN_NAME -#if defined(CONFIG_SPIRAM_SUPPORT) +#if defined(CONFIG_ESP32_SPIRAM_SUPPORT) #define PORTMUX_AQUIRE_MUX_FN_NAME vPortCPUAcquireMutexIntsDisabledExtram #define PORTMUX_RELEASE_MUX_FN_NAME vPortCPUReleaseMutexIntsDisabledExtram @@ -91,7 +91,7 @@ static inline bool __attribute__((always_inline)) vPortCPUAcquireMutexIntsDisabled(PORTMUX_AQUIRE_MUX_FN_ARGS) { -#if defined(CONFIG_SPIRAM_SUPPORT) +#if defined(CONFIG_ESP32_SPIRAM_SUPPORT) if (esp_ptr_external_ram(mux)) { return vPortCPUAcquireMutexIntsDisabledExtram(PORTMUX_AQUIRE_MUX_FN_CALL_ARGS(mux)); } @@ -101,7 +101,7 @@ static inline bool __attribute__((always_inline)) vPortCPUAcquireMutexIntsDisabl static inline void vPortCPUReleaseMutexIntsDisabled(PORTMUX_RELEASE_MUX_FN_ARGS) { -#if defined(CONFIG_SPIRAM_SUPPORT) +#if defined(CONFIG_ESP32_SPIRAM_SUPPORT) if (esp_ptr_external_ram(mux)) { vPortCPUReleaseMutexIntsDisabledExtram(PORTMUX_RELEASE_MUX_FN_CALL_ARGS(mux)); return; diff --git a/components/freertos/test/test_spinlocks.c b/components/freertos/test/test_spinlocks.c index c6fb6bcf0..3a99ebe2b 100644 --- a/components/freertos/test/test_spinlocks.c +++ b/components/freertos/test/test_spinlocks.c @@ -48,7 +48,7 @@ TEST_CASE("portMUX spinlocks (no contention)", "[freertos]") #ifdef CONFIG_FREERTOS_UNICORE TEST_PERFORMANCE_LESS_THAN(FREERTOS_SPINLOCK_CYCLES_PER_OP_UNICORE, "%d cycles/op", ((end - start)/REPEAT_OPS)); #else -#if CONFIG_SPIRAM_SUPPORT +#if CONFIG_ESP32_SPIRAM_SUPPORT TEST_PERFORMANCE_LESS_THAN(FREERTOS_SPINLOCK_CYCLES_PER_OP_PSRAM, "%d cycles/op", ((end - start)/REPEAT_OPS)); #else TEST_PERFORMANCE_LESS_THAN(FREERTOS_SPINLOCK_CYCLES_PER_OP, "%d cycles/op", ((end - start)/REPEAT_OPS)); diff --git a/components/mbedtls/Kconfig b/components/mbedtls/Kconfig index 4ba018022..5ad419cec 100644 --- a/components/mbedtls/Kconfig +++ b/components/mbedtls/Kconfig @@ -24,7 +24,7 @@ menu "mbedTLS" config MBEDTLS_EXTERNAL_MEM_ALLOC bool "External SPIRAM" - depends on SPIRAM_SUPPORT + depends on ESP32_SPIRAM_SUPPORT config MBEDTLS_DEFAULT_MEM_ALLOC bool "Default alloc mode" diff --git a/components/newlib/Kconfig b/components/newlib/Kconfig new file mode 100644 index 000000000..2547cb318 --- /dev/null +++ b/components/newlib/Kconfig @@ -0,0 +1,72 @@ +menu "Newlib" + + choice NEWLIB_STDOUT_LINE_ENDING + prompt "Line ending for UART output" + default NEWLIB_STDOUT_LINE_ENDING_CRLF + help + This option allows configuring the desired line endings sent to UART + when a newline ('\n', LF) appears on stdout. + Three options are possible: + + CRLF: whenever LF is encountered, prepend it with CR + + LF: no modification is applied, stdout is sent as is + + CR: each occurence of LF is replaced with CR + + This option doesn't affect behavior of the UART driver (drivers/uart.h). + + config NEWLIB_STDOUT_LINE_ENDING_CRLF + bool "CRLF" + config NEWLIB_STDOUT_LINE_ENDING_LF + bool "LF" + config NEWLIB_STDOUT_LINE_ENDING_CR + bool "CR" + endchoice + + choice NEWLIB_STDIN_LINE_ENDING + prompt "Line ending for UART input" + default NEWLIB_STDIN_LINE_ENDING_CR + help + This option allows configuring which input sequence on UART produces + a newline ('\n', LF) on stdin. + Three options are possible: + + CRLF: CRLF is converted to LF + + LF: no modification is applied, input is sent to stdin as is + + CR: each occurence of CR is replaced with LF + + This option doesn't affect behavior of the UART driver (drivers/uart.h). + + config NEWLIB_STDIN_LINE_ENDING_CRLF + bool "CRLF" + config NEWLIB_STDIN_LINE_ENDING_LF + bool "LF" + config NEWLIB_STDIN_LINE_ENDING_CR + bool "CR" + endchoice + + config NEWLIB_NANO_FORMAT + bool "Enable 'nano' formatting options for printf/scanf family" + default n + help + ESP32 ROM contains parts of newlib C library, including printf/scanf family + of functions. These functions have been compiled with so-called "nano" + formatting option. This option doesn't support 64-bit integer formats and C99 + features, such as positional arguments. + + For more details about "nano" formatting option, please see newlib readme file, + search for '--enable-newlib-nano-formatted-io': + https://sourceware.org/newlib/README + + If this option is enabled, build system will use functions available in + ROM, reducing the application binary size. Functions available in ROM run + faster than functions which run from flash. Functions available in ROM can + also run when flash instruction cache is disabled. + + If you need 64-bit integer formatting support or C99 features, keep this + option disabled. + +endmenu # Newlib diff --git a/components/newlib/test/test_newlib.c b/components/newlib/test/test_newlib.c index 2cf0412fa..12a10e4d5 100644 --- a/components/newlib/test/test_newlib.c +++ b/components/newlib/test/test_newlib.c @@ -125,14 +125,14 @@ static bool fn_in_rom(void *fn, const char *name) TEST_CASE("check if ROM or Flash is used for functions", "[newlib]") { -#if defined(CONFIG_NEWLIB_NANO_FORMAT) && !defined(CONFIG_SPIRAM_SUPPORT) +#if defined(CONFIG_NEWLIB_NANO_FORMAT) && !defined(CONFIG_ESP32_SPIRAM_SUPPORT) TEST_ASSERT(fn_in_rom(printf, "printf")); TEST_ASSERT(fn_in_rom(sscanf, "sscanf")); #else TEST_ASSERT_FALSE(fn_in_rom(printf, "printf")); TEST_ASSERT_FALSE(fn_in_rom(sscanf, "sscanf")); #endif -#if !defined(CONFIG_SPIRAM_SUPPORT) +#if !defined(CONFIG_ESP32_SPIRAM_SUPPORT) TEST_ASSERT(fn_in_rom(atoi, "atoi")); TEST_ASSERT(fn_in_rom(strtol, "strtol")); #else diff --git a/components/newlib/test/test_time.c b/components/newlib/test/test_time.c index 8e1fc0f00..213e42c3f 100644 --- a/components/newlib/test/test_time.c +++ b/components/newlib/test/test_time.c @@ -346,7 +346,7 @@ void test_posix_timers_clock (void) printf("WITH_RTC "); #endif -#ifdef CONFIG_ESP32_RTC_CLOCK_SOURCE_EXTERNAL_CRYSTAL +#ifdef CONFIG_ESP32_RTC_CLK_SRC_EXT_CRYS printf("External (crystal) Frequency = %d Hz\n", rtc_clk_slow_freq_get_hz()); #else printf("Internal Frequency = %d Hz\n", rtc_clk_slow_freq_get_hz()); diff --git a/components/pthread/pthread.c b/components/pthread/pthread.c index 8b01089a8..84997c9aa 100644 --- a/components/pthread/pthread.c +++ b/components/pthread/pthread.c @@ -504,13 +504,13 @@ int pthread_once(pthread_once_t *once_control, void (*init_routine)(void)) } uint32_t res = 1; -#if defined(CONFIG_SPIRAM_SUPPORT) +#if defined(CONFIG_ESP32_SPIRAM_SUPPORT) if (esp_ptr_external_ram(once_control)) { uxPortCompareSetExtram((uint32_t *) &once_control->init_executed, 0, &res); } else { #endif uxPortCompareSet((uint32_t *) &once_control->init_executed, 0, &res); -#if defined(CONFIG_SPIRAM_SUPPORT) +#if defined(CONFIG_ESP32_SPIRAM_SUPPORT) } #endif // Check if compare and set was successful diff --git a/components/sdmmc/test/test_sd.c b/components/sdmmc/test/test_sd.c index ea0a144f3..07965960a 100644 --- a/components/sdmmc/test/test_sd.c +++ b/components/sdmmc/test/test_sd.c @@ -29,7 +29,7 @@ #include // Can't test eMMC (slot 0) and PSRAM together -#ifndef CONFIG_SPIRAM_SUPPORT +#ifndef CONFIG_ESP32_SPIRAM_SUPPORT #define WITH_EMMC_TEST #endif diff --git a/components/soc/esp32/rtc_clk.c b/components/soc/esp32/rtc_clk.c index d9243fd20..596ccf274 100644 --- a/components/soc/esp32/rtc_clk.c +++ b/components/soc/esp32/rtc_clk.c @@ -127,7 +127,7 @@ static void rtc_clk_32k_enable_common(int dac, int dres, int dbias) REG_SET_FIELD(RTC_IO_XTAL_32K_PAD_REG, RTC_IO_DRES_XTAL_32K, dres); REG_SET_FIELD(RTC_IO_XTAL_32K_PAD_REG, RTC_IO_DBIAS_XTAL_32K, dbias); -#ifdef CONFIG_ESP32_RTC_EXTERNAL_CRYSTAL_ADDITIONAL_CURRENT +#ifdef CONFIG_ESP32_RTC_EXT_CRYST_ADDIT_CURRENT /* TOUCH sensor can provide additional current to external XTAL. In some case, X32N and X32P PAD don't have enough drive capability to start XTAL */ SET_PERI_REG_MASK(RTC_IO_TOUCH_CFG_REG, RTC_IO_TOUCH_XPD_BIAS_M); @@ -141,7 +141,7 @@ static void rtc_clk_32k_enable_common(int dac, int dres, int dbias) So the Touch DAC start to drive some current from VDD to TOUCH8(which is also XTAL-N) */ SET_PERI_REG_MASK(RTC_IO_TOUCH_PAD9_REG, RTC_IO_TOUCH_PAD9_XPD_M); -#endif // CONFIG_ESP32_RTC_EXTERNAL_CRYSTAL_ADDITIONAL_CURRENT +#endif // CONFIG_ESP32_RTC_EXT_CRYST_ADDIT_CURRENT /* Power up external xtal */ SET_PERI_REG_MASK(RTC_IO_XTAL_32K_PAD_REG, RTC_IO_XPD_XTAL_32K_M); } @@ -155,10 +155,10 @@ void rtc_clk_32k_enable(bool enable) CLEAR_PERI_REG_MASK(RTC_IO_XTAL_32K_PAD_REG, RTC_IO_XPD_XTAL_32K_M); CLEAR_PERI_REG_MASK(RTC_IO_XTAL_32K_PAD_REG, RTC_IO_X32N_MUX_SEL | RTC_IO_X32P_MUX_SEL); -#ifdef CONFIG_ESP32_RTC_EXTERNAL_CRYSTAL_ADDITIONAL_CURRENT +#ifdef CONFIG_ESP32_RTC_EXT_CRYST_ADDIT_CURRENT /* Power down TOUCH */ CLEAR_PERI_REG_MASK(RTC_IO_TOUCH_PAD9_REG, RTC_IO_TOUCH_PAD9_XPD_M); -#endif // CONFIG_ESP32_RTC_EXTERNAL_CRYSTAL_ADDITIONAL_CURRENT +#endif // CONFIG_ESP32_RTC_EXT_CRYST_ADDIT_CURRENT } } diff --git a/components/soc/esp32/soc_memory_layout.c b/components/soc/esp32/soc_memory_layout.c index b3adc08b8..dcae0c472 100644 --- a/components/soc/esp32/soc_memory_layout.c +++ b/components/soc/esp32/soc_memory_layout.c @@ -60,7 +60,7 @@ const soc_memory_type_desc_t soc_memory_types[] = { { "PID5DRAM", { MALLOC_CAP_PID5|MALLOC_CAP_INTERNAL, MALLOC_CAP_8BIT, MALLOC_CAP_32BIT|MALLOC_CAP_DEFAULT }, false, false}, { "PID6DRAM", { MALLOC_CAP_PID6|MALLOC_CAP_INTERNAL, MALLOC_CAP_8BIT, MALLOC_CAP_32BIT|MALLOC_CAP_DEFAULT }, false, false}, { "PID7DRAM", { MALLOC_CAP_PID7|MALLOC_CAP_INTERNAL, MALLOC_CAP_8BIT, MALLOC_CAP_32BIT|MALLOC_CAP_DEFAULT }, false, false}, -#ifdef CONFIG_SPIRAM_SUPPORT +#ifdef CONFIG_ESP32_SPIRAM_SUPPORT //Type 15: SPI SRAM data { "SPIRAM", { MALLOC_CAP_SPIRAM|MALLOC_CAP_DEFAULT, 0, MALLOC_CAP_8BIT|MALLOC_CAP_32BIT}, false, false}, #endif @@ -75,7 +75,7 @@ Because of requirements in the coalescing code which merges adjacent regions, th from low to high start address. */ const soc_memory_region_t soc_memory_regions[] = { -#ifdef CONFIG_SPIRAM_SUPPORT +#ifdef CONFIG_ESP32_SPIRAM_SUPPORT { 0x3F800000, 0x400000, 15, 0}, //SPI SRAM, if available #endif { 0x3FFAE000, 0x2000, 0, 0}, //pool 16 <- used for rom code @@ -158,15 +158,15 @@ SOC_RESERVE_MEMORY_REGION(0x3ffe3f20, 0x3ffe4350, rom_app_data); //Reserve ROM A SOC_RESERVE_MEMORY_REGION(0x3ffae000, 0x3ffae6e0, rom_data); -#if CONFIG_MEMMAP_TRACEMEM -#if CONFIG_MEMMAP_TRACEMEM_TWOBANKS +#if CONFIG_ESP32_MEMMAP_TRACEMEM +#if CONFIG_ESP32_MEMMAP_TRACEMEM_TWOBANKS SOC_RESERVE_MEMORY_REGION(0x3fff8000, 0x40000000, trace_mem); //Reserve trace mem region, 32K for both cpu #else SOC_RESERVE_MEMORY_REGION(0x3fffc000, 0x40000000, trace_mem); //Reserve trace mem region, 16K (upper-half) for pro cpu #endif #endif -#ifdef CONFIG_SPIRAM_SUPPORT +#ifdef CONFIG_ESP32_SPIRAM_SUPPORT SOC_RESERVE_MEMORY_REGION(0x3f800000, 0x3fC00000, spi_ram); //SPI RAM gets added later if needed, in spiram.c; reserve it for now #endif diff --git a/components/soc/esp32/test/test_rtc_clk.c b/components/soc/esp32/test/test_rtc_clk.c index 9c1fe6898..3f8e87699 100644 --- a/components/soc/esp32/test/test_rtc_clk.c +++ b/components/soc/esp32/test/test_rtc_clk.c @@ -97,7 +97,7 @@ TEST_CASE("Output 8M XTAL clock to GPIO25", "[rtc_clk][ignore]") static void test_clock_switching(void (*switch_func)(const rtc_cpu_freq_config_t* config)) { - uart_tx_wait_idle(CONFIG_CONSOLE_UART_NUM); + uart_tx_wait_idle(CONFIG_ESP_CONSOLE_UART_NUM); const int test_duration_sec = 10; ref_clock_init(); @@ -164,7 +164,7 @@ static void start_freq(rtc_slow_freq_t required_src_freq, uint32_t start_delay_m uint32_t end_time; rtc_slow_freq_t selected_src_freq; stop_rtc_external_quartz(); -#ifdef CONFIG_ESP32_RTC_CLOCK_SOURCE_EXTERNAL_CRYSTAL +#ifdef CONFIG_ESP32_RTC_CLK_SRC_EXT_CRYS uint32_t bootstrap_cycles = CONFIG_ESP32_RTC_XTAL_BOOTSTRAP_CYCLES; printf("Test is started. Kconfig settings:\n External 32K crystal is selected,\n Oscillation cycles = %d,\n Calibration cycles = %d.\n", bootstrap_cycles, @@ -219,7 +219,7 @@ static void start_freq(rtc_slow_freq_t required_src_freq, uint32_t start_delay_m printf("Test passed successfully\n"); } -#ifdef CONFIG_SPIRAM_SUPPORT +#ifdef CONFIG_ESP32_SPIRAM_SUPPORT // PSRAM tests run on ESP-WROVER-KIT boards, which have the 32k XTAL installed. // Other tests may run on DevKitC boards, which don't have a 32k XTAL. TEST_CASE("Test starting external RTC quartz", "[rtc_clk]") @@ -228,7 +228,7 @@ TEST_CASE("Test starting external RTC quartz", "[rtc_clk]") uint32_t start_time; uint32_t end_time; stop_rtc_external_quartz(); -#ifdef CONFIG_ESP32_RTC_CLOCK_SOURCE_EXTERNAL_CRYSTAL +#ifdef CONFIG_ESP32_RTC_CLK_SRC_EXT_CRYS uint32_t bootstrap_cycles = CONFIG_ESP32_RTC_XTAL_BOOTSTRAP_CYCLES; printf("Test is started. Kconfig settings:\n External 32K crystal is selected,\n Oscillation cycles = %d,\n Calibration cycles = %d.\n", bootstrap_cycles, @@ -285,4 +285,4 @@ TEST_CASE("Test starting 'External 32kHz XTAL' on the board without it.", "[rtc_ start_freq(RTC_SLOW_FREQ_RTC, 0); } -#endif // CONFIG_SPIRAM_SUPPORT +#endif // CONFIG_ESP32_SPIRAM_SUPPORT diff --git a/components/soc/include/soc/soc_memory_layout.h b/components/soc/include/soc/soc_memory_layout.h index 5587abe8d..87454aa5c 100644 --- a/components/soc/include/soc/soc_memory_layout.h +++ b/components/soc/include/soc/soc_memory_layout.h @@ -161,7 +161,7 @@ inline static bool IRAM_ATTR esp_ptr_byte_accessible(const void *p) { bool r; r = ((intptr_t)p >= SOC_BYTE_ACCESSIBLE_LOW && (intptr_t)p < SOC_BYTE_ACCESSIBLE_HIGH); -#if CONFIG_SPIRAM_SUPPORT +#if CONFIG_ESP32_SPIRAM_SUPPORT r |= ((intptr_t)p >= SOC_EXTRAM_DATA_LOW && (intptr_t)p < SOC_EXTRAM_DATA_HIGH); #endif return r; diff --git a/components/spi_flash/flash_mmap.c b/components/spi_flash/flash_mmap.c index 66a8a61d9..76e2d025c 100644 --- a/components/spi_flash/flash_mmap.c +++ b/components/spi_flash/flash_mmap.c @@ -226,7 +226,7 @@ esp_err_t IRAM_ATTR spi_flash_mmap_pages(const int *pages, size_t page_count, sp entire cache. */ if (need_flush) { -#if CONFIG_SPIRAM_SUPPORT +#if CONFIG_ESP32_SPIRAM_SUPPORT esp_spiram_writeback_cache(); #endif Cache_Flush(0); @@ -421,7 +421,7 @@ IRAM_ATTR bool spi_flash_check_and_flush_cache(size_t start_addr, size_t length) } if (is_page_mapped_in_cache(page)) { -#if CONFIG_SPIRAM_SUPPORT +#if CONFIG_ESP32_SPIRAM_SUPPORT esp_spiram_writeback_cache(); #endif Cache_Flush(0); diff --git a/components/spi_flash/test/test_read_write.c b/components/spi_flash/test/test_read_write.c index 66e2d3152..e46480f61 100644 --- a/components/spi_flash/test/test_read_write.c +++ b/components/spi_flash/test/test_read_write.c @@ -219,7 +219,7 @@ TEST_CASE("Test spi_flash_write", "[spi_flash]") ESP_ERROR_CHECK(spi_flash_write(start, (char *) 0x40080000, 16)); } -#ifdef CONFIG_SPIRAM_SUPPORT +#ifdef CONFIG_ESP32_SPIRAM_SUPPORT TEST_CASE("spi_flash_read can read into buffer in external RAM", "[spi_flash]") { @@ -265,4 +265,4 @@ TEST_CASE("spi_flash_write can write from external RAM buffer", "[spi_flash]") free(buf_int); } -#endif // CONFIG_SPIRAM_SUPPORT +#endif // CONFIG_ESP32_SPIRAM_SUPPORT diff --git a/components/ulp/ld/esp32.ulp.ld b/components/ulp/ld/esp32.ulp.ld index 4c29ea59c..bd07c78cf 100644 --- a/components/ulp/ld/esp32.ulp.ld +++ b/components/ulp/ld/esp32.ulp.ld @@ -4,7 +4,7 @@ #define HEADER_SIZE 12 MEMORY { - ram(RW) : ORIGIN = 0, LENGTH = CONFIG_ULP_COPROC_RESERVE_MEM + ram(RW) : ORIGIN = 0, LENGTH = CONFIG_ESP32_ULP_COPROC_RESERVE_MEM } SECTIONS diff --git a/components/ulp/test/test_ulp.c b/components/ulp/test/test_ulp.c index 766a71742..9d7377df8 100644 --- a/components/ulp/test/test_ulp.c +++ b/components/ulp/test/test_ulp.c @@ -46,7 +46,7 @@ static void hexdump(const uint32_t* src, size_t count) { TEST_CASE("ulp add test", "[ulp]") { - memset(RTC_SLOW_MEM, 0, CONFIG_ULP_COPROC_RESERVE_MEM); + memset(RTC_SLOW_MEM, 0, CONFIG_ESP32_ULP_COPROC_RESERVE_MEM); const ulp_insn_t program[] = { I_MOVI(R3, 16), I_LD(R0, R3, 0), @@ -61,14 +61,14 @@ TEST_CASE("ulp add test", "[ulp]") TEST_ASSERT_EQUAL(ESP_OK, ulp_process_macros_and_load(0, program, &size)); TEST_ASSERT_EQUAL(ESP_OK, ulp_run(0)); ets_delay_us(1000); - hexdump(RTC_SLOW_MEM, CONFIG_ULP_COPROC_RESERVE_MEM / 4); + hexdump(RTC_SLOW_MEM, CONFIG_ESP32_ULP_COPROC_RESERVE_MEM / 4); TEST_ASSERT_EQUAL(10 + 11, RTC_SLOW_MEM[18] & 0xffff); } TEST_CASE("ulp branch test", "[ulp]") { - assert(CONFIG_ULP_COPROC_RESERVE_MEM >= 260 && "this test needs ULP_COPROC_RESERVE_MEM option set in menuconfig"); - memset(RTC_SLOW_MEM, 0, CONFIG_ULP_COPROC_RESERVE_MEM); + assert(CONFIG_ESP32_ULP_COPROC_RESERVE_MEM >= 260 && "this test needs ESP32_ULP_COPROC_RESERVE_MEM option set in menuconfig"); + memset(RTC_SLOW_MEM, 0, CONFIG_ESP32_ULP_COPROC_RESERVE_MEM); const ulp_insn_t program[] = { I_MOVI(R0, 34), // r0 = dst M_LABEL(1), @@ -84,12 +84,12 @@ TEST_CASE("ulp branch test", "[ulp]") }; RTC_SLOW_MEM[32] = 42; RTC_SLOW_MEM[33] = 18; - hexdump(RTC_SLOW_MEM, CONFIG_ULP_COPROC_RESERVE_MEM / 4); + hexdump(RTC_SLOW_MEM, CONFIG_ESP32_ULP_COPROC_RESERVE_MEM / 4); size_t size = sizeof(program)/sizeof(ulp_insn_t); ulp_process_macros_and_load(0, program, &size); ulp_run(0); printf("\n\n"); - hexdump(RTC_SLOW_MEM, CONFIG_ULP_COPROC_RESERVE_MEM / 4); + hexdump(RTC_SLOW_MEM, CONFIG_ESP32_ULP_COPROC_RESERVE_MEM / 4); for (int i = 34; i < 64; ++i) { TEST_ASSERT_EQUAL(42 - 18, RTC_SLOW_MEM[i] & 0xffff); } @@ -98,8 +98,8 @@ TEST_CASE("ulp branch test", "[ulp]") TEST_CASE("ulp wakeup test", "[ulp][ignore]") { - assert(CONFIG_ULP_COPROC_RESERVE_MEM >= 260 && "this test needs ULP_COPROC_RESERVE_MEM option set in menuconfig"); - memset(RTC_SLOW_MEM, 0, CONFIG_ULP_COPROC_RESERVE_MEM); + assert(CONFIG_ESP32_ULP_COPROC_RESERVE_MEM >= 260 && "this test needs ESP32_ULP_COPROC_RESERVE_MEM option set in menuconfig"); + memset(RTC_SLOW_MEM, 0, CONFIG_ESP32_ULP_COPROC_RESERVE_MEM); const ulp_insn_t program[] = { I_MOVI(R1, 1024), M_LABEL(1), @@ -126,9 +126,9 @@ TEST_CASE("ulp wakeup test", "[ulp][ignore]") TEST_CASE("ulp can write and read peripheral registers", "[ulp]") { - assert(CONFIG_ULP_COPROC_RESERVE_MEM >= 260 && "this test needs ULP_COPROC_RESERVE_MEM option set in menuconfig"); + assert(CONFIG_ESP32_ULP_COPROC_RESERVE_MEM >= 260 && "this test needs ESP32_ULP_COPROC_RESERVE_MEM option set in menuconfig"); CLEAR_PERI_REG_MASK(RTC_CNTL_STATE0_REG, RTC_CNTL_ULP_CP_SLP_TIMER_EN); - memset(RTC_SLOW_MEM, 0, CONFIG_ULP_COPROC_RESERVE_MEM); + memset(RTC_SLOW_MEM, 0, CONFIG_ESP32_ULP_COPROC_RESERVE_MEM); REG_WRITE(RTC_CNTL_STORE1_REG, 0x89abcdef); const ulp_insn_t program[] = { @@ -166,8 +166,8 @@ TEST_CASE("ulp can write and read peripheral registers", "[ulp]") TEST_CASE("ULP I_WR_REG instruction test", "[ulp]") { - assert(CONFIG_ULP_COPROC_RESERVE_MEM >= 260 && "this test needs ULP_COPROC_RESERVE_MEM option set in menuconfig"); - memset(RTC_SLOW_MEM, 0, CONFIG_ULP_COPROC_RESERVE_MEM); + assert(CONFIG_ESP32_ULP_COPROC_RESERVE_MEM >= 260 && "this test needs ESP32_ULP_COPROC_RESERVE_MEM option set in menuconfig"); + memset(RTC_SLOW_MEM, 0, CONFIG_ESP32_ULP_COPROC_RESERVE_MEM); typedef struct { int low; int width; @@ -220,8 +220,8 @@ TEST_CASE("ULP I_WR_REG instruction test", "[ulp]") TEST_CASE("ulp controls RTC_IO", "[ulp][ignore]") { - assert(CONFIG_ULP_COPROC_RESERVE_MEM >= 260 && "this test needs ULP_COPROC_RESERVE_MEM option set in menuconfig"); - memset(RTC_SLOW_MEM, 0, CONFIG_ULP_COPROC_RESERVE_MEM); + assert(CONFIG_ESP32_ULP_COPROC_RESERVE_MEM >= 260 && "this test needs ESP32_ULP_COPROC_RESERVE_MEM option set in menuconfig"); + memset(RTC_SLOW_MEM, 0, CONFIG_ESP32_ULP_COPROC_RESERVE_MEM); const ulp_insn_t program[] = { I_MOVI(R0, 0), // R0 is LED state I_MOVI(R2, 16), // loop R2 from 16 down to 0 @@ -269,7 +269,7 @@ TEST_CASE("ulp controls RTC_IO", "[ulp][ignore]") TEST_CASE("ulp power consumption in deep sleep", "[ulp][ignore]") { - assert(CONFIG_ULP_COPROC_RESERVE_MEM >= 4 && "this test needs ULP_COPROC_RESERVE_MEM option set in menuconfig"); + assert(CONFIG_ESP32_ULP_COPROC_RESERVE_MEM >= 4 && "this test needs ESP32_ULP_COPROC_RESERVE_MEM option set in menuconfig"); ulp_insn_t insn = I_HALT(); memcpy(&RTC_SLOW_MEM[0], &insn, sizeof(insn)); @@ -289,8 +289,8 @@ TEST_CASE("ulp timer setting", "[ulp]") * Program calls I_HALT each time and gets restarted by the timer. * Compare the expected number of times the program runs with the actual. */ - assert(CONFIG_ULP_COPROC_RESERVE_MEM >= 32 && "this test needs ULP_COPROC_RESERVE_MEM option set in menuconfig"); - memset(RTC_SLOW_MEM, 0, CONFIG_ULP_COPROC_RESERVE_MEM); + assert(CONFIG_ESP32_ULP_COPROC_RESERVE_MEM >= 32 && "this test needs ESP32_ULP_COPROC_RESERVE_MEM option set in menuconfig"); + memset(RTC_SLOW_MEM, 0, CONFIG_ESP32_ULP_COPROC_RESERVE_MEM); const int offset = 6; const ulp_insn_t program[] = { @@ -332,11 +332,11 @@ TEST_CASE("ulp timer setting", "[ulp]") TEST_CASE("ulp can use TSENS in deep sleep", "[ulp][ignore]") { - assert(CONFIG_ULP_COPROC_RESERVE_MEM >= 260 && "this test needs ULP_COPROC_RESERVE_MEM option set in menuconfig"); + assert(CONFIG_ESP32_ULP_COPROC_RESERVE_MEM >= 260 && "this test needs ESP32_ULP_COPROC_RESERVE_MEM option set in menuconfig"); - hexdump(RTC_SLOW_MEM, CONFIG_ULP_COPROC_RESERVE_MEM / 4); + hexdump(RTC_SLOW_MEM, CONFIG_ESP32_ULP_COPROC_RESERVE_MEM / 4); printf("\n\n"); - memset(RTC_SLOW_MEM, 0, CONFIG_ULP_COPROC_RESERVE_MEM); + memset(RTC_SLOW_MEM, 0, CONFIG_ESP32_ULP_COPROC_RESERVE_MEM); // Allow TSENS to be controlled by the ULP SET_PERI_REG_BITS(SENS_SAR_TSENS_CTRL_REG, SENS_TSENS_CLK_DIV, 10, SENS_TSENS_CLK_DIV_S); @@ -348,7 +348,7 @@ TEST_CASE("ulp can use TSENS in deep sleep", "[ulp][ignore]") // data start offset size_t offset = 20; // number of samples to collect - RTC_SLOW_MEM[offset] = (CONFIG_ULP_COPROC_RESERVE_MEM) / 4 - offset - 8; + RTC_SLOW_MEM[offset] = (CONFIG_ESP32_ULP_COPROC_RESERVE_MEM) / 4 - offset - 8; // sample counter RTC_SLOW_MEM[offset + 1] = 0; @@ -384,11 +384,11 @@ TEST_CASE("ulp can use TSENS in deep sleep", "[ulp][ignore]") TEST_CASE("can use ADC in deep sleep", "[ulp][ignore]") { - assert(CONFIG_ULP_COPROC_RESERVE_MEM >= 260 && "this test needs ULP_COPROC_RESERVE_MEM option set in menuconfig"); + assert(CONFIG_ESP32_ULP_COPROC_RESERVE_MEM >= 260 && "this test needs ESP32_ULP_COPROC_RESERVE_MEM option set in menuconfig"); - hexdump(RTC_SLOW_MEM, CONFIG_ULP_COPROC_RESERVE_MEM / 4); + hexdump(RTC_SLOW_MEM, CONFIG_ESP32_ULP_COPROC_RESERVE_MEM / 4); printf("\n\n"); - memset(RTC_SLOW_MEM, 0, CONFIG_ULP_COPROC_RESERVE_MEM); + memset(RTC_SLOW_MEM, 0, CONFIG_ESP32_ULP_COPROC_RESERVE_MEM); SET_PERI_REG_BITS(SENS_SAR_START_FORCE_REG, SENS_SAR1_BIT_WIDTH, 3, SENS_SAR1_BIT_WIDTH_S); SET_PERI_REG_BITS(SENS_SAR_START_FORCE_REG, SENS_SAR2_BIT_WIDTH, 3, SENS_SAR2_BIT_WIDTH_S); @@ -428,7 +428,7 @@ TEST_CASE("can use ADC in deep sleep", "[ulp][ignore]") // data start offset size_t offset = 20; // number of samples to collect - RTC_SLOW_MEM[offset] = (CONFIG_ULP_COPROC_RESERVE_MEM) / 4 - offset - 8; + RTC_SLOW_MEM[offset] = (CONFIG_ESP32_ULP_COPROC_RESERVE_MEM) / 4 - offset - 8; // sample counter RTC_SLOW_MEM[offset + 1] = 0; diff --git a/components/ulp/ulp.c b/components/ulp/ulp.c index ad1e083ee..31a393b86 100644 --- a/components/ulp/ulp.c +++ b/components/ulp/ulp.c @@ -70,10 +70,10 @@ esp_err_t ulp_load_binary(uint32_t load_addr, const uint8_t* program_binary, siz if (program_size_bytes < sizeof(ulp_binary_header_t)) { return ESP_ERR_INVALID_SIZE; } - if (load_addr_bytes > CONFIG_ULP_COPROC_RESERVE_MEM) { + if (load_addr_bytes > CONFIG_ESP32_ULP_COPROC_RESERVE_MEM) { return ESP_ERR_INVALID_ARG; } - if (load_addr_bytes + program_size_bytes > CONFIG_ULP_COPROC_RESERVE_MEM) { + if (load_addr_bytes + program_size_bytes > CONFIG_ESP32_ULP_COPROC_RESERVE_MEM) { return ESP_ERR_INVALID_SIZE; } diff --git a/components/ulp/ulp_macro.c b/components/ulp/ulp_macro.c index bf4039df1..c9b6e6dcb 100644 --- a/components/ulp/ulp_macro.c +++ b/components/ulp/ulp_macro.c @@ -167,7 +167,7 @@ esp_err_t ulp_process_macros_and_load(uint32_t load_addr, const ulp_insn_t* prog ++read_ptr; } size_t real_program_size = *psize - macro_count; - const size_t ulp_mem_end = CONFIG_ULP_COPROC_RESERVE_MEM / sizeof(ulp_insn_t); + const size_t ulp_mem_end = CONFIG_ESP32_ULP_COPROC_RESERVE_MEM / sizeof(ulp_insn_t); if (load_addr > ulp_mem_end) { ESP_LOGW(TAG, "invalid load address %x, max is %x", load_addr, ulp_mem_end); diff --git a/components/unity/unity_port_esp32.c b/components/unity/unity_port_esp32.c index 7770bd505..9c1370007 100644 --- a/components/unity/unity_port_esp32.c +++ b/components/unity/unity_port_esp32.c @@ -33,7 +33,7 @@ void unity_putc(int c) void unity_flush() { - uart_tx_wait_idle(CONFIG_CONSOLE_UART_NUM); + uart_tx_wait_idle(CONFIG_ESP_CONSOLE_UART_NUM); } /* To start a unit test from a GDB session without console input, diff --git a/components/vfs/test/test_vfs_fd.c b/components/vfs/test/test_vfs_fd.c index 8dea92794..3f76f36ae 100644 --- a/components/vfs/test/test_vfs_fd.c +++ b/components/vfs/test/test_vfs_fd.c @@ -260,7 +260,7 @@ TEST_CASE("Open & write & close through VFS passes performance test", "[vfs]") const int64_t time_diff_us = esp_timer_get_time() - begin; const int ns_per_iter = (int) (time_diff_us * 1000 / iter_count); TEST_ESP_OK( esp_vfs_unregister(VFS_PREF1) ); -#ifdef CONFIG_SPIRAM_SUPPORT +#ifdef CONFIG_ESP32_SPIRAM_SUPPORT TEST_PERFORMANCE_LESS_THAN(VFS_OPEN_WRITE_CLOSE_TIME_PSRAM, "%dns", ns_per_iter); #else TEST_PERFORMANCE_LESS_THAN(VFS_OPEN_WRITE_CLOSE_TIME, "%dns", ns_per_iter); diff --git a/components/vfs/test/test_vfs_uart.c b/components/vfs/test/test_vfs_uart.c index 89fb3bdcf..62a639aa6 100644 --- a/components/vfs/test/test_vfs_uart.c +++ b/components/vfs/test/test_vfs_uart.c @@ -31,11 +31,11 @@ static void fwrite_str_loopback(const char* str, size_t size) { - uart_tx_wait_idle(CONFIG_CONSOLE_UART_NUM); + uart_tx_wait_idle(CONFIG_ESP_CONSOLE_UART_NUM); UART0.conf0.loopback = 1; fwrite(str, 1, size, stdout); fflush(stdout); - uart_tx_wait_idle(CONFIG_CONSOLE_UART_NUM); + uart_tx_wait_idle(CONFIG_ESP_CONSOLE_UART_NUM); vTaskDelay(2 / portTICK_PERIOD_MS); UART0.conf0.loopback = 0; } @@ -48,7 +48,7 @@ static void flush_stdin_stdout() ; } fflush(stdout); - uart_tx_wait_idle(CONFIG_CONSOLE_UART_NUM); + uart_tx_wait_idle(CONFIG_ESP_CONSOLE_UART_NUM); } TEST_CASE("can read from stdin", "[vfs]") @@ -179,9 +179,9 @@ TEST_CASE("can write to UART while another task is reading", "[vfs]") flush_stdin_stdout(); - ESP_ERROR_CHECK( uart_driver_install(CONFIG_CONSOLE_UART_NUM, + ESP_ERROR_CHECK( uart_driver_install(CONFIG_ESP_CONSOLE_UART_NUM, 256, 0, 0, NULL, 0) ); - esp_vfs_dev_uart_use_driver(CONFIG_CONSOLE_UART_NUM); + esp_vfs_dev_uart_use_driver(CONFIG_ESP_CONSOLE_UART_NUM); xTaskCreate(&read_task_fn, "vfs_read", 4096, &read_arg, 5, NULL); @@ -197,8 +197,8 @@ TEST_CASE("can write to UART while another task is reading", "[vfs]") TEST_ASSERT_EQUAL(0, strcmp(write_arg.str, read_arg.out_buffer)); - esp_vfs_dev_uart_use_nonblocking(CONFIG_CONSOLE_UART_NUM); - uart_driver_delete(CONFIG_CONSOLE_UART_NUM); + esp_vfs_dev_uart_use_nonblocking(CONFIG_ESP_CONSOLE_UART_NUM); + uart_driver_delete(CONFIG_ESP_CONSOLE_UART_NUM); vSemaphoreDelete(read_arg.done); vSemaphoreDelete(write_arg.done); } diff --git a/docs/en/api-guides/event-handling.rst b/docs/en/api-guides/event-handling.rst index 1fdcb94ac..99a60c7ff 100644 --- a/docs/en/api-guides/event-handling.rst +++ b/docs/en/api-guides/event-handling.rst @@ -28,7 +28,7 @@ This event loop implementation is started using :cpp:func:`esp_event_loop_init` Both the pointer to event handler function, and an arbitrary context pointer are passed to :cpp:func:`esp_event_loop_init`. -When Wi-Fi, Ethernet, or IP stack generate an event, this event is sent to a high-priority ``event`` task via a queue. Application-provided event handler function is called in the context of this task. Event task stack size and event queue size can be adjusted using :ref:`CONFIG_SYSTEM_EVENT_TASK_STACK_SIZE` and :ref:`CONFIG_SYSTEM_EVENT_QUEUE_SIZE` options, respectively. +When Wi-Fi, Ethernet, or IP stack generate an event, this event is sent to a high-priority ``event`` task via a queue. Application-provided event handler function is called in the context of this task. Event task stack size and event queue size can be adjusted using :ref:`CONFIG_ESP_SYSTEM_EVENT_TASK_STACK_SIZE` and :ref:`CONFIG_ESP_SYSTEM_EVENT_QUEUE_SIZE` options, respectively. Event handler receives a pointer to the event structure (:cpp:type:`system_event_t`) which describes current event. This structure follows a *tagged union* pattern: ``event_id`` member indicates the type of event, and ``event_info`` member is a union of description structures. Application event handler will typically use ``switch(event->event_id)`` to handle different kinds of events. diff --git a/docs/en/api-guides/fatal-errors.rst b/docs/en/api-guides/fatal-errors.rst index 06883edb5..b6e90c6dc 100644 --- a/docs/en/api-guides/fatal-errors.rst +++ b/docs/en/api-guides/fatal-errors.rst @@ -11,7 +11,7 @@ In certain situations, execution of the program can not be continued in a well d - System level checks and safeguards: - :doc:`Interrupt watchdog <../api-reference/system/wdts>` timeout - - :doc:`Task watchdog <../api-reference/system/wdts>` timeout (only fatal if :ref:`CONFIG_TASK_WDT_PANIC` is set) + - :doc:`Task watchdog <../api-reference/system/wdts>` timeout (only fatal if :ref:`CONFIG_ESP_TASK_WDT_PANIC` is set) - Cache access error - Brownout detection event - Stack overflow @@ -260,7 +260,7 @@ Other Fatal Errors Brownout ^^^^^^^^ -ESP32 has a built-in brownout detector, which is enabled by default. Brownout detector can trigger system reset if supply voltage goes below safe level. Brownout detector can be configured using :ref:`CONFIG_BROWNOUT_DET` and :ref:`CONFIG_BROWNOUT_DET_LVL_SEL` options. +ESP32 has a built-in brownout detector, which is enabled by default. Brownout detector can trigger system reset if supply voltage goes below safe level. Brownout detector can be configured using :ref:`CONFIG_ESP32_BROWNOUT_DET` and :ref:`CONFIG_ESP32_BROWNOUT_DET_LVL_SEL` options. When brownout detector triggers, the following message is printed:: Brownout detector was triggered diff --git a/docs/en/api-reference/system/ipc.rst b/docs/en/api-reference/system/ipc.rst index 37d416145..a40971903 100644 --- a/docs/en/api-reference/system/ipc.rst +++ b/docs/en/api-reference/system/ipc.rst @@ -29,7 +29,7 @@ until the IPC Task has completed execution of the given function. Functions executed by IPCs must be functions of type `void func(void *arg)`. To run more complex functions which require a larger stack, the IPC tasks' stack size can be configured by modifying -:ref:`CONFIG_IPC_TASK_STACK_SIZE` in `menuconfig`. The IPC API is protected by a +:ref:`CONFIG_ESP_IPC_TASK_STACK_SIZE` in `menuconfig`. The IPC API is protected by a mutex hence simultaneous IPC calls are not possible. Care should taken to avoid deadlock when writing functions to be executed by diff --git a/docs/en/api-reference/system/system.rst b/docs/en/api-reference/system/system.rst index a15860e8a..7e5cab201 100644 --- a/docs/en/api-reference/system/system.rst +++ b/docs/en/api-reference/system/system.rst @@ -91,7 +91,7 @@ If the universally administered MAC addresses are not enough for all of the netw See `this article `_ for the definition of local and universally administered MAC addresses. -The number of universally administered MAC address can be configured using :ref:`CONFIG_NUMBER_OF_UNIVERSAL_MAC_ADDRESS`. +The number of universally administered MAC address can be configured using :ref:`CONFIG_ESP32_UNIVERSAL_MAC_ADDRESSES`. If the number of universal MAC addresses is two, only two interfaces (Wi-Fi Station and Bluetooth) receive a universally administered MAC address. These are generated sequentially by adding 0 and 1 (respectively) to the base MAC address. The remaining two interfaces (Wi-Fi SoftAP and Ethernet) receive local MAC addresses. These are derived from the universal Wi-Fi station and Bluetooth MAC addresses, respectively. diff --git a/docs/en/api-reference/system/wdts.rst b/docs/en/api-reference/system/wdts.rst index 05cc79230..6f2f5cc4e 100644 --- a/docs/en/api-reference/system/wdts.rst +++ b/docs/en/api-reference/system/wdts.rst @@ -63,10 +63,10 @@ longer call :cpp:func:`esp_task_wdt_reset`. Once all tasks have unsubscribed form the TWDT, the TWDT can be deinitialized by calling :cpp:func:`esp_task_wdt_deinit()`. -By default :ref:`CONFIG_TASK_WDT` in ``make menuconfig`` will be enabled causing +By default :ref:`CONFIG_ESP_TASK_WDT` in ``make menuconfig`` will be enabled causing the TWDT to be initialized automatically during startup. Likewise -:ref:`CONFIG_TASK_WDT_CHECK_IDLE_TASK_CPU0` and -:ref:`CONFIG_TASK_WDT_CHECK_IDLE_TASK_CPU1` are also enabled by default causing +:ref:`CONFIG_ESP_TASK_WDT_CHECK_IDLE_TASK_CPU0` and +:ref:`CONFIG_ESP_TASK_WDT_CHECK_IDLE_TASK_CPU1` are also enabled by default causing the two Idle Tasks to be subscribed to the TWDT during startup. JTAG and watchdogs diff --git a/examples/bluetooth/ble_throughput/throughput_client/sdkconfig.defaults b/examples/bluetooth/ble_throughput/throughput_client/sdkconfig.defaults index b174cdca8..6d5a62b19 100644 --- a/examples/bluetooth/ble_throughput/throughput_client/sdkconfig.defaults +++ b/examples/bluetooth/ble_throughput/throughput_client/sdkconfig.defaults @@ -17,6 +17,6 @@ CONFIG_MONITOR_BAUD=921600 # # ESP32-specific # -CONFIG_TRACEMEM_RESERVE_DRAM=0x0 +CONFIG_ESP32_TRACEMEM_RESERVE_DRAM=0x0 CONFIG_ESP32_ENABLE_COREDUMP_TO_NONE=y -CONFIG_CONSOLE_UART_BAUDRATE=921600 +CONFIG_ESP_CONSOLE_UART_BAUDRATE=921600 diff --git a/examples/bluetooth/ble_throughput/throughput_server/sdkconfig.defaults b/examples/bluetooth/ble_throughput/throughput_server/sdkconfig.defaults index b174cdca8..6d5a62b19 100644 --- a/examples/bluetooth/ble_throughput/throughput_server/sdkconfig.defaults +++ b/examples/bluetooth/ble_throughput/throughput_server/sdkconfig.defaults @@ -17,6 +17,6 @@ CONFIG_MONITOR_BAUD=921600 # # ESP32-specific # -CONFIG_TRACEMEM_RESERVE_DRAM=0x0 +CONFIG_ESP32_TRACEMEM_RESERVE_DRAM=0x0 CONFIG_ESP32_ENABLE_COREDUMP_TO_NONE=y -CONFIG_CONSOLE_UART_BAUDRATE=921600 +CONFIG_ESP_CONSOLE_UART_BAUDRATE=921600 diff --git a/examples/common_components/protocol_examples_common/stdin_out.c b/examples/common_components/protocol_examples_common/stdin_out.c index a4bc2cca4..cb2220db4 100644 --- a/examples/common_components/protocol_examples_common/stdin_out.c +++ b/examples/common_components/protocol_examples_common/stdin_out.c @@ -19,10 +19,10 @@ esp_err_t example_configure_stdin_stdout() setvbuf(stdin, NULL, _IONBF, 0); setvbuf(stdout, NULL, _IONBF, 0); /* Install UART driver for interrupt-driven reads and writes */ - ESP_ERROR_CHECK( uart_driver_install( (uart_port_t)CONFIG_CONSOLE_UART_NUM, + ESP_ERROR_CHECK( uart_driver_install( (uart_port_t)CONFIG_ESP_CONSOLE_UART_NUM, 256, 0, 0, NULL, 0) ); /* Tell VFS to use UART driver */ - esp_vfs_dev_uart_use_driver(CONFIG_CONSOLE_UART_NUM); + esp_vfs_dev_uart_use_driver(CONFIG_ESP_CONSOLE_UART_NUM); esp_vfs_dev_uart_set_rx_line_endings(ESP_LINE_ENDINGS_CR); /* Move the caret to the beginning of the next line on '\n' */ esp_vfs_dev_uart_set_tx_line_endings(ESP_LINE_ENDINGS_CRLF); diff --git a/examples/ethernet/iperf/main/iperf_example_main.c b/examples/ethernet/iperf/main/iperf_example_main.c index 479a192fb..8f0d0ccb9 100644 --- a/examples/ethernet/iperf/main/iperf_example_main.c +++ b/examples/ethernet/iperf/main/iperf_example_main.c @@ -68,20 +68,20 @@ static void initialize_console() * correct while APB frequency is changing in light sleep mode. */ const uart_config_t uart_config = { - .baud_rate = CONFIG_CONSOLE_UART_BAUDRATE, + .baud_rate = CONFIG_ESP_CONSOLE_UART_BAUDRATE, .data_bits = UART_DATA_8_BITS, .parity = UART_PARITY_DISABLE, .stop_bits = UART_STOP_BITS_1, .use_ref_tick = true }; - ESP_ERROR_CHECK(uart_param_config(CONFIG_CONSOLE_UART_NUM, &uart_config)); + ESP_ERROR_CHECK(uart_param_config(CONFIG_ESP_CONSOLE_UART_NUM, &uart_config)); /* Install UART driver for interrupt-driven reads and writes */ - ESP_ERROR_CHECK(uart_driver_install(CONFIG_CONSOLE_UART_NUM, + ESP_ERROR_CHECK(uart_driver_install(CONFIG_ESP_CONSOLE_UART_NUM, 256, 0, 0, NULL, 0)); /* Tell VFS to use UART driver */ - esp_vfs_dev_uart_use_driver(CONFIG_CONSOLE_UART_NUM); + esp_vfs_dev_uart_use_driver(CONFIG_ESP_CONSOLE_UART_NUM); /* Initialize the console */ esp_console_config_t console_config = { diff --git a/examples/ethernet/iperf/sdkconfig.defaults b/examples/ethernet/iperf/sdkconfig.defaults index a07acc2dd..0ffd261a0 100644 --- a/examples/ethernet/iperf/sdkconfig.defaults +++ b/examples/ethernet/iperf/sdkconfig.defaults @@ -3,7 +3,7 @@ CONFIG_LOG_BOOTLOADER_LEVEL_WARN=y CONFIG_LOG_BOOTLOADER_LEVEL=2 # Increase main task stack size -CONFIG_MAIN_TASK_STACK_SIZE=7168 +CONFIG_ESP_MAIN_TASK_STACK_SIZE=7168 # Enable filesystem CONFIG_PARTITION_TABLE_CUSTOM=y diff --git a/examples/peripherals/i2c/i2c_tools/main/i2ctools_example_main.c b/examples/peripherals/i2c/i2c_tools/main/i2ctools_example_main.c index 7e24968a7..c91803cd8 100644 --- a/examples/peripherals/i2c/i2c_tools/main/i2ctools_example_main.c +++ b/examples/peripherals/i2c/i2c_tools/main/i2ctools_example_main.c @@ -68,20 +68,20 @@ static void initialize_console() * correct while APB frequency is changing in light sleep mode. */ const uart_config_t uart_config = { - .baud_rate = CONFIG_CONSOLE_UART_BAUDRATE, + .baud_rate = CONFIG_ESP_CONSOLE_UART_BAUDRATE, .data_bits = UART_DATA_8_BITS, .parity = UART_PARITY_DISABLE, .stop_bits = UART_STOP_BITS_1, .use_ref_tick = true }; - ESP_ERROR_CHECK(uart_param_config(CONFIG_CONSOLE_UART_NUM, &uart_config)); + ESP_ERROR_CHECK(uart_param_config(CONFIG_ESP_CONSOLE_UART_NUM, &uart_config)); /* Install UART driver for interrupt-driven reads and writes */ - ESP_ERROR_CHECK(uart_driver_install(CONFIG_CONSOLE_UART_NUM, + ESP_ERROR_CHECK(uart_driver_install(CONFIG_ESP_CONSOLE_UART_NUM, 256, 0, 0, NULL, 0)); /* Tell VFS to use UART driver */ - esp_vfs_dev_uart_use_driver(CONFIG_CONSOLE_UART_NUM); + esp_vfs_dev_uart_use_driver(CONFIG_ESP_CONSOLE_UART_NUM); /* Initialize the console */ esp_console_config_t console_config = { diff --git a/examples/peripherals/i2c/i2c_tools/sdkconfig.defaults b/examples/peripherals/i2c/i2c_tools/sdkconfig.defaults index 44b2010a0..b77f0bbdd 100644 --- a/examples/peripherals/i2c/i2c_tools/sdkconfig.defaults +++ b/examples/peripherals/i2c/i2c_tools/sdkconfig.defaults @@ -3,7 +3,7 @@ CONFIG_LOG_BOOTLOADER_LEVEL_WARN=y CONFIG_LOG_BOOTLOADER_LEVEL=2 # Increase main task stack size -CONFIG_MAIN_TASK_STACK_SIZE=7168 +CONFIG_ESP_MAIN_TASK_STACK_SIZE=7168 # Enable filesystem CONFIG_PARTITION_TABLE_CUSTOM=y diff --git a/examples/protocols/asio/chat_client/sdkconfig.defaults b/examples/protocols/asio/chat_client/sdkconfig.defaults index d99552e19..ce53d73ec 100644 --- a/examples/protocols/asio/chat_client/sdkconfig.defaults +++ b/examples/protocols/asio/chat_client/sdkconfig.defaults @@ -1 +1 @@ -CONFIG_MAIN_TASK_STACK_SIZE=8192 +CONFIG_ESP_MAIN_TASK_STACK_SIZE=8192 diff --git a/examples/protocols/asio/chat_server/sdkconfig.defaults b/examples/protocols/asio/chat_server/sdkconfig.defaults index d99552e19..ce53d73ec 100644 --- a/examples/protocols/asio/chat_server/sdkconfig.defaults +++ b/examples/protocols/asio/chat_server/sdkconfig.defaults @@ -1 +1 @@ -CONFIG_MAIN_TASK_STACK_SIZE=8192 +CONFIG_ESP_MAIN_TASK_STACK_SIZE=8192 diff --git a/examples/protocols/asio/tcp_echo_server/sdkconfig.defaults b/examples/protocols/asio/tcp_echo_server/sdkconfig.defaults index d99552e19..ce53d73ec 100644 --- a/examples/protocols/asio/tcp_echo_server/sdkconfig.defaults +++ b/examples/protocols/asio/tcp_echo_server/sdkconfig.defaults @@ -1 +1 @@ -CONFIG_MAIN_TASK_STACK_SIZE=8192 +CONFIG_ESP_MAIN_TASK_STACK_SIZE=8192 diff --git a/examples/protocols/asio/udp_echo_server/sdkconfig.defaults b/examples/protocols/asio/udp_echo_server/sdkconfig.defaults index d99552e19..ce53d73ec 100644 --- a/examples/protocols/asio/udp_echo_server/sdkconfig.defaults +++ b/examples/protocols/asio/udp_echo_server/sdkconfig.defaults @@ -1 +1 @@ -CONFIG_MAIN_TASK_STACK_SIZE=8192 +CONFIG_ESP_MAIN_TASK_STACK_SIZE=8192 diff --git a/examples/storage/semihost_vfs/main/semihost_vfs_example_main.c b/examples/storage/semihost_vfs/main/semihost_vfs_example_main.c index edbeabbbe..a3ed216c1 100644 --- a/examples/storage/semihost_vfs/main/semihost_vfs_example_main.c +++ b/examples/storage/semihost_vfs/main/semihost_vfs_example_main.c @@ -52,7 +52,7 @@ void app_main(void) fflush(fout); // ensure that all data are sent to the host file // ftell can also be used, get file size before closing it in `freopen` int count = ftell(fout); - stdout = freopen("/dev/uart/" STRINGIFY(CONFIG_CONSOLE_UART_NUM), "w", fout); + stdout = freopen("/dev/uart/" STRINGIFY(CONFIG_ESP_CONSOLE_UART_NUM), "w", fout); if (stdout == NULL) { ESP_LOGE(TAG, "Failed to reopen semihosted stdout (%d)!", errno); return; diff --git a/examples/system/console/components/cmd_system/cmd_system.c b/examples/system/console/components/cmd_system/cmd_system.c index 97dee42aa..aae2ee6c4 100644 --- a/examples/system/console/components/cmd_system/cmd_system.c +++ b/examples/system/console/components/cmd_system/cmd_system.c @@ -287,13 +287,13 @@ static int light_sleep(int argc, char **argv) if (io_count > 0) { ESP_ERROR_CHECK( esp_sleep_enable_gpio_wakeup() ); } - if (CONFIG_CONSOLE_UART_NUM <= UART_NUM_1) { + if (CONFIG_ESP_CONSOLE_UART_NUM <= UART_NUM_1) { ESP_LOGI(TAG, "Enabling UART wakeup (press ENTER to exit light sleep)"); - ESP_ERROR_CHECK( uart_set_wakeup_threshold(CONFIG_CONSOLE_UART_NUM, 3) ); - ESP_ERROR_CHECK( esp_sleep_enable_uart_wakeup(CONFIG_CONSOLE_UART_NUM) ); + ESP_ERROR_CHECK( uart_set_wakeup_threshold(CONFIG_ESP_CONSOLE_UART_NUM, 3) ); + ESP_ERROR_CHECK( esp_sleep_enable_uart_wakeup(CONFIG_ESP_CONSOLE_UART_NUM) ); } fflush(stdout); - uart_tx_wait_idle(CONFIG_CONSOLE_UART_NUM); + uart_tx_wait_idle(CONFIG_ESP_CONSOLE_UART_NUM); esp_light_sleep_start(); esp_sleep_wakeup_cause_t cause = esp_sleep_get_wakeup_cause(); const char *cause_str; diff --git a/examples/system/console/main/console_example_main.c b/examples/system/console/main/console_example_main.c index ba16a9e61..e0e48b430 100644 --- a/examples/system/console/main/console_example_main.c +++ b/examples/system/console/main/console_example_main.c @@ -71,20 +71,20 @@ static void initialize_console() * correct while APB frequency is changing in light sleep mode. */ const uart_config_t uart_config = { - .baud_rate = CONFIG_CONSOLE_UART_BAUDRATE, + .baud_rate = CONFIG_ESP_CONSOLE_UART_BAUDRATE, .data_bits = UART_DATA_8_BITS, .parity = UART_PARITY_DISABLE, .stop_bits = UART_STOP_BITS_1, .use_ref_tick = true }; - ESP_ERROR_CHECK( uart_param_config(CONFIG_CONSOLE_UART_NUM, &uart_config) ); + ESP_ERROR_CHECK( uart_param_config(CONFIG_ESP_CONSOLE_UART_NUM, &uart_config) ); /* Install UART driver for interrupt-driven reads and writes */ - ESP_ERROR_CHECK( uart_driver_install(CONFIG_CONSOLE_UART_NUM, + ESP_ERROR_CHECK( uart_driver_install(CONFIG_ESP_CONSOLE_UART_NUM, 256, 0, 0, NULL, 0) ); /* Tell VFS to use UART driver */ - esp_vfs_dev_uart_use_driver(CONFIG_CONSOLE_UART_NUM); + esp_vfs_dev_uart_use_driver(CONFIG_ESP_CONSOLE_UART_NUM); /* Initialize the console */ esp_console_config_t console_config = { diff --git a/examples/system/console/sdkconfig.defaults b/examples/system/console/sdkconfig.defaults index ebec83064..d485f3ce7 100644 --- a/examples/system/console/sdkconfig.defaults +++ b/examples/system/console/sdkconfig.defaults @@ -3,7 +3,7 @@ CONFIG_LOG_BOOTLOADER_LEVEL_WARN=y CONFIG_LOG_BOOTLOADER_LEVEL=2 # Increase main task stack size -CONFIG_MAIN_TASK_STACK_SIZE=7168 +CONFIG_ESP_MAIN_TASK_STACK_SIZE=7168 # Enable filesystem CONFIG_PARTITION_TABLE_CUSTOM=y diff --git a/examples/system/deep_sleep/main/deep_sleep_example_main.c b/examples/system/deep_sleep/main/deep_sleep_example_main.c index 414554a43..5e3866d6e 100644 --- a/examples/system/deep_sleep/main/deep_sleep_example_main.c +++ b/examples/system/deep_sleep/main/deep_sleep_example_main.c @@ -31,13 +31,13 @@ static RTC_DATA_ATTR struct timeval sleep_enter_time; /* * Offset (in 32-bit words) in RTC Slow memory where the data is placed * by the ULP coprocessor. It can be chosen to be any value greater or equal - * to ULP program size, and less than the CONFIG_ULP_COPROC_RESERVE_MEM/4 - 6, + * to ULP program size, and less than the CONFIG_ESP32_ULP_COPROC_RESERVE_MEM/4 - 6, * where 6 is the number of words used by the ULP coprocessor. */ #define ULP_DATA_OFFSET 36 -_Static_assert(ULP_DATA_OFFSET < CONFIG_ULP_COPROC_RESERVE_MEM/4 - 6, - "ULP_DATA_OFFSET is set too high, or CONFIG_ULP_COPROC_RESERVE_MEM is not sufficient"); +_Static_assert(ULP_DATA_OFFSET < CONFIG_ESP32_ULP_COPROC_RESERVE_MEM/4 - 6, + "ULP_DATA_OFFSET is set too high, or CONFIG_ESP32_ULP_COPROC_RESERVE_MEM is not sufficient"); /** * @brief Start ULP temperature monitoring program @@ -242,7 +242,7 @@ static void start_ulp_temperature_monitoring() CLEAR_PERI_REG_MASK(SENS_SAR_TSENS_CTRL_REG, SENS_TSENS_POWER_UP_FORCE); // Clear the part of RTC_SLOW_MEM reserved for the ULP. Makes debugging easier. - memset(RTC_SLOW_MEM, 0, CONFIG_ULP_COPROC_RESERVE_MEM); + memset(RTC_SLOW_MEM, 0, CONFIG_ESP32_ULP_COPROC_RESERVE_MEM); // The first word of memory (at data offset) is used to store the initial temperature (T0) // Zero it out here, then ULP will update it on the first run. diff --git a/examples/system/deep_sleep/sdkconfig.defaults b/examples/system/deep_sleep/sdkconfig.defaults index 78f466407..c80761b50 100644 --- a/examples/system/deep_sleep/sdkconfig.defaults +++ b/examples/system/deep_sleep/sdkconfig.defaults @@ -1,6 +1,6 @@ CONFIG_ESP32_DEFAULT_CPU_FREQ_80=y CONFIG_ESP32_DEFAULT_CPU_FREQ_MHZ=80 -CONFIG_ULP_COPROC_ENABLED=y -CONFIG_ULP_COPROC_RESERVE_MEM=512 +CONFIG_ESP32_ULP_COPROC_ENABLED=y +CONFIG_ESP32_ULP_COPROC_RESERVE_MEM=512 CONFIG_ESP32_TIME_SYSCALL_USE_RTC_FRC1=y -CONFIG_ESP32_RTC_CLOCK_SOURCE_INTERNAL_RC=y +CONFIG_ESP32_RTC_CLK_SRC_INT_RC=y diff --git a/examples/system/himem/sdkconfig.defaults b/examples/system/himem/sdkconfig.defaults index b33372a2c..b08e7fa95 100644 --- a/examples/system/himem/sdkconfig.defaults +++ b/examples/system/himem/sdkconfig.defaults @@ -1,4 +1,4 @@ -CONFIG_SPIRAM_SUPPORT=y +CONFIG_ESP32_SPIRAM_SUPPORT=y CONFIG_SPIRAM_BOOT_INIT=y CONFIG_SPIRAM_IGNORE_NOTFOUND= CONFIG_SPIRAM_USE_MALLOC=y diff --git a/examples/system/light_sleep/main/light_sleep_example_main.c b/examples/system/light_sleep/main/light_sleep_example_main.c index 4c8e12029..36003c68f 100644 --- a/examples/system/light_sleep/main/light_sleep_example_main.c +++ b/examples/system/light_sleep/main/light_sleep_example_main.c @@ -57,7 +57,7 @@ void app_main() /* To make sure the complete line is printed before entering sleep mode, * need to wait until UART TX FIFO is empty: */ - uart_tx_wait_idle(CONFIG_CONSOLE_UART_NUM); + uart_tx_wait_idle(CONFIG_ESP_CONSOLE_UART_NUM); /* Get timestamp before entering sleep */ int64_t t_before_us = esp_timer_get_time(); diff --git a/examples/system/task_watchdog/main/task_watchdog_example_main.c b/examples/system/task_watchdog/main/task_watchdog_example_main.c index 16a0a8402..a5eed91ce 100644 --- a/examples/system/task_watchdog/main/task_watchdog_example_main.c +++ b/examples/system/task_watchdog/main/task_watchdog_example_main.c @@ -49,10 +49,10 @@ void app_main() CHECK_ERROR_CODE(esp_task_wdt_init(TWDT_TIMEOUT_S, false), ESP_OK); //Subscribe Idle Tasks to TWDT if they were not subscribed at startup -#ifndef CONFIG_TASK_WDT_CHECK_IDLE_TASK_CPU0 +#ifndef CONFIG_ESP_TASK_WDT_CHECK_IDLE_TASK_CPU0 esp_task_wdt_add(xTaskGetIdleTaskHandleForCPU(0)); #endif -#ifndef CONFIG_TASK_WDT_CHECK_IDLE_TASK_CPU1 +#ifndef CONFIG_ESP_TASK_WDT_CHECK_IDLE_TASK_CPU1 esp_task_wdt_add(xTaskGetIdleTaskHandleForCPU(1)); #endif diff --git a/examples/system/ulp/sdkconfig.defaults b/examples/system/ulp/sdkconfig.defaults index f6d33f394..1ef03d0e6 100644 --- a/examples/system/ulp/sdkconfig.defaults +++ b/examples/system/ulp/sdkconfig.defaults @@ -1,6 +1,6 @@ # Enable ULP -CONFIG_ULP_COPROC_ENABLED=y -CONFIG_ULP_COPROC_RESERVE_MEM=1024 +CONFIG_ESP32_ULP_COPROC_ENABLED=y +CONFIG_ESP32_ULP_COPROC_RESERVE_MEM=1024 # Set log level to Warning to produce clean output CONFIG_LOG_BOOTLOADER_LEVEL_WARN=y CONFIG_LOG_BOOTLOADER_LEVEL=2 diff --git a/examples/system/ulp_adc/sdkconfig.defaults b/examples/system/ulp_adc/sdkconfig.defaults index f6d33f394..1ef03d0e6 100644 --- a/examples/system/ulp_adc/sdkconfig.defaults +++ b/examples/system/ulp_adc/sdkconfig.defaults @@ -1,6 +1,6 @@ # Enable ULP -CONFIG_ULP_COPROC_ENABLED=y -CONFIG_ULP_COPROC_RESERVE_MEM=1024 +CONFIG_ESP32_ULP_COPROC_ENABLED=y +CONFIG_ESP32_ULP_COPROC_RESERVE_MEM=1024 # Set log level to Warning to produce clean output CONFIG_LOG_BOOTLOADER_LEVEL_WARN=y CONFIG_LOG_BOOTLOADER_LEVEL=2 diff --git a/examples/system/unit_test/test/sdkconfig.defaults b/examples/system/unit_test/test/sdkconfig.defaults index 39935a7fd..11ea46136 100644 --- a/examples/system/unit_test/test/sdkconfig.defaults +++ b/examples/system/unit_test/test/sdkconfig.defaults @@ -1 +1 @@ -CONFIG_TASK_WDT= +CONFIG_ESP_TASK_WDT= diff --git a/examples/wifi/iperf/main/iperf_example_main.c b/examples/wifi/iperf/main/iperf_example_main.c index 50779b3e2..797d74961 100644 --- a/examples/wifi/iperf/main/iperf_example_main.c +++ b/examples/wifi/iperf/main/iperf_example_main.c @@ -37,11 +37,11 @@ static void initialize_console() esp_vfs_dev_uart_set_tx_line_endings(ESP_LINE_ENDINGS_CRLF); /* Install UART driver for interrupt-driven reads and writes */ - ESP_ERROR_CHECK( uart_driver_install(CONFIG_CONSOLE_UART_NUM, + ESP_ERROR_CHECK( uart_driver_install(CONFIG_ESP_CONSOLE_UART_NUM, 256, 0, 0, NULL, 0) ); /* Tell VFS to use UART driver */ - esp_vfs_dev_uart_use_driver(CONFIG_CONSOLE_UART_NUM); + esp_vfs_dev_uart_use_driver(CONFIG_ESP_CONSOLE_UART_NUM); /* Initialize the console */ esp_console_config_t console_config = { diff --git a/examples/wifi/iperf/sdkconfig.defaults b/examples/wifi/iperf/sdkconfig.defaults index 3d9d958a7..d6dbf5f5a 100644 --- a/examples/wifi/iperf/sdkconfig.defaults +++ b/examples/wifi/iperf/sdkconfig.defaults @@ -2,7 +2,7 @@ CONFIG_ESP32_DEFAULT_CPU_FREQ_240=y CONFIG_ESP32_DEFAULT_CPU_FREQ_MHZ=240 CONFIG_MEMMAP_SMP=y -CONFIG_SYSTEM_EVENT_TASK_STACK_SIZE=4096 +CONFIG_ESP_SYSTEM_EVENT_TASK_STACK_SIZE=4096 CONFIG_ESP32_WIFI_STATIC_RX_BUFFER_NUM=16 CONFIG_ESP32_WIFI_DYNAMIC_RX_BUFFER_NUM=64 @@ -15,8 +15,8 @@ CONFIG_ESP32_WIFI_RX_BA_WIN=32 CONFIG_FREERTOS_UNICORE=n CONFIG_FREERTOS_HZ=1000 -CONFIG_INT_WDT=n -CONFIG_TASK_WDT=n +CONFIG_ESP_INT_WDT=n +CONFIG_ESP_TASK_WDT=n CONFIG_LWIP_TCP_SND_BUF_DEFAULT=65534 CONFIG_LWIP_TCP_WND_DEFAULT=65534 diff --git a/examples/wifi/iperf/sdkconfig.defaults.00 b/examples/wifi/iperf/sdkconfig.defaults.00 index 448cc6270..438fe641b 100644 --- a/examples/wifi/iperf/sdkconfig.defaults.00 +++ b/examples/wifi/iperf/sdkconfig.defaults.00 @@ -1,6 +1,6 @@ CONFIG_MEMMAP_SMP=y -CONFIG_SYSTEM_EVENT_TASK_STACK_SIZE=4096 +CONFIG_ESP_SYSTEM_EVENT_TASK_STACK_SIZE=4096 -CONFIG_INT_WDT= -CONFIG_TASK_WDT= +CONFIG_ESP_INT_WDT= +CONFIG_ESP_TASK_WDT= diff --git a/examples/wifi/iperf/sdkconfig.defaults.01 b/examples/wifi/iperf/sdkconfig.defaults.01 index 5984c16fd..6393e8d34 100644 --- a/examples/wifi/iperf/sdkconfig.defaults.01 +++ b/examples/wifi/iperf/sdkconfig.defaults.01 @@ -1,9 +1,9 @@ CONFIG_MEMMAP_SMP=y -CONFIG_INT_WDT= -CONFIG_TASK_WDT= +CONFIG_ESP_INT_WDT= +CONFIG_ESP_TASK_WDT= -CONFIG_SYSTEM_EVENT_TASK_STACK_SIZE=4096 +CONFIG_ESP_SYSTEM_EVENT_TASK_STACK_SIZE=4096 CONFIG_FREERTOS_UNICORE= CONFIG_FREERTOS_HZ=1000 diff --git a/examples/wifi/iperf/sdkconfig.defaults.02 b/examples/wifi/iperf/sdkconfig.defaults.02 index cbdecf189..be98dffad 100644 --- a/examples/wifi/iperf/sdkconfig.defaults.02 +++ b/examples/wifi/iperf/sdkconfig.defaults.02 @@ -1,9 +1,9 @@ CONFIG_MEMMAP_SMP=y -CONFIG_INT_WDT= -CONFIG_TASK_WDT= +CONFIG_ESP_INT_WDT= +CONFIG_ESP_TASK_WDT= -CONFIG_SYSTEM_EVENT_TASK_STACK_SIZE=4096 +CONFIG_ESP_SYSTEM_EVENT_TASK_STACK_SIZE=4096 CONFIG_FREERTOS_UNICORE= CONFIG_FREERTOS_HZ=1000 diff --git a/examples/wifi/iperf/sdkconfig.defaults.03 b/examples/wifi/iperf/sdkconfig.defaults.03 index 4a25dd2ac..ac93ca610 100644 --- a/examples/wifi/iperf/sdkconfig.defaults.03 +++ b/examples/wifi/iperf/sdkconfig.defaults.03 @@ -1,9 +1,9 @@ CONFIG_MEMMAP_SMP=y -CONFIG_INT_WDT= -CONFIG_TASK_WDT= +CONFIG_ESP_INT_WDT= +CONFIG_ESP_TASK_WDT= -CONFIG_SYSTEM_EVENT_TASK_STACK_SIZE=4096 +CONFIG_ESP_SYSTEM_EVENT_TASK_STACK_SIZE=4096 CONFIG_FREERTOS_UNICORE= CONFIG_FREERTOS_HZ=1000 diff --git a/examples/wifi/iperf/sdkconfig.defaults.04 b/examples/wifi/iperf/sdkconfig.defaults.04 index f0401688d..8805c8a3c 100644 --- a/examples/wifi/iperf/sdkconfig.defaults.04 +++ b/examples/wifi/iperf/sdkconfig.defaults.04 @@ -1,9 +1,9 @@ CONFIG_MEMMAP_SMP=y -CONFIG_INT_WDT= -CONFIG_TASK_WDT= +CONFIG_ESP_INT_WDT= +CONFIG_ESP_TASK_WDT= -CONFIG_SYSTEM_EVENT_TASK_STACK_SIZE=4096 +CONFIG_ESP_SYSTEM_EVENT_TASK_STACK_SIZE=4096 CONFIG_FREERTOS_UNICORE= CONFIG_FREERTOS_HZ=1000 diff --git a/examples/wifi/iperf/sdkconfig.defaults.05 b/examples/wifi/iperf/sdkconfig.defaults.05 index 9021754b1..552d2a3ef 100644 --- a/examples/wifi/iperf/sdkconfig.defaults.05 +++ b/examples/wifi/iperf/sdkconfig.defaults.05 @@ -1,9 +1,9 @@ CONFIG_MEMMAP_SMP=y -CONFIG_INT_WDT= -CONFIG_TASK_WDT= +CONFIG_ESP_INT_WDT= +CONFIG_ESP_TASK_WDT= -CONFIG_SYSTEM_EVENT_TASK_STACK_SIZE=4096 +CONFIG_ESP_SYSTEM_EVENT_TASK_STACK_SIZE=4096 CONFIG_FREERTOS_UNICORE= CONFIG_FREERTOS_HZ=1000 diff --git a/examples/wifi/iperf/sdkconfig.defaults.06 b/examples/wifi/iperf/sdkconfig.defaults.06 index a350f2d1c..63b713075 100644 --- a/examples/wifi/iperf/sdkconfig.defaults.06 +++ b/examples/wifi/iperf/sdkconfig.defaults.06 @@ -1,4 +1,4 @@ -CONFIG_SYSTEM_EVENT_TASK_STACK_SIZE=4096 +CONFIG_ESP_SYSTEM_EVENT_TASK_STACK_SIZE=4096 CONFIG_ESP32_WIFI_STATIC_RX_BUFFER_NUM=16 CONFIG_ESP32_WIFI_DYNAMIC_RX_BUFFER_NUM=64 @@ -11,8 +11,8 @@ CONFIG_ESP32_WIFI_RX_BA_WIN=32 CONFIG_FREERTOS_UNICORE=y CONFIG_FREERTOS_HZ=1000 -CONFIG_INT_WDT= -CONFIG_TASK_WDT= +CONFIG_ESP_INT_WDT= +CONFIG_ESP_TASK_WDT= CONFIG_LWIP_TCP_SND_BUF_DEFAULT=65534 CONFIG_LWIP_TCP_WND_DEFAULT=65534 diff --git a/examples/wifi/iperf/sdkconfig.defaults.07 b/examples/wifi/iperf/sdkconfig.defaults.07 index ac11f1c6a..cc781798c 100644 --- a/examples/wifi/iperf/sdkconfig.defaults.07 +++ b/examples/wifi/iperf/sdkconfig.defaults.07 @@ -2,7 +2,7 @@ CONFIG_ESP32_DEFAULT_CPU_FREQ_80=y CONFIG_ESP32_DEFAULT_CPU_FREQ_MHZ=80 CONFIG_MEMMAP_SMP=y -CONFIG_SYSTEM_EVENT_TASK_STACK_SIZE=4096 +CONFIG_ESP_SYSTEM_EVENT_TASK_STACK_SIZE=4096 CONFIG_ESP32_WIFI_STATIC_RX_BUFFER_NUM=16 CONFIG_ESP32_WIFI_DYNAMIC_RX_BUFFER_NUM=64 @@ -15,8 +15,8 @@ CONFIG_ESP32_WIFI_RX_BA_WIN=32 CONFIG_FREERTOS_UNICORE= CONFIG_FREERTOS_HZ=1000 -CONFIG_INT_WDT= -CONFIG_TASK_WDT= +CONFIG_ESP_INT_WDT= +CONFIG_ESP_TASK_WDT= CONFIG_LWIP_TCP_SND_BUF_DEFAULT=65534 CONFIG_LWIP_TCP_WND_DEFAULT=65534 diff --git a/examples/wifi/iperf/sdkconfig.defaults.99 b/examples/wifi/iperf/sdkconfig.defaults.99 index 434e3b5b1..9cced4d4e 100644 --- a/examples/wifi/iperf/sdkconfig.defaults.99 +++ b/examples/wifi/iperf/sdkconfig.defaults.99 @@ -2,7 +2,7 @@ CONFIG_ESP32_DEFAULT_CPU_FREQ_240=y CONFIG_ESP32_DEFAULT_CPU_FREQ_MHZ=240 CONFIG_MEMMAP_SMP=y -CONFIG_SYSTEM_EVENT_TASK_STACK_SIZE=4096 +CONFIG_ESP_SYSTEM_EVENT_TASK_STACK_SIZE=4096 CONFIG_ESP32_WIFI_STATIC_RX_BUFFER_NUM=16 CONFIG_ESP32_WIFI_DYNAMIC_RX_BUFFER_NUM=64 @@ -15,8 +15,8 @@ CONFIG_ESP32_WIFI_RX_BA_WIN=32 CONFIG_FREERTOS_UNICORE= CONFIG_FREERTOS_HZ=1000 -CONFIG_INT_WDT= -CONFIG_TASK_WDT= +CONFIG_ESP_INT_WDT= +CONFIG_ESP_TASK_WDT= CONFIG_LWIP_TCP_SND_BUF_DEFAULT=65534 CONFIG_LWIP_TCP_WND_DEFAULT=65534 diff --git a/examples/wifi/simple_sniffer/main/simple_sniffer_example_main.c b/examples/wifi/simple_sniffer/main/simple_sniffer_example_main.c index c4232ae32..013ed6d10 100644 --- a/examples/wifi/simple_sniffer/main/simple_sniffer_example_main.c +++ b/examples/wifi/simple_sniffer/main/simple_sniffer_example_main.c @@ -84,11 +84,11 @@ static void initialize_console() esp_vfs_dev_uart_set_tx_line_endings(ESP_LINE_ENDINGS_CRLF); /* Install UART driver for interrupt-driven reads and writes */ - ESP_ERROR_CHECK(uart_driver_install(CONFIG_CONSOLE_UART_NUM, + ESP_ERROR_CHECK(uart_driver_install(CONFIG_ESP_CONSOLE_UART_NUM, 256, 0, 0, NULL, 0)); /* Tell VFS to use UART driver */ - esp_vfs_dev_uart_use_driver(CONFIG_CONSOLE_UART_NUM); + esp_vfs_dev_uart_use_driver(CONFIG_ESP_CONSOLE_UART_NUM); /* Initialize the console */ esp_console_config_t console_config = { diff --git a/examples/wifi/simple_sniffer/sdkconfig.defaults b/examples/wifi/simple_sniffer/sdkconfig.defaults index 3de6269e6..a67ef4dc9 100644 --- a/examples/wifi/simple_sniffer/sdkconfig.defaults +++ b/examples/wifi/simple_sniffer/sdkconfig.defaults @@ -3,7 +3,7 @@ CONFIG_LOG_BOOTLOADER_LEVEL_WARN=y CONFIG_LOG_BOOTLOADER_LEVEL=2 # Increase main task stack size -CONFIG_MAIN_TASK_STACK_SIZE=7168 +CONFIG_ESP_MAIN_TASK_STACK_SIZE=7168 # Enable filesystem CONFIG_PARTITION_TABLE_CUSTOM=y diff --git a/tools/check_kconfigs.py b/tools/check_kconfigs.py index 05f0168cd..ae879813f 100755 --- a/tools/check_kconfigs.py +++ b/tools/check_kconfigs.py @@ -43,7 +43,7 @@ SPACES_PER_INDENT = 4 CONFIG_NAME_MAX_LENGTH = 40 -CONFIG_NAME_MIN_PREFIX_LENGTH = 4 +CONFIG_NAME_MIN_PREFIX_LENGTH = 3 # The checker will not fail if it encounters this string (it can be used for temporarily resolve conflicts) RE_NOERROR = re.compile(r'\s+#\s+NOERROR\s+$') diff --git a/tools/ci/test_build_system_cmake.sh b/tools/ci/test_build_system_cmake.sh index 77abe9bac..05bdb1b7a 100755 --- a/tools/ci/test_build_system_cmake.sh +++ b/tools/ci/test_build_system_cmake.sh @@ -344,7 +344,7 @@ function run_tests() print_status "Building a project with CMake library imported and PSRAM workaround, all files compile with workaround" # Test for libraries compiled within ESP-IDF rm -rf build - echo "CONFIG_SPIRAM_SUPPORT=y" >> sdkconfig.defaults + echo "CONFIG_ESP32_SPIRAM_SUPPORT=y" >> sdkconfig.defaults echo "CONFIG_SPIRAM_CACHE_WORKAROUND=y" >> sdkconfig.defaults # note: we do 'reconfigure' here, as we just need to run cmake idf.py -C $IDF_PATH/examples/build_system/cmake/import_lib -B `pwd`/build reconfigure -D SDKCONFIG_DEFAULTS="`pwd`/sdkconfig.defaults" @@ -353,7 +353,7 @@ function run_tests() rm -r sdkconfig.defaults build # Test for external libraries in custom CMake projects with ESP-IDF components linked mkdir build && touch build/sdkconfig - echo "CONFIG_SPIRAM_SUPPORT=y" >> build/sdkconfig + echo "CONFIG_ESP32_SPIRAM_SUPPORT=y" >> build/sdkconfig echo "CONFIG_SPIRAM_CACHE_WORKAROUND=y" >> build/sdkconfig # note: we just need to run cmake (cd build && cmake $IDF_PATH/examples/build_system/cmake/idf_as_lib -DCMAKE_TOOLCHAIN_FILE=$IDF_PATH/tools/cmake/toolchain-esp32.cmake -DTARGET=esp32) diff --git a/tools/ldgen/samples/sdkconfig b/tools/ldgen/samples/sdkconfig index 8fa6cf3c0..3f8158a92 100644 --- a/tools/ldgen/samples/sdkconfig +++ b/tools/ldgen/samples/sdkconfig @@ -134,23 +134,23 @@ CONFIG_ESP32_DEFAULT_CPU_FREQ_80= CONFIG_ESP32_DEFAULT_CPU_FREQ_160= CONFIG_ESP32_DEFAULT_CPU_FREQ_240=y CONFIG_ESP32_DEFAULT_CPU_FREQ_MHZ=240 -CONFIG_SPIRAM_SUPPORT= -CONFIG_MEMMAP_TRACEMEM= -CONFIG_MEMMAP_TRACEMEM_TWOBANKS= +CONFIG_ESP32_SPIRAM_SUPPORT= +CONFIG_ESP32_MEMMAP_TRACEMEM= +CONFIG_ESP32_MEMMAP_TRACEMEM_TWOBANKS= CONFIG_ESP32_TRAX= -CONFIG_TRACEMEM_RESERVE_DRAM=0x0 +CONFIG_ESP32_TRACEMEM_RESERVE_DRAM=0x0 CONFIG_ESP32_ENABLE_COREDUMP_TO_FLASH= CONFIG_ESP32_ENABLE_COREDUMP_TO_UART= CONFIG_ESP32_ENABLE_COREDUMP_TO_NONE=y CONFIG_ESP32_ENABLE_COREDUMP= -CONFIG_TWO_UNIVERSAL_MAC_ADDRESS= -CONFIG_FOUR_UNIVERSAL_MAC_ADDRESS=y -CONFIG_NUMBER_OF_UNIVERSAL_MAC_ADDRESS=4 -CONFIG_SYSTEM_EVENT_QUEUE_SIZE=32 -CONFIG_SYSTEM_EVENT_TASK_STACK_SIZE=2048 -CONFIG_MAIN_TASK_STACK_SIZE=4096 -CONFIG_IPC_TASK_STACK_SIZE=1024 -CONFIG_TIMER_TASK_STACK_SIZE=3584 +CONFIG_ESP32_UNIVERSAL_MAC_ADDRESSES_TWO= +CONFIG_ESP32_UNIVERSAL_MAC_ADDRESSES_FOUR=y +CONFIG_ESP32_UNIVERSAL_MAC_ADDRESSES=4 +CONFIG_ESP_SYSTEM_EVENT_QUEUE_SIZE=32 +CONFIG_ESP_SYSTEM_EVENT_TASK_STACK_SIZE=2048 +CONFIG_ESP_MAIN_TASK_STACK_SIZE=4096 +CONFIG_ESP_IPC_TASK_STACK_SIZE=1024 +CONFIG_ESP_TIMER_TASK_STACK_SIZE=3584 CONFIG_NEWLIB_STDOUT_LINE_ENDING_CRLF=y CONFIG_NEWLIB_STDOUT_LINE_ENDING_LF= CONFIG_NEWLIB_STDOUT_LINE_ENDING_CR= @@ -158,40 +158,40 @@ CONFIG_NEWLIB_STDIN_LINE_ENDING_CRLF= CONFIG_NEWLIB_STDIN_LINE_ENDING_LF= CONFIG_NEWLIB_STDIN_LINE_ENDING_CR=y CONFIG_NEWLIB_NANO_FORMAT= -CONFIG_CONSOLE_UART_DEFAULT=y -CONFIG_CONSOLE_UART_CUSTOM= -CONFIG_CONSOLE_UART_NONE= -CONFIG_CONSOLE_UART_NUM=0 -CONFIG_CONSOLE_UART_BAUDRATE=115200 -CONFIG_ULP_COPROC_ENABLED= -CONFIG_ULP_COPROC_RESERVE_MEM=0 +CONFIG_ESP_CONSOLE_UART_DEFAULT=y +CONFIG_ESP_CONSOLE_UART_CUSTOM= +CONFIG_ESP_CONSOLE_UART_NONE= +CONFIG_ESP_CONSOLE_UART_NUM=0 +CONFIG_ESP_CONSOLE_UART_BAUDRATE=115200 +CONFIG_ESP32_ULP_COPROC_ENABLED= +CONFIG_ESP32_ULP_COPROC_RESERVE_MEM=0 CONFIG_ESP32_PANIC_PRINT_HALT= CONFIG_ESP32_PANIC_PRINT_REBOOT=y CONFIG_ESP32_PANIC_SILENT_REBOOT= CONFIG_ESP32_PANIC_GDBSTUB= CONFIG_ESP32_DEBUG_OCDAWARE=y -CONFIG_INT_WDT=y -CONFIG_INT_WDT_TIMEOUT_MS=300 -CONFIG_TASK_WDT=y -CONFIG_TASK_WDT_PANIC= -CONFIG_TASK_WDT_TIMEOUT_S=5 -CONFIG_TASK_WDT_CHECK_IDLE_TASK_CPU0=y -CONFIG_BROWNOUT_DET=y -CONFIG_BROWNOUT_DET_LVL_SEL_0=y -CONFIG_BROWNOUT_DET_LVL_SEL_1= -CONFIG_BROWNOUT_DET_LVL_SEL_2= -CONFIG_BROWNOUT_DET_LVL_SEL_3= -CONFIG_BROWNOUT_DET_LVL_SEL_4= -CONFIG_BROWNOUT_DET_LVL_SEL_5= -CONFIG_BROWNOUT_DET_LVL_SEL_6= -CONFIG_BROWNOUT_DET_LVL_SEL_7= -CONFIG_BROWNOUT_DET_LVL=0 +CONFIG_ESP_INT_WDT=y +CONFIG_ESP_INT_WDT_TIMEOUT_MS=300 +CONFIG_ESP_TASK_WDT=y +CONFIG_ESP_TASK_WDT_PANIC= +CONFIG_ESP_TASK_WDT_TIMEOUT_S=5 +CONFIG_ESP_TASK_WDT_CHECK_IDLE_TASK_CPU0=y +CONFIG_ESP32_BROWNOUT_DET=y +CONFIG_ESP32_BROWNOUT_DET_LVL_SEL_0=y +CONFIG_ESP32_BROWNOUT_DET_LVL_SEL_1= +CONFIG_ESP32_BROWNOUT_DET_LVL_SEL_2= +CONFIG_ESP32_BROWNOUT_DET_LVL_SEL_3= +CONFIG_ESP32_BROWNOUT_DET_LVL_SEL_4= +CONFIG_ESP32_BROWNOUT_DET_LVL_SEL_5= +CONFIG_ESP32_BROWNOUT_DET_LVL_SEL_6= +CONFIG_ESP32_BROWNOUT_DET_LVL_SEL_7= +CONFIG_ESP32_BROWNOUT_DET_LVL=0 CONFIG_ESP32_TIME_SYSCALL_USE_RTC_FRC1=y CONFIG_ESP32_TIME_SYSCALL_USE_RTC= CONFIG_ESP32_TIME_SYSCALL_USE_FRC1= CONFIG_ESP32_TIME_SYSCALL_USE_NONE= -CONFIG_ESP32_RTC_CLOCK_SOURCE_INTERNAL_RC=y -CONFIG_ESP32_RTC_CLOCK_SOURCE_EXTERNAL_CRYSTAL= +CONFIG_ESP32_RTC_CLK_SRC_INT_RC=y +CONFIG_ESP32_RTC_CLK_SRC_EXT_CRYS= CONFIG_ESP32_RTC_CLK_CAL_CYCLES=1024 CONFIG_ESP32_RTC_XTAL_BOOTSTRAP_CYCLES=100 CONFIG_ESP32_DEEP_SLEEP_WAKEUP_DELAY=2000 @@ -199,10 +199,10 @@ CONFIG_ESP32_XTAL_FREQ_40=y CONFIG_ESP32_XTAL_FREQ_26= CONFIG_ESP32_XTAL_FREQ_AUTO= CONFIG_ESP32_XTAL_FREQ=40 -CONFIG_DISABLE_BASIC_ROM_CONSOLE= -CONFIG_NO_BLOBS= +CONFIG_ESP32_DISABLE_BASIC_ROM_CONSOLE= +CONFIG_ESP32_NO_BLOBS= CONFIG_ESP_TIMER_PROFILING= -CONFIG_COMPATIBLE_PRE_V2_1_BOOTLOADERS= +CONFIG_ESP32_COMPATIBLE_PRE_V2_1_BOOTLOADERS= CONFIG_ESP_ERR_TO_NAME_LOOKUP=y # diff --git a/tools/unit-test-app/README.md b/tools/unit-test-app/README.md index e62d6eb71..b5539b3b9 100644 --- a/tools/unit-test-app/README.md +++ b/tools/unit-test-app/README.md @@ -68,7 +68,7 @@ Tests marked as `[leaks]` or `[leaks=xxx]` reset the device after completion (or `TagDefinition.yml` defines how we should parse the description. In `TagDefinition.yml`, we declare the tags we are interested in, their default value and omitted value. Parser will parse the properities of test cases according to this file, and add them as test case attributes. -We will build unit-test-app with different sdkconfigs. Some config items requires specific board to run. For example, if `CONFIG_SPIRAM_SUPPORT` is enabled, then unit test app must run on board supports PSRAM. `ConfigDependency.yml` is used to define the mapping between sdkconfig items and tags. The tags will be saved as case attributes, used to select jobs and runners. In the previous example, `psram` tag is generated, will only select jobs and runners also contains `psram` tag. +We will build unit-test-app with different sdkconfigs. Some config items requires specific board to run. For example, if `CONFIG_ESP32_SPIRAM_SUPPORT` is enabled, then unit test app must run on board supports PSRAM. `ConfigDependency.yml` is used to define the mapping between sdkconfig items and tags. The tags will be saved as case attributes, used to select jobs and runners. In the previous example, `psram` tag is generated, will only select jobs and runners also contains `psram` tag. ### Assign Test Stage: diff --git a/tools/unit-test-app/configs/psram b/tools/unit-test-app/configs/psram index 0f977f5a0..4ca428d58 100644 --- a/tools/unit-test-app/configs/psram +++ b/tools/unit-test-app/configs/psram @@ -1,2 +1,2 @@ TEST_EXCLUDE_COMPONENTS=libsodium bt app_update driver esp32 spi_flash -CONFIG_SPIRAM_SUPPORT=y +CONFIG_ESP32_SPIRAM_SUPPORT=y diff --git a/tools/unit-test-app/configs/psram_2 b/tools/unit-test-app/configs/psram_2 index 7447f62b5..c0d4dc9eb 100644 --- a/tools/unit-test-app/configs/psram_2 +++ b/tools/unit-test-app/configs/psram_2 @@ -1,2 +1,2 @@ TEST_COMPONENTS=driver esp32 spi_flash -CONFIG_SPIRAM_SUPPORT=y +CONFIG_ESP32_SPIRAM_SUPPORT=y diff --git a/tools/unit-test-app/configs/psram_8m b/tools/unit-test-app/configs/psram_8m index d28e58702..f93316698 100644 --- a/tools/unit-test-app/configs/psram_8m +++ b/tools/unit-test-app/configs/psram_8m @@ -1,4 +1,4 @@ TEST_COMPONENTS=esp32 -CONFIG_SPIRAM_SUPPORT=y +CONFIG_ESP32_SPIRAM_SUPPORT=y CONFIG_SPIRAM_BANKSWITCH_ENABLE=y CONFIG_SPIRAM_BANKSWITCH_RESERVE=8 diff --git a/tools/unit-test-app/configs/psram_hspi b/tools/unit-test-app/configs/psram_hspi index d8568109d..ffd031b23 100644 --- a/tools/unit-test-app/configs/psram_hspi +++ b/tools/unit-test-app/configs/psram_hspi @@ -1,6 +1,6 @@ TEST_COMPONENTS=esp32 TEST_GROUPS=psram_4m CONFIG_ESPTOOLPY_FLASHFREQ_80M=y -CONFIG_SPIRAM_SUPPORT=y +CONFIG_ESP32_SPIRAM_SUPPORT=y CONFIG_SPIRAM_SPEED_80M=y CONFIG_SPIRAM_OCCUPY_HSPI_HOST=y diff --git a/tools/unit-test-app/configs/psram_vspi b/tools/unit-test-app/configs/psram_vspi index afa0c28f1..8b159487d 100644 --- a/tools/unit-test-app/configs/psram_vspi +++ b/tools/unit-test-app/configs/psram_vspi @@ -1,6 +1,6 @@ TEST_COMPONENTS=esp32 TEST_GROUPS=psram_4m CONFIG_ESPTOOLPY_FLASHFREQ_80M=y -CONFIG_SPIRAM_SUPPORT=y +CONFIG_ESP32_SPIRAM_SUPPORT=y CONFIG_SPIRAM_SPEED_80M=y CONFIG_SPIRAM_OCCUPY_VSPI_HOST=y diff --git a/tools/unit-test-app/sdkconfig.defaults b/tools/unit-test-app/sdkconfig.defaults index 0289c96f4..002431e87 100644 --- a/tools/unit-test-app/sdkconfig.defaults +++ b/tools/unit-test-app/sdkconfig.defaults @@ -17,8 +17,8 @@ CONFIG_MBEDTLS_HARDWARE_MPI=y CONFIG_MBEDTLS_MPI_USE_INTERRUPT=y CONFIG_MBEDTLS_HARDWARE_SHA=y CONFIG_SPI_FLASH_ENABLE_COUNTERS=y -CONFIG_ULP_COPROC_ENABLED=y -CONFIG_TASK_WDT=n +CONFIG_ESP32_ULP_COPROC_ENABLED=y +CONFIG_ESP_TASK_WDT=n CONFIG_SPI_FLASH_WRITING_DANGEROUS_REGIONS_FAILS=y CONFIG_FREERTOS_QUEUE_REGISTRY_SIZE=7 CONFIG_COMPILER_STACK_CHECK_MODE_STRONG=y diff --git a/tools/unit-test-app/tools/ConfigDependency.yml b/tools/unit-test-app/tools/ConfigDependency.yml index f7b265bc2..2e720089a 100644 --- a/tools/unit-test-app/tools/ConfigDependency.yml +++ b/tools/unit-test-app/tools/ConfigDependency.yml @@ -1,2 +1,2 @@ -"psram": '{CONFIG_SPIRAM_SUPPORT=y} and not {CONFIG_SPIRAM_BANKSWITCH_ENABLE=y}' +"psram": '{CONFIG_ESP32_SPIRAM_SUPPORT=y} and not {CONFIG_SPIRAM_BANKSWITCH_ENABLE=y}' "8Mpsram": "CONFIG_SPIRAM_BANKSWITCH_ENABLE=y" diff --git a/tools/unit-test-app/tools/UnitTestParser.py b/tools/unit-test-app/tools/UnitTestParser.py index b23f91e4f..f7715dc65 100644 --- a/tools/unit-test-app/tools/UnitTestParser.py +++ b/tools/unit-test-app/tools/UnitTestParser.py @@ -192,7 +192,7 @@ class Parser(object): def parse_tags(self, sdkconfig_file): """ Some test configs could requires different DUTs. - For example, if CONFIG_SPIRAM_SUPPORT is enabled, we need WROVER-Kit to run test. + For example, if CONFIG_ESP32_SPIRAM_SUPPORT is enabled, we need WROVER-Kit to run test. This method will get tags for runners according to ConfigDependency.yml(maps tags to sdkconfig). We support to the following syntax:: From d61d58e78d2b93ac456e8b7a02670e69e20e4aa4 Mon Sep 17 00:00:00 2001 From: Roland Dobai Date: Thu, 2 May 2019 15:01:28 +0200 Subject: [PATCH 15/21] Rename Kconfig options (components/pthread) --- components/pthread/Kconfig | 2 +- components/pthread/include/esp_pthread.h | 2 +- components/pthread/sdkconfig.rename | 4 ++++ 3 files changed, 6 insertions(+), 2 deletions(-) create mode 100644 components/pthread/sdkconfig.rename diff --git a/components/pthread/Kconfig b/components/pthread/Kconfig index 794f06bdb..61fa8a33e 100644 --- a/components/pthread/Kconfig +++ b/components/pthread/Kconfig @@ -13,7 +13,7 @@ menu "PThreads" help Stack size used to create new tasks with default pthread parameters. - config PTHREAD_STACK_MIN + config ESP32_PTHREAD_STACK_MIN int "Minimum allowed pthread stack size" default 768 help diff --git a/components/pthread/include/esp_pthread.h b/components/pthread/include/esp_pthread.h index 76f45a32a..ca93c9c38 100644 --- a/components/pthread/include/esp_pthread.h +++ b/components/pthread/include/esp_pthread.h @@ -22,7 +22,7 @@ extern "C" { #endif #ifndef PTHREAD_STACK_MIN -#define PTHREAD_STACK_MIN CONFIG_PTHREAD_STACK_MIN +#define PTHREAD_STACK_MIN CONFIG_ESP32_PTHREAD_STACK_MIN #endif /** pthread configuration structure that influences pthread creation */ diff --git a/components/pthread/sdkconfig.rename b/components/pthread/sdkconfig.rename new file mode 100644 index 000000000..b72b64707 --- /dev/null +++ b/components/pthread/sdkconfig.rename @@ -0,0 +1,4 @@ +# sdkconfig replacement configurations for deprecated options formatted as +# CONFIG_DEPRECATED_OPTION CONFIG_NEW_OPTION + +CONFIG_PTHREAD_STACK_MIN CONFIG_ESP32_PTHREAD_STACK_MIN From 24a2e5a17e6701a5833eee6c3bf2f935f58ed0f0 Mon Sep 17 00:00:00 2001 From: Roland Dobai Date: Thu, 2 May 2019 15:06:44 +0200 Subject: [PATCH 16/21] Rename Kconfig options (components/tcpip_adapter) --- components/tcpip_adapter/Kconfig | 4 ++-- components/tcpip_adapter/sdkconfig.rename | 5 +++++ components/tcpip_adapter/tcpip_adapter_lwip.c | 8 ++++---- tools/ldgen/samples/sdkconfig | 2 +- 4 files changed, 12 insertions(+), 7 deletions(-) create mode 100644 components/tcpip_adapter/sdkconfig.rename diff --git a/components/tcpip_adapter/Kconfig b/components/tcpip_adapter/Kconfig index 20d91fcab..6b409d38b 100644 --- a/components/tcpip_adapter/Kconfig +++ b/components/tcpip_adapter/Kconfig @@ -1,6 +1,6 @@ menu "TCP/IP Adapter" - config IP_LOST_TIMER_INTERVAL + config NETIF_IP_LOST_TIMER_INTERVAL int "IP Address lost timer interval (seconds)" range 0 65535 default 120 @@ -13,7 +13,7 @@ menu "TCP/IP Adapter" the timer expires. The IP lost timer is stopped if the station get the IP again before the timer expires. - choice USE_TCPIP_STACK_LIB + choice NETIF_USE_TCPIP_STACK_LIB prompt "TCP/IP Stack Library" default TCPIP_LWIP help diff --git a/components/tcpip_adapter/sdkconfig.rename b/components/tcpip_adapter/sdkconfig.rename new file mode 100644 index 000000000..72405c056 --- /dev/null +++ b/components/tcpip_adapter/sdkconfig.rename @@ -0,0 +1,5 @@ +# sdkconfig replacement configurations for deprecated options formatted as +# CONFIG_DEPRECATED_OPTION CONFIG_NEW_OPTION + +CONFIG_IP_LOST_TIMER_INTERVAL CONFIG_NETIF_IP_LOST_TIMER_INTERVAL +CONFIG_USE_TCPIP_STACK_LIB CONFIG_NETIF_USE_TCPIP_STACK_LIB diff --git a/components/tcpip_adapter/tcpip_adapter_lwip.c b/components/tcpip_adapter/tcpip_adapter_lwip.c index 0d77bb5ac..4720fadc2 100644 --- a/components/tcpip_adapter/tcpip_adapter_lwip.c +++ b/components/tcpip_adapter/tcpip_adapter_lwip.c @@ -953,15 +953,15 @@ static esp_err_t tcpip_adapter_start_ip_lost_timer(tcpip_adapter_if_t tcpip_if) return ESP_OK; } - if ( netif && (CONFIG_IP_LOST_TIMER_INTERVAL > 0) && !ip4_addr_isany_val(ip_info_old->ip)) { + if ( netif && (CONFIG_NETIF_IP_LOST_TIMER_INTERVAL > 0) && !ip4_addr_isany_val(ip_info_old->ip)) { esp_ip_lost_timer[tcpip_if].timer_running = true; - sys_timeout(CONFIG_IP_LOST_TIMER_INTERVAL*1000, tcpip_adapter_ip_lost_timer, (void*)tcpip_if); - ESP_LOGD(TAG, "if%d start ip lost tmr: interval=%d", tcpip_if, CONFIG_IP_LOST_TIMER_INTERVAL); + sys_timeout(CONFIG_NETIF_IP_LOST_TIMER_INTERVAL*1000, tcpip_adapter_ip_lost_timer, (void*)tcpip_if); + ESP_LOGD(TAG, "if%d start ip lost tmr: interval=%d", tcpip_if, CONFIG_NETIF_IP_LOST_TIMER_INTERVAL); return ESP_OK; } ESP_LOGD(TAG, "if%d start ip lost tmr: no need start because netif=%p interval=%d ip=%x", - tcpip_if, netif, CONFIG_IP_LOST_TIMER_INTERVAL, ip_info_old->ip.addr); + tcpip_if, netif, CONFIG_NETIF_IP_LOST_TIMER_INTERVAL, ip_info_old->ip.addr); return ESP_OK; } diff --git a/tools/ldgen/samples/sdkconfig b/tools/ldgen/samples/sdkconfig index 3f8158a92..9530a7f32 100644 --- a/tools/ldgen/samples/sdkconfig +++ b/tools/ldgen/samples/sdkconfig @@ -532,7 +532,7 @@ CONFIG_SPIFFS_TEST_VISUALISATION= # # tcpip adapter # -CONFIG_IP_LOST_TIMER_INTERVAL=120 +CONFIG_NETIF_IP_LOST_TIMER_INTERVAL=120 # # Wear Levelling From a1bddb923bb712d59cb0df9db5d7375fb177528f Mon Sep 17 00:00:00 2001 From: Roland Dobai Date: Thu, 2 May 2019 15:36:06 +0200 Subject: [PATCH 17/21] Rename Kconfig options (components/bt) --- components/bt/CMakeLists.txt | 2 +- components/bt/Kconfig | 1056 ++++++++--------- components/bt/bluedroid/api/esp_bt_main.c | 2 +- components/bt/bluedroid/btc/core/btc_task.c | 8 +- .../bt/bluedroid/btc/include/btc/btc_task.h | 4 +- .../btc/profile/std/hf_client/btc_hf_client.c | 2 +- .../common/include/common/bt_target.h | 74 +- .../common/include/common/bt_trace.h | 80 +- components/bt/bluedroid/osi/allocator.c | 12 +- .../bt/bluedroid/osi/include/osi/allocator.h | 4 +- .../bt/bluedroid/osi/include/osi/thread.h | 10 +- .../bt/bluedroid/stack/btm/include/btm_int.h | 2 +- components/bt/bt.c | 10 +- components/bt/component.mk | 2 +- components/bt/include/esp_bt.h | 30 +- components/bt/sdkconfig.rename | 227 ++++ components/protocomm/CMakeLists.txt | 2 +- components/protocomm/component.mk | 2 +- .../protocomm/src/simple_ble/simple_ble.c | 4 +- .../soc/include/soc/soc_memory_layout.h | 2 +- .../a2dp_gatts_coex/sdkconfig.defaults | 42 +- .../bluetooth/a2dp_sink/sdkconfig.defaults | 18 +- .../bluetooth/a2dp_source/sdkconfig.defaults | 18 +- examples/bluetooth/ble_adv/sdkconfig.defaults | 6 +- .../ble_eddystone/sdkconfig.defaults | 6 +- .../ble_hid_device_demo/sdkconfig.defaults | 6 +- .../bluetooth/ble_ibeacon/sdkconfig.defaults | 6 +- .../ble_spp_client/sdkconfig.defaults | 6 +- .../ble_spp_server/sdkconfig.defaults | 6 +- .../throughput_client/sdkconfig.defaults | 14 +- .../throughput_server/sdkconfig.defaults | 14 +- examples/bluetooth/blufi/sdkconfig.defaults | 40 +- .../bluetooth/bt_discovery/sdkconfig.defaults | 16 +- .../bt_spp_acceptor/sdkconfig.defaults | 8 +- .../bt_spp_initiator/sdkconfig.defaults | 8 +- .../bt_spp_vfs_acceptor/sdkconfig.defaults | 8 +- .../bt_spp_vfs_initiator/sdkconfig.defaults | 8 +- .../controller_hci_uart/sdkconfig.defaults | 14 +- .../bluetooth/gatt_client/sdkconfig.defaults | 6 +- .../gatt_security_client/sdkconfig.defaults | 6 +- .../gatt_security_server/sdkconfig.defaults | 6 +- .../bluetooth/gatt_server/sdkconfig.defaults | 6 +- .../sdkconfig.defaults | 6 +- .../gattc_multi_connect/sdkconfig.defaults | 8 +- .../provisioning/ble_prov/sdkconfig.defaults | 6 +- tools/ldgen/samples/sdkconfig | 2 +- tools/unit-test-app/configs/bt | 2 +- 47 files changed, 1027 insertions(+), 800 deletions(-) create mode 100644 components/bt/sdkconfig.rename diff --git a/components/bt/CMakeLists.txt b/components/bt/CMakeLists.txt index 614ab3628..50ff9abf6 100644 --- a/components/bt/CMakeLists.txt +++ b/components/bt/CMakeLists.txt @@ -3,7 +3,7 @@ if(CONFIG_BT_ENABLED) set(COMPONENT_SRCS "bt.c") set(COMPONENT_ADD_INCLUDEDIRS include) - if(CONFIG_BLUEDROID_ENABLED) + if(CONFIG_BT_BLUEDROID_ENABLED) list(APPEND COMPONENT_PRIV_INCLUDEDIRS bluedroid/bta/include diff --git a/components/bt/Kconfig b/components/bt/Kconfig index cc3066f35..0dce796c3 100644 --- a/components/bt/Kconfig +++ b/components/bt/Kconfig @@ -9,97 +9,97 @@ menu Bluetooth menu "Bluetooth controller" visible if BT_ENABLED - choice BTDM_CONTROLLER_MODE + choice BTDM_CTRL_MODE prompt "Bluetooth controller mode (BR/EDR/BLE/DUALMODE)" depends on BT_ENABLED help Specify the bluetooth controller mode (BR/EDR, BLE or dual mode). - config BTDM_CONTROLLER_MODE_BLE_ONLY + config BTDM_CTRL_MODE_BLE_ONLY bool "BLE Only" - config BTDM_CONTROLLER_MODE_BR_EDR_ONLY + config BTDM_CTRL_MODE_BR_EDR_ONLY bool "BR/EDR Only" - config BTDM_CONTROLLER_MODE_BTDM + config BTDM_CTRL_MODE_BTDM bool "Bluetooth Dual Mode" endchoice - config BTDM_CONTROLLER_BLE_MAX_CONN + config BTDM_CTRL_BLE_MAX_CONN int "BLE Max Connections" - depends on BTDM_CONTROLLER_MODE_BLE_ONLY || BTDM_CONTROLLER_MODE_BTDM + depends on BTDM_CTRL_MODE_BLE_ONLY || BTDM_CTRL_MODE_BTDM default 3 range 1 9 help BLE maximum connections of bluetooth controller. Each connection uses 1KB static DRAM whenever the BT controller is enabled. - config BTDM_CONTROLLER_BR_EDR_MAX_ACL_CONN + config BTDM_CTRL_BR_EDR_MAX_ACL_CONN int "BR/EDR ACL Max Connections" - depends on BTDM_CONTROLLER_MODE_BR_EDR_ONLY || BTDM_CONTROLLER_MODE_BTDM + depends on BTDM_CTRL_MODE_BR_EDR_ONLY || BTDM_CTRL_MODE_BTDM default 2 range 1 7 help BR/EDR ACL maximum connections of bluetooth controller. Each connection uses 1.2KB static DRAM whenever the BT controller is enabled. - config BTDM_CONTROLLER_BR_EDR_MAX_SYNC_CONN + config BTDM_CTRL_BR_EDR_MAX_SYNC_CONN int "BR/EDR Sync(SCO/eSCO) Max Connections" - depends on BTDM_CONTROLLER_MODE_BR_EDR_ONLY || BTDM_CONTROLLER_MODE_BTDM + depends on BTDM_CTRL_MODE_BR_EDR_ONLY || BTDM_CTRL_MODE_BTDM default 0 range 0 3 help BR/EDR Synchronize maximum connections of bluetooth controller. Each connection uses 2KB static DRAM whenever the BT controller is enabled. - config BTDM_CONTROLLER_BLE_MAX_CONN_EFF + config BTDM_CTRL_BLE_MAX_CONN_EFF int - default BTDM_CONTROLLER_BLE_MAX_CONN if BTDM_CONTROLLER_MODE_BLE_ONLY || BTDM_CONTROLLER_MODE_BTDM + default BTDM_CTRL_BLE_MAX_CONN if BTDM_CTRL_MODE_BLE_ONLY || BTDM_CTRL_MODE_BTDM default 0 - config BTDM_CONTROLLER_BR_EDR_MAX_ACL_CONN_EFF + config BTDM_CTRL_BR_EDR_MAX_ACL_CONN_EFF int - default BTDM_CONTROLLER_BR_EDR_MAX_ACL_CONN if BTDM_CONTROLLER_MODE_BR_EDR_ONLY || BTDM_CONTROLLER_MODE_BTDM # NOERROR + default BTDM_CTRL_BR_EDR_MAX_ACL_CONN if BTDM_CTRL_MODE_BR_EDR_ONLY || BTDM_CTRL_MODE_BTDM default 0 - config BTDM_CONTROLLER_BR_EDR_MAX_SYNC_CONN_EFF + config BTDM_CTRL_BR_EDR_MAX_SYNC_CONN_EFF int - default BTDM_CONTROLLER_BR_EDR_MAX_SYNC_CONN if BTDM_CONTROLLER_MODE_BR_EDR_ONLY || BTDM_CONTROLLER_MODE_BTDM # NOERROR + default BTDM_CTRL_BR_EDR_MAX_SYNC_CONN if BTDM_CTRL_MODE_BR_EDR_ONLY || BTDM_CTRL_MODE_BTDM default 0 - choice BTDM_CONTROLLER_PINNED_TO_CORE_CHOICE + choice BTDM_CTRL_PINNED_TO_CORE_CHOICE prompt "The cpu core which bluetooth controller run" depends on BT_ENABLED && !FREERTOS_UNICORE help Specify the cpu core to run bluetooth controller. Can not specify no-affinity. - config BTDM_CONTROLLER_PINNED_TO_CORE_0 + config BTDM_CTRL_PINNED_TO_CORE_0 bool "Core 0 (PRO CPU)" - config BTDM_CONTROLLER_PINNED_TO_CORE_1 + config BTDM_CTRL_PINNED_TO_CORE_1 bool "Core 1 (APP CPU)" depends on !FREERTOS_UNICORE endchoice - config BTDM_CONTROLLER_PINNED_TO_CORE + config BTDM_CTRL_PINNED_TO_CORE int - default 0 if BTDM_CONTROLLER_PINNED_TO_CORE_0 - default 1 if BTDM_CONTROLLER_PINNED_TO_CORE_1 + default 0 if BTDM_CTRL_PINNED_TO_CORE_0 + default 1 if BTDM_CTRL_PINNED_TO_CORE_1 default 0 - choice BTDM_CONTROLLER_HCI_MODE_CHOICE + choice BTDM_CTRL_HCI_MODE_CHOICE prompt "HCI mode" depends on BT_ENABLED help Speicify HCI mode as VHCI or UART(H4) - config BTDM_CONTROLLER_HCI_MODE_VHCI + config BTDM_CTRL_HCI_MODE_VHCI bool "VHCI" help Normal option. Mostly, choose this VHCI when bluetooth host run on ESP32, too. - config BTDM_CONTROLLER_HCI_MODE_UART_H4 + config BTDM_CTRL_HCI_MODE_UART_H4 bool "UART(H4)" help If use external bluetooth host which run on other hardware and use UART as the HCI interface, @@ -107,11 +107,11 @@ menu Bluetooth endchoice menu "HCI UART(H4) Options" - visible if BTDM_CONTROLLER_HCI_MODE_UART_H4 + visible if BTDM_CTRL_HCI_MODE_UART_H4 config BT_HCI_UART_NO int "UART Number for HCI" - depends on BTDM_CONTROLLER_HCI_MODE_UART_H4 + depends on BTDM_CTRL_HCI_MODE_UART_H4 range 1 2 default 1 help @@ -119,7 +119,7 @@ menu Bluetooth config BT_HCI_UART_BAUDRATE int "UART Baudrate for HCI" - depends on BTDM_CONTROLLER_HCI_MODE_UART_H4 + depends on BTDM_CTRL_HCI_MODE_UART_H4 range 115200 921600 default 921600 help @@ -130,7 +130,7 @@ menu Bluetooth menu "MODEM SLEEP Options" visible if BT_ENABLED - config BTDM_CONTROLLER_MODEM_SLEEP + config BTDM_MODEM_SLEEP bool "Bluetooth modem sleep" depends on BT_ENABLED default y @@ -139,7 +139,7 @@ menu Bluetooth choice BTDM_MODEM_SLEEP_MODE prompt "Bluetooth Modem sleep mode" - depends on BTDM_CONTROLLER_MODEM_SLEEP + depends on BTDM_MODEM_SLEEP help To select which strategy to use for modem sleep @@ -178,17 +178,17 @@ menu Bluetooth endmenu - config BLE_SCAN_DUPLICATE + config BTDM_BLE_SCAN_DUPL bool "BLE Scan Duplicate Options" - depends on (BTDM_CONTROLLER_MODE_BTDM || BTDM_CONTROLLER_MODE_BLE_ONLY) + depends on (BTDM_CTRL_MODE_BTDM || BTDM_CTRL_MODE_BLE_ONLY) default y help This select enables parameters setting of BLE scan duplicate. - choice SCAN_DUPLICATE_TYPE + choice BTDM_SCAN_DUPL_TYPE prompt "Scan Duplicate Type" - default SCAN_DUPLICATE_BY_DEVICE_ADDR - depends on BLE_SCAN_DUPLICATE + default BTDM_SCAN_DUPL_TYPE_DEVICE + depends on BTDM_BLE_SCAN_DUPL help Scan duplicate have three ways. one is "Scan Duplicate By Device Address", This way is to use advertiser address filtering. The adv packet of the same address is only allowed to be reported once. @@ -198,204 +198,204 @@ menu Bluetooth filtering. All same advertising data only allow to be reported once even though they are from different devices. - config SCAN_DUPLICATE_BY_DEVICE_ADDR + config BTDM_SCAN_DUPL_TYPE_DEVICE bool "Scan Duplicate By Device Address" help This way is to use advertiser address filtering. The adv packet of the same address is only allowed to be reported once - config SCAN_DUPLICATE_BY_ADV_DATA + config BTDM_SCAN_DUPL_TYPE_DATA bool "Scan Duplicate By Advertising Data" help This way is to use advertising data filtering. All same advertising data only allow to be reported once even though they are from different devices. - config SCAN_DUPLICATE_BY_ADV_DATA_AND_DEVICE_ADDR + config BTDM_SCAN_DUPL_TYPE_DATA_DEVICE bool "Scan Duplicate By Device Address And Advertising Data" help This way is to use advertising data and device address filtering. All different adv packets with the same address are allowed to be reported. endchoice - config SCAN_DUPLICATE_TYPE + config BTDM_SCAN_DUPL_TYPE int - depends on BLE_SCAN_DUPLICATE - default 0 if SCAN_DUPLICATE_BY_DEVICE_ADDR - default 1 if SCAN_DUPLICATE_BY_ADV_DATA - default 2 if SCAN_DUPLICATE_BY_ADV_DATA_AND_DEVICE_ADDR + depends on BTDM_BLE_SCAN_DUPL + default 0 if BTDM_SCAN_DUPL_TYPE_DEVICE + default 1 if BTDM_SCAN_DUPL_TYPE_DATA + default 2 if BTDM_SCAN_DUPL_TYPE_DATA_DEVICE default 0 - config DUPLICATE_SCAN_CACHE_SIZE + config BTDM_SCAN_DUPL_CACHE_SIZE int "Maximum number of devices in scan duplicate filter" - depends on BLE_SCAN_DUPLICATE + depends on BTDM_BLE_SCAN_DUPL range 10 1000 default 200 help Maximum number of devices which can be recorded in scan duplicate filter. When the maximum amount of device in the filter is reached, the cache will be refreshed. - config BLE_MESH_SCAN_DUPLICATE_EN + config BTDM_BLE_MESH_SCAN_DUPL_EN bool "Special duplicate scan mechanism for BLE Mesh scan" - depends on BLE_SCAN_DUPLICATE + depends on BTDM_BLE_SCAN_DUPL default n help This enables the BLE scan duplicate for special BLE Mesh scan. - config MESH_DUPLICATE_SCAN_CACHE_SIZE + config BTDM_MESH_DUPL_SCAN_CACHE_SIZE int "Maximum number of Mesh adv packets in scan duplicate filter" - depends on BLE_MESH_SCAN_DUPLICATE_EN + depends on BTDM_BLE_MESH_SCAN_DUPL_EN range 10 1000 default 200 help Maximum number of adv packets which can be recorded in duplicate scan cache for BLE Mesh. When the maximum amount of device in the filter is reached, the cache will be refreshed. - config BTDM_CONTROLLER_FULL_SCAN_SUPPORTED + config BTDM_CTRL_FULL_SCAN_SUPPORTED bool "BLE full scan feature supported" - depends on BTDM_CONTROLLER_MODE_BLE_ONLY + depends on BTDM_CTRL_MODE_BLE_ONLY default n help The full scan function is mainly used to provide BLE scan performance. This is required for scenes with high scan performance requirements, such as BLE Mesh scenes. - config BLE_ADV_REPORT_FLOW_CONTROL_SUPPORTED + config BTDM_BLE_ADV_REPORT_FLOW_CTRL_SUPP bool "BLE adv report flow control supported" - depends on (BTDM_CONTROLLER_MODE_BTDM || BTDM_CONTROLLER_MODE_BLE_ONLY) + depends on (BTDM_CTRL_MODE_BTDM || BTDM_CTRL_MODE_BLE_ONLY) default y help The function is mainly used to enable flow control for advertising reports. When it is enabled, advertising reports will be discarded by the controller if the number of unprocessed advertising reports exceeds the size of BLE adv report flow control. - config BLE_ADV_REPORT_FLOW_CONTROL_NUM + config BTDM_BLE_ADV_REPORT_FLOW_CTRL_NUM int "BLE adv report flow control number" - depends on BLE_ADV_REPORT_FLOW_CONTROL_SUPPORTED + depends on BTDM_BLE_ADV_REPORT_FLOW_CTRL_SUPP range 50 1000 default 100 help The number of unprocessed advertising report that Bluedroid can save.If you set - `BLE_ADV_REPORT_FLOW_CONTROL_NUM` to a small value, this may cause adv packets lost. - If you set `BLE_ADV_REPORT_FLOW_CONTROL_NUM` to a large value, Bluedroid may cache a + `BTDM_BLE_ADV_REPORT_FLOW_CTRL_NUM` to a small value, this may cause adv packets lost. + If you set `BTDM_BLE_ADV_REPORT_FLOW_CTRL_NUM` to a large value, Bluedroid may cache a lot of adv packets and this may cause system memory run out. For example, if you set it to 50, the maximum memory consumed by host is 35 * 50 bytes. Please set - `BLE_ADV_REPORT_FLOW_CONTROL_NUM` according to your system free memory and handle adv + `BTDM_BLE_ADV_REPORT_FLOW_CTRL_NUM` according to your system free memory and handle adv packets as fast as possible, otherwise it will cause adv packets lost. - config BLE_ADV_REPORT_DISCARD_THRSHOLD + config BTDM_BLE_ADV_REPORT_DISCARD_THRSHOLD int "BLE adv lost event threshold value" - depends on BLE_ADV_REPORT_FLOW_CONTROL_SUPPORTED + depends on BTDM_BLE_ADV_REPORT_FLOW_CTRL_SUPP range 1 1000 default 20 help When adv report flow control is enabled, The ADV lost event will be generated when the number of ADV packets lost in the controller reaches this threshold. It is better to set a larger value. - If you set `BLE_ADV_REPORT_DISCARD_THRSHOLD` to a small value or printf every adv lost event, it + If you set `BTDM_BLE_ADV_REPORT_DISCARD_THRSHOLD` to a small value or printf every adv lost event, it may cause adv packets lost more. endmenu - menuconfig BLUEDROID_ENABLED + menuconfig BT_BLUEDROID_ENABLED bool "Bluedroid Enable" - depends on BTDM_CONTROLLER_HCI_MODE_VHCI + depends on BTDM_CTRL_HCI_MODE_VHCI default y help This enables the default Bluedroid Bluetooth stack - choice BLUEDROID_PINNED_TO_CORE_CHOICE + choice BT_BLUEDROID_PINNED_TO_CORE_CHOICE prompt "The cpu core which Bluedroid run" - depends on BLUEDROID_ENABLED && !FREERTOS_UNICORE + depends on BT_BLUEDROID_ENABLED && !FREERTOS_UNICORE help Which the cpu core to run Bluedroid. Can choose core0 and core1. Can not specify no-affinity. - config BLUEDROID_PINNED_TO_CORE_0 + config BT_BLUEDROID_PINNED_TO_CORE_0 bool "Core 0 (PRO CPU)" - config BLUEDROID_PINNED_TO_CORE_1 + config BT_BLUEDROID_PINNED_TO_CORE_1 bool "Core 1 (APP CPU)" depends on !FREERTOS_UNICORE endchoice - config BLUEDROID_PINNED_TO_CORE + config BT_BLUEDROID_PINNED_TO_CORE int - depends on BLUEDROID_ENABLED - default 0 if BLUEDROID_PINNED_TO_CORE_0 - default 1 if BLUEDROID_PINNED_TO_CORE_1 + depends on BT_BLUEDROID_ENABLED + default 0 if BT_BLUEDROID_PINNED_TO_CORE_0 + default 1 if BT_BLUEDROID_PINNED_TO_CORE_1 default 0 - config BTC_TASK_STACK_SIZE + config BT_BTC_TASK_STACK_SIZE int "Bluetooth event (callback to application) task stack size" - depends on BLUEDROID_ENABLED + depends on BT_BLUEDROID_ENABLED default 3072 help This select btc task stack size - config BTU_TASK_STACK_SIZE + config BT_BTU_TASK_STACK_SIZE int "Bluetooth Bluedroid Host Stack task stack size" - depends on BLUEDROID_ENABLED + depends on BT_BLUEDROID_ENABLED default 4096 help This select btu task stack size - config BLUEDROID_MEM_DEBUG + config BT_BLUEDROID_MEM_DEBUG bool "Bluedroid memory debug" - depends on BLUEDROID_ENABLED + depends on BT_BLUEDROID_ENABLED default n help Bluedroid memory debug - config CLASSIC_BT_ENABLED + config BT_CLASSIC_ENABLED bool "Classic Bluetooth" - depends on BLUEDROID_ENABLED + depends on BT_BLUEDROID_ENABLED default n help For now this option needs "SMP_ENABLE" to be set to yes - config A2DP_ENABLE + config BT_A2DP_ENABLE bool "A2DP" - depends on CLASSIC_BT_ENABLED + depends on BT_CLASSIC_ENABLED default n help Advanced Audio Distrubution Profile - config A2DP_SINK_TASK_STACK_SIZE + config BT_A2DP_SINK_TASK_STACK_SIZE int "A2DP sink (audio stream decoding) task stack size" - depends on A2DP_ENABLE + depends on BT_A2DP_ENABLE default 2048 - config A2DP_SOURCE_TASK_STACK_SIZE + config BT_A2DP_SOURCE_TASK_STACK_SIZE int "A2DP source (audio stream encoding) task stack size" - depends on A2DP_ENABLE + depends on BT_A2DP_ENABLE default 2048 config BT_SPP_ENABLED bool "SPP" - depends on CLASSIC_BT_ENABLED + depends on BT_CLASSIC_ENABLED default n help This enables the Serial Port Profile - config HFP_ENABLE + config BT_HFP_ENABLE bool "Hands Free/Handset Profile" - depends on CLASSIC_BT_ENABLED + depends on BT_CLASSIC_ENABLED default n - choice HFP_ROLE + choice BT_HFP_ROLE prompt "Hands-free Profile Role configuration" - depends on HFP_ENABLE + depends on BT_HFP_ENABLE - config HFP_CLIENT_ENABLE + config BT_HFP_CLIENT_ENABLE bool "Hands Free Unit" endchoice - choice HFP_AUDIO_DATA_PATH + choice BT_HFP_AUDIO_DATA_PATH prompt "audio(SCO) data path" - depends on HFP_ENABLE + depends on BT_HFP_ENABLE - config HFP_AUDIO_DATA_PATH_PCM + config BT_HFP_AUDIO_DATA_PATH_PCM bool "PCM" help This enables the Serial Port Profile - config HFP_AUDIO_DATA_PATH_HCI + config BT_HFP_AUDIO_DATA_PATH_HCI bool "HCI" help This enables the Serial Port Profile @@ -403,815 +403,815 @@ menu Bluetooth config BT_SSP_ENABLED bool "Secure Simple Pairing" - depends on CLASSIC_BT_ENABLED + depends on BT_CLASSIC_ENABLED default y help This enables the Secure Simple Pairing. If disable this option, Bluedroid will only support Legacy Pairing - config GATTS_ENABLE + config BT_GATTS_ENABLE bool "Include GATT server module(GATTS)" - depends on BLUEDROID_ENABLED && (BTDM_CONTROLLER_MODE_BTDM || BTDM_CONTROLLER_MODE_BLE_ONLY) + depends on BT_BLUEDROID_ENABLED && (BTDM_CTRL_MODE_BTDM || BTDM_CTRL_MODE_BLE_ONLY) default y help This option can be disabled when the app work only on gatt client mode - choice GATTS_SEND_SERVICE_CHANGE_MODE + choice BT_GATTS_SEND_SERVICE_CHANGE_MODE prompt "GATTS Service Change Mode" - default GATTS_SEND_SERVICE_CHANGE_AUTO - depends on GATTS_ENABLE + default BT_GATTS_SEND_SERVICE_CHANGE_AUTO + depends on BT_GATTS_ENABLE help Service change indication mode for GATT Server. - config GATTS_SEND_SERVICE_CHANGE_MANUAL + config BT_GATTS_SEND_SERVICE_CHANGE_MANUAL bool "GATTS manually send service change indication" help Manually send service change indication through API esp_ble_gatts_send_service_change_indication() - config GATTS_SEND_SERVICE_CHANGE_AUTO + config BT_GATTS_SEND_SERVICE_CHANGE_AUTO bool "GATTS automatically send service change indication" help Let Bluedroid handle the service change indication internally endchoice - config GATTS_SEND_SERVICE_CHANGE_MODE + config BT_GATTS_SEND_SERVICE_CHANGE_MODE int - depends on GATTS_ENABLE - default 0 if GATTS_SEND_SERVICE_CHANGE_AUTO - default 1 if GATTS_SEND_SERVICE_CHANGE_MANUAL + depends on BT_GATTS_ENABLE + default 0 if BT_GATTS_SEND_SERVICE_CHANGE_AUTO + default 1 if BT_GATTS_SEND_SERVICE_CHANGE_MANUAL default 0 - config GATTC_ENABLE + config BT_GATTC_ENABLE bool "Include GATT client module(GATTC)" - depends on BLUEDROID_ENABLED && (BTDM_CONTROLLER_MODE_BTDM || BTDM_CONTROLLER_MODE_BLE_ONLY) + depends on BT_BLUEDROID_ENABLED && (BTDM_CTRL_MODE_BTDM || BTDM_CTRL_MODE_BLE_ONLY) default y help This option can be close when the app work only on gatt server mode - config GATTC_CACHE_NVS_FLASH + config BT_GATTC_CACHE_NVS_FLASH bool "Save gattc cache data to nvs flash" - depends on GATTC_ENABLE && (BTDM_CONTROLLER_MODE_BTDM || BTDM_CONTROLLER_MODE_BLE_ONLY) + depends on BT_GATTC_ENABLE && (BTDM_CTRL_MODE_BTDM || BTDM_CTRL_MODE_BLE_ONLY) default n help This select can save gattc cache data to nvs flash - config BLE_SMP_ENABLE + config BT_BLE_SMP_ENABLE bool "Include BLE security module(SMP)" - depends on BLUEDROID_ENABLED && (BTDM_CONTROLLER_MODE_BTDM || BTDM_CONTROLLER_MODE_BLE_ONLY) + depends on BT_BLUEDROID_ENABLED && (BTDM_CTRL_MODE_BTDM || BTDM_CTRL_MODE_BLE_ONLY) default y help This option can be close when the app not used the ble security connect. - config SMP_SLAVE_CON_PARAMS_UPD_ENABLE + config BT_SMP_SLAVE_CON_PARAMS_UPD_ENABLE bool "Slave enable connection parameters update during pairing" - depends on BLE_SMP_ENABLE + depends on BT_BLE_SMP_ENABLE default n help In order to reduce the pairing time, slave actively initiates connection parameters update during pairing. config BT_STACK_NO_LOG bool "Disable BT debug logs (minimize bin size)" - depends on BLUEDROID_ENABLED + depends on BT_BLUEDROID_ENABLED default n help This select can save the rodata code size menu "BT DEBUG LOG LEVEL" - depends on BLUEDROID_ENABLED && !BT_STACK_NO_LOG + depends on BT_BLUEDROID_ENABLED && !BT_STACK_NO_LOG - choice HCI_INITIAL_TRACE_LEVEL + choice BT_LOG_HCI_TRACE_LEVEL prompt "HCI layer" - default HCI_TRACE_LEVEL_WARNING - depends on BLUEDROID_ENABLED && !BT_STACK_NO_LOG + default BT_LOG_HCI_TRACE_LEVEL_WARNING + depends on BT_BLUEDROID_ENABLED && !BT_STACK_NO_LOG help Define BT trace level for HCI layer - config HCI_TRACE_LEVEL_NONE + config BT_LOG_HCI_TRACE_LEVEL_NONE bool "NONE" - config HCI_TRACE_LEVEL_ERROR + config BT_LOG_HCI_TRACE_LEVEL_ERROR bool "ERROR" - config HCI_TRACE_LEVEL_WARNING + config BT_LOG_HCI_TRACE_LEVEL_WARNING bool "WARNING" - config HCI_TRACE_LEVEL_API + config BT_LOG_HCI_TRACE_LEVEL_API bool "API" - config HCI_TRACE_LEVEL_EVENT + config BT_LOG_HCI_TRACE_LEVEL_EVENT bool "EVENT" - config HCI_TRACE_LEVEL_DEBUG + config BT_LOG_HCI_TRACE_LEVEL_DEBUG bool "DEBUG" - config HCI_TRACE_LEVEL_VERBOSE + config BT_LOG_HCI_TRACE_LEVEL_VERBOSE bool "VERBOSE" endchoice - config HCI_INITIAL_TRACE_LEVEL + config BT_LOG_HCI_TRACE_LEVEL int - depends on BLUEDROID_ENABLED - default 0 if HCI_TRACE_LEVEL_NONE - default 1 if HCI_TRACE_LEVEL_ERROR - default 2 if HCI_TRACE_LEVEL_WARNING - default 3 if HCI_TRACE_LEVEL_API - default 4 if HCI_TRACE_LEVEL_EVENT - default 5 if HCI_TRACE_LEVEL_DEBUG - default 6 if HCI_TRACE_LEVEL_VERBOSE + depends on BT_BLUEDROID_ENABLED + default 0 if BT_LOG_HCI_TRACE_LEVEL_NONE + default 1 if BT_LOG_HCI_TRACE_LEVEL_ERROR + default 2 if BT_LOG_HCI_TRACE_LEVEL_WARNING + default 3 if BT_LOG_HCI_TRACE_LEVEL_API + default 4 if BT_LOG_HCI_TRACE_LEVEL_EVENT + default 5 if BT_LOG_HCI_TRACE_LEVEL_DEBUG + default 6 if BT_LOG_HCI_TRACE_LEVEL_VERBOSE default 2 - choice BTM_INITIAL_TRACE_LEVEL + choice BT_LOG_BTM_TRACE_LEVEL prompt "BTM layer" - default BTM_TRACE_LEVEL_WARNING - depends on BLUEDROID_ENABLED && !BT_STACK_NO_LOG + default BT_LOG_BTM_TRACE_LEVEL_WARNING + depends on BT_BLUEDROID_ENABLED && !BT_STACK_NO_LOG help Define BT trace level for BTM layer - config BTM_TRACE_LEVEL_NONE + config BT_LOG_BTM_TRACE_LEVEL_NONE bool "NONE" - config BTM_TRACE_LEVEL_ERROR + config BT_LOG_BTM_TRACE_LEVEL_ERROR bool "ERROR" - config BTM_TRACE_LEVEL_WARNING + config BT_LOG_BTM_TRACE_LEVEL_WARNING bool "WARNING" - config BTM_TRACE_LEVEL_API + config BT_LOG_BTM_TRACE_LEVEL_API bool "API" - config BTM_TRACE_LEVEL_EVENT + config BT_LOG_BTM_TRACE_LEVEL_EVENT bool "EVENT" - config BTM_TRACE_LEVEL_DEBUG + config BT_LOG_BTM_TRACE_LEVEL_DEBUG bool "DEBUG" - config BTM_TRACE_LEVEL_VERBOSE + config BT_LOG_BTM_TRACE_LEVEL_VERBOSE bool "VERBOSE" endchoice - config BTM_INITIAL_TRACE_LEVEL + config BT_LOG_BTM_TRACE_LEVEL int - depends on BLUEDROID_ENABLED - default 0 if BTM_TRACE_LEVEL_NONE - default 1 if BTM_TRACE_LEVEL_ERROR - default 2 if BTM_TRACE_LEVEL_WARNING - default 3 if BTM_TRACE_LEVEL_API - default 4 if BTM_TRACE_LEVEL_EVENT - default 5 if BTM_TRACE_LEVEL_DEBUG - default 6 if BTM_TRACE_LEVEL_VERBOSE + depends on BT_BLUEDROID_ENABLED + default 0 if BT_LOG_BTM_TRACE_LEVEL_NONE + default 1 if BT_LOG_BTM_TRACE_LEVEL_ERROR + default 2 if BT_LOG_BTM_TRACE_LEVEL_WARNING + default 3 if BT_LOG_BTM_TRACE_LEVEL_API + default 4 if BT_LOG_BTM_TRACE_LEVEL_EVENT + default 5 if BT_LOG_BTM_TRACE_LEVEL_DEBUG + default 6 if BT_LOG_BTM_TRACE_LEVEL_VERBOSE default 2 - choice L2CAP_INITIAL_TRACE_LEVEL + choice BT_LOG_L2CAP_TRACE_LEVEL prompt "L2CAP layer" - default L2CAP_TRACE_LEVEL_WARNING - depends on BLUEDROID_ENABLED && !BT_STACK_NO_LOG + default BT_LOG_L2CAP_TRACE_LEVEL_WARNING + depends on BT_BLUEDROID_ENABLED && !BT_STACK_NO_LOG help Define BT trace level for L2CAP layer - config L2CAP_TRACE_LEVEL_NONE + config BT_LOG_L2CAP_TRACE_LEVEL_NONE bool "NONE" - config L2CAP_TRACE_LEVEL_ERROR + config BT_LOG_L2CAP_TRACE_LEVEL_ERROR bool "ERROR" - config L2CAP_TRACE_LEVEL_WARNING + config BT_LOG_L2CAP_TRACE_LEVEL_WARNING bool "WARNING" - config L2CAP_TRACE_LEVEL_API + config BT_LOG_L2CAP_TRACE_LEVEL_API bool "API" - config L2CAP_TRACE_LEVEL_EVENT + config BT_LOG_L2CAP_TRACE_LEVEL_EVENT bool "EVENT" - config L2CAP_TRACE_LEVEL_DEBUG + config BT_LOG_L2CAP_TRACE_LEVEL_DEBUG bool "DEBUG" - config L2CAP_TRACE_LEVEL_VERBOSE + config BT_LOG_L2CAP_TRACE_LEVEL_VERBOSE bool "VERBOSE" endchoice - config L2CAP_INITIAL_TRACE_LEVEL + config BT_LOG_L2CAP_TRACE_LEVEL int - depends on BLUEDROID_ENABLED - default 0 if L2CAP_TRACE_LEVEL_NONE - default 1 if L2CAP_TRACE_LEVEL_ERROR - default 2 if L2CAP_TRACE_LEVEL_WARNING - default 3 if L2CAP_TRACE_LEVEL_API - default 4 if L2CAP_TRACE_LEVEL_EVENT - default 5 if L2CAP_TRACE_LEVEL_DEBUG - default 6 if L2CAP_TRACE_LEVEL_VERBOSE + depends on BT_BLUEDROID_ENABLED + default 0 if BT_LOG_L2CAP_TRACE_LEVEL_NONE + default 1 if BT_LOG_L2CAP_TRACE_LEVEL_ERROR + default 2 if BT_LOG_L2CAP_TRACE_LEVEL_WARNING + default 3 if BT_LOG_L2CAP_TRACE_LEVEL_API + default 4 if BT_LOG_L2CAP_TRACE_LEVEL_EVENT + default 5 if BT_LOG_L2CAP_TRACE_LEVEL_DEBUG + default 6 if BT_LOG_L2CAP_TRACE_LEVEL_VERBOSE default 2 - choice RFCOMM_INITIAL_TRACE_LEVEL + choice BT_LOG_RFCOMM_TRACE_LEVEL prompt "RFCOMM layer" - default RFCOMM_TRACE_LEVEL_WARNING - depends on BLUEDROID_ENABLED && !BT_STACK_NO_LOG + default BT_LOG_RFCOMM_TRACE_LEVEL_WARNING + depends on BT_BLUEDROID_ENABLED && !BT_STACK_NO_LOG help Define BT trace level for RFCOMM layer - config RFCOMM_TRACE_LEVEL_NONE + config BT_LOG_RFCOMM_TRACE_LEVEL_NONE bool "NONE" - config RFCOMM_TRACE_LEVEL_ERROR + config BT_LOG_RFCOMM_TRACE_LEVEL_ERROR bool "ERROR" - config RFCOMM_TRACE_LEVEL_WARNING + config BT_LOG_RFCOMM_TRACE_LEVEL_WARNING bool "WARNING" - config RFCOMM_TRACE_LEVEL_API + config BT_LOG_RFCOMM_TRACE_LEVEL_API bool "API" - config RFCOMM_TRACE_LEVEL_EVENT + config BT_LOG_RFCOMM_TRACE_LEVEL_EVENT bool "EVENT" - config RFCOMM_TRACE_LEVEL_DEBUG + config BT_LOG_RFCOMM_TRACE_LEVEL_DEBUG bool "DEBUG" - config RFCOMM_TRACE_LEVEL_VERBOSE + config BT_LOG_RFCOMM_TRACE_LEVEL_VERBOSE bool "VERBOSE" endchoice - config RFCOMM_INITIAL_TRACE_LEVEL + config BT_LOG_RFCOMM_TRACE_LEVEL int - depends on BLUEDROID_ENABLED - default 0 if RFCOMM_TRACE_LEVEL_NONE - default 1 if RFCOMM_TRACE_LEVEL_ERROR - default 2 if RFCOMM_TRACE_LEVEL_WARNING - default 3 if RFCOMM_TRACE_LEVEL_API - default 4 if RFCOMM_TRACE_LEVEL_EVENT - default 5 if RFCOMM_TRACE_LEVEL_DEBUG - default 6 if RFCOMM_TRACE_LEVEL_VERBOSE + depends on BT_BLUEDROID_ENABLED + default 0 if BT_LOG_RFCOMM_TRACE_LEVEL_NONE + default 1 if BT_LOG_RFCOMM_TRACE_LEVEL_ERROR + default 2 if BT_LOG_RFCOMM_TRACE_LEVEL_WARNING + default 3 if BT_LOG_RFCOMM_TRACE_LEVEL_API + default 4 if BT_LOG_RFCOMM_TRACE_LEVEL_EVENT + default 5 if BT_LOG_RFCOMM_TRACE_LEVEL_DEBUG + default 6 if BT_LOG_RFCOMM_TRACE_LEVEL_VERBOSE default 2 - choice SDP_INITIAL_TRACE_LEVEL + choice BT_LOG_SDP_TRACE_LEVEL prompt "SDP layer" - default SDP_TRACE_LEVEL_WARNING - depends on BLUEDROID_ENABLED && !BT_STACK_NO_LOG + default BT_LOG_SDP_TRACE_LEVEL_WARNING + depends on BT_BLUEDROID_ENABLED && !BT_STACK_NO_LOG help Define BT trace level for SDP layer - config SDP_TRACE_LEVEL_NONE + config BT_LOG_SDP_TRACE_LEVEL_NONE bool "NONE" - config SDP_TRACE_LEVEL_ERROR + config BT_LOG_SDP_TRACE_LEVEL_ERROR bool "ERROR" - config SDP_TRACE_LEVEL_WARNING + config BT_LOG_SDP_TRACE_LEVEL_WARNING bool "WARNING" - config SDP_TRACE_LEVEL_API + config BT_LOG_SDP_TRACE_LEVEL_API bool "API" - config SDP_TRACE_LEVEL_EVENT + config BT_LOG_SDP_TRACE_LEVEL_EVENT bool "EVENT" - config SDP_TRACE_LEVEL_DEBUG + config BT_LOG_SDP_TRACE_LEVEL_DEBUG bool "DEBUG" - config SDP_TRACE_LEVEL_VERBOSE + config BT_LOG_SDP_TRACE_LEVEL_VERBOSE bool "VERBOSE" endchoice - config SDP_INITIAL_TRACE_LEVEL + config BT_LOG_SDP_TRACE_LEVEL int - depends on BLUEDROID_ENABLED - default 0 if SDP_TRACE_LEVEL_NONE - default 1 if SDP_TRACE_LEVEL_ERROR - default 2 if SDP_TRACE_LEVEL_WARNING - default 3 if SDP_TRACE_LEVEL_API - default 4 if SDP_TRACE_LEVEL_EVENT - default 5 if SDP_TRACE_LEVEL_DEBUG - default 6 if SDP_TRACE_LEVEL_VERBOSE + depends on BT_BLUEDROID_ENABLED + default 0 if BT_LOG_SDP_TRACE_LEVEL_NONE + default 1 if BT_LOG_SDP_TRACE_LEVEL_ERROR + default 2 if BT_LOG_SDP_TRACE_LEVEL_WARNING + default 3 if BT_LOG_SDP_TRACE_LEVEL_API + default 4 if BT_LOG_SDP_TRACE_LEVEL_EVENT + default 5 if BT_LOG_SDP_TRACE_LEVEL_DEBUG + default 6 if BT_LOG_SDP_TRACE_LEVEL_VERBOSE default 2 - choice GAP_INITIAL_TRACE_LEVEL + choice BT_LOG_GAP_TRACE_LEVEL prompt "GAP layer" - default GAP_TRACE_LEVEL_WARNING - depends on BLUEDROID_ENABLED && !BT_STACK_NO_LOG + default BT_LOG_GAP_TRACE_LEVEL_WARNING + depends on BT_BLUEDROID_ENABLED && !BT_STACK_NO_LOG help Define BT trace level for GAP layer - config GAP_TRACE_LEVEL_NONE + config BT_LOG_GAP_TRACE_LEVEL_NONE bool "NONE" - config GAP_TRACE_LEVEL_ERROR + config BT_LOG_GAP_TRACE_LEVEL_ERROR bool "ERROR" - config GAP_TRACE_LEVEL_WARNING + config BT_LOG_GAP_TRACE_LEVEL_WARNING bool "WARNING" - config GAP_TRACE_LEVEL_API + config BT_LOG_GAP_TRACE_LEVEL_API bool "API" - config GAP_TRACE_LEVEL_EVENT + config BT_LOG_GAP_TRACE_LEVEL_EVENT bool "EVENT" - config GAP_TRACE_LEVEL_DEBUG + config BT_LOG_GAP_TRACE_LEVEL_DEBUG bool "DEBUG" - config GAP_TRACE_LEVEL_VERBOSE + config BT_LOG_GAP_TRACE_LEVEL_VERBOSE bool "VERBOSE" endchoice - config GAP_INITIAL_TRACE_LEVEL + config BT_LOG_GAP_TRACE_LEVEL int - depends on BLUEDROID_ENABLED - default 0 if GAP_TRACE_LEVEL_NONE - default 1 if GAP_TRACE_LEVEL_ERROR - default 2 if GAP_TRACE_LEVEL_WARNING - default 3 if GAP_TRACE_LEVEL_API - default 4 if GAP_TRACE_LEVEL_EVENT - default 5 if GAP_TRACE_LEVEL_DEBUG - default 6 if GAP_TRACE_LEVEL_VERBOSE + depends on BT_BLUEDROID_ENABLED + default 0 if BT_LOG_GAP_TRACE_LEVEL_NONE + default 1 if BT_LOG_GAP_TRACE_LEVEL_ERROR + default 2 if BT_LOG_GAP_TRACE_LEVEL_WARNING + default 3 if BT_LOG_GAP_TRACE_LEVEL_API + default 4 if BT_LOG_GAP_TRACE_LEVEL_EVENT + default 5 if BT_LOG_GAP_TRACE_LEVEL_DEBUG + default 6 if BT_LOG_GAP_TRACE_LEVEL_VERBOSE default 2 - choice BNEP_INITIAL_TRACE_LEVEL + choice BT_LOG_BNEP_TRACE_LEVEL prompt "BNEP layer" - default BNEP_TRACE_LEVEL_WARNING - depends on BLUEDROID_ENABLED && !BT_STACK_NO_LOG + default BT_LOG_BNEP_TRACE_LEVEL_WARNING + depends on BT_BLUEDROID_ENABLED && !BT_STACK_NO_LOG help Define BT trace level for BNEP layer - config BNEP_TRACE_LEVEL_NONE + config BT_LOG_BNEP_TRACE_LEVEL_NONE bool "NONE" - config BNEP_TRACE_LEVEL_ERROR + config BT_LOG_BNEP_TRACE_LEVEL_ERROR bool "ERROR" - config BNEP_TRACE_LEVEL_WARNING + config BT_LOG_BNEP_TRACE_LEVEL_WARNING bool "WARNING" - config BNEP_TRACE_LEVEL_API + config BT_LOG_BNEP_TRACE_LEVEL_API bool "API" - config BNEP_TRACE_LEVEL_EVENT + config BT_LOG_BNEP_TRACE_LEVEL_EVENT bool "EVENT" - config BNEP_TRACE_LEVEL_DEBUG + config BT_LOG_BNEP_TRACE_LEVEL_DEBUG bool "DEBUG" - config BNEP_TRACE_LEVEL_VERBOSE + config BT_LOG_BNEP_TRACE_LEVEL_VERBOSE bool "VERBOSE" endchoice - config BNEP_INITIAL_TRACE_LEVEL + config BT_LOG_BNEP_TRACE_LEVEL int - depends on BLUEDROID_ENABLED - default 0 if BNEP_TRACE_LEVEL_NONE - default 1 if BNEP_TRACE_LEVEL_ERROR - default 2 if BNEP_TRACE_LEVEL_WARNING - default 3 if BNEP_TRACE_LEVEL_API - default 4 if BNEP_TRACE_LEVEL_EVENT - default 5 if BNEP_TRACE_LEVEL_DEBUG - default 6 if BNEP_TRACE_LEVEL_VERBOSE + depends on BT_BLUEDROID_ENABLED + default 0 if BT_LOG_BNEP_TRACE_LEVEL_NONE + default 1 if BT_LOG_BNEP_TRACE_LEVEL_ERROR + default 2 if BT_LOG_BNEP_TRACE_LEVEL_WARNING + default 3 if BT_LOG_BNEP_TRACE_LEVEL_API + default 4 if BT_LOG_BNEP_TRACE_LEVEL_EVENT + default 5 if BT_LOG_BNEP_TRACE_LEVEL_DEBUG + default 6 if BT_LOG_BNEP_TRACE_LEVEL_VERBOSE default 2 - choice PAN_INITIAL_TRACE_LEVEL + choice BT_LOG_PAN_TRACE_LEVEL prompt "PAN layer" - default PAN_TRACE_LEVEL_WARNING - depends on BLUEDROID_ENABLED && !BT_STACK_NO_LOG + default BT_LOG_PAN_TRACE_LEVEL_WARNING + depends on BT_BLUEDROID_ENABLED && !BT_STACK_NO_LOG help Define BT trace level for PAN layer - config PAN_TRACE_LEVEL_NONE + config BT_LOG_PAN_TRACE_LEVEL_NONE bool "NONE" - config PAN_TRACE_LEVEL_ERROR + config BT_LOG_PAN_TRACE_LEVEL_ERROR bool "ERROR" - config PAN_TRACE_LEVEL_WARNING + config BT_LOG_PAN_TRACE_LEVEL_WARNING bool "WARNING" - config PAN_TRACE_LEVEL_API + config BT_LOG_PAN_TRACE_LEVEL_API bool "API" - config PAN_TRACE_LEVEL_EVENT + config BT_LOG_PAN_TRACE_LEVEL_EVENT bool "EVENT" - config PAN_TRACE_LEVEL_DEBUG + config BT_LOG_PAN_TRACE_LEVEL_DEBUG bool "DEBUG" - config PAN_TRACE_LEVEL_VERBOSE + config BT_LOG_PAN_TRACE_LEVEL_VERBOSE bool "VERBOSE" endchoice - config PAN_INITIAL_TRACE_LEVEL + config BT_LOG_PAN_TRACE_LEVEL int - depends on BLUEDROID_ENABLED - default 0 if PAN_TRACE_LEVEL_NONE - default 1 if PAN_TRACE_LEVEL_ERROR - default 2 if PAN_TRACE_LEVEL_WARNING - default 3 if PAN_TRACE_LEVEL_API - default 4 if PAN_TRACE_LEVEL_EVENT - default 5 if PAN_TRACE_LEVEL_DEBUG - default 6 if PAN_TRACE_LEVEL_VERBOSE + depends on BT_BLUEDROID_ENABLED + default 0 if BT_LOG_PAN_TRACE_LEVEL_NONE + default 1 if BT_LOG_PAN_TRACE_LEVEL_ERROR + default 2 if BT_LOG_PAN_TRACE_LEVEL_WARNING + default 3 if BT_LOG_PAN_TRACE_LEVEL_API + default 4 if BT_LOG_PAN_TRACE_LEVEL_EVENT + default 5 if BT_LOG_PAN_TRACE_LEVEL_DEBUG + default 6 if BT_LOG_PAN_TRACE_LEVEL_VERBOSE default 2 - choice A2D_INITIAL_TRACE_LEVEL + choice BT_LOG_A2D_TRACE_LEVEL prompt "A2D layer" - default A2D_TRACE_LEVEL_WARNING - depends on BLUEDROID_ENABLED && !BT_STACK_NO_LOG + default BT_LOG_A2D_TRACE_LEVEL_WARNING + depends on BT_BLUEDROID_ENABLED && !BT_STACK_NO_LOG help Define BT trace level for A2D layer - config A2D_TRACE_LEVEL_NONE + config BT_LOG_A2D_TRACE_LEVEL_NONE bool "NONE" - config A2D_TRACE_LEVEL_ERROR + config BT_LOG_A2D_TRACE_LEVEL_ERROR bool "ERROR" - config A2D_TRACE_LEVEL_WARNING + config BT_LOG_A2D_TRACE_LEVEL_WARNING bool "WARNING" - config A2D_TRACE_LEVEL_API + config BT_LOG_A2D_TRACE_LEVEL_API bool "API" - config A2D_TRACE_LEVEL_EVENT + config BT_LOG_A2D_TRACE_LEVEL_EVENT bool "EVENT" - config A2D_TRACE_LEVEL_DEBUG + config BT_LOG_A2D_TRACE_LEVEL_DEBUG bool "DEBUG" - config A2D_TRACE_LEVEL_VERBOSE + config BT_LOG_A2D_TRACE_LEVEL_VERBOSE bool "VERBOSE" endchoice - config A2D_INITIAL_TRACE_LEVEL + config BT_LOG_A2D_TRACE_LEVEL int - depends on BLUEDROID_ENABLED - default 0 if A2D_TRACE_LEVEL_NONE - default 1 if A2D_TRACE_LEVEL_ERROR - default 2 if A2D_TRACE_LEVEL_WARNING - default 3 if A2D_TRACE_LEVEL_API - default 4 if A2D_TRACE_LEVEL_EVENT - default 5 if A2D_TRACE_LEVEL_DEBUG - default 6 if A2D_TRACE_LEVEL_VERBOSE + depends on BT_BLUEDROID_ENABLED + default 0 if BT_LOG_A2D_TRACE_LEVEL_NONE + default 1 if BT_LOG_A2D_TRACE_LEVEL_ERROR + default 2 if BT_LOG_A2D_TRACE_LEVEL_WARNING + default 3 if BT_LOG_A2D_TRACE_LEVEL_API + default 4 if BT_LOG_A2D_TRACE_LEVEL_EVENT + default 5 if BT_LOG_A2D_TRACE_LEVEL_DEBUG + default 6 if BT_LOG_A2D_TRACE_LEVEL_VERBOSE default 2 - choice AVDT_INITIAL_TRACE_LEVEL + choice BT_LOG_AVDT_TRACE_LEVEL prompt "AVDT layer" - default AVDT_TRACE_LEVEL_WARNING - depends on BLUEDROID_ENABLED && !BT_STACK_NO_LOG + default BT_LOG_AVDT_TRACE_LEVEL_WARNING + depends on BT_BLUEDROID_ENABLED && !BT_STACK_NO_LOG help Define BT trace level for AVDT layer - config AVDT_TRACE_LEVEL_NONE + config BT_LOG_AVDT_TRACE_LEVEL_NONE bool "NONE" - config AVDT_TRACE_LEVEL_ERROR + config BT_LOG_AVDT_TRACE_LEVEL_ERROR bool "ERROR" - config AVDT_TRACE_LEVEL_WARNING + config BT_LOG_AVDT_TRACE_LEVEL_WARNING bool "WARNING" - config AVDT_TRACE_LEVEL_API + config BT_LOG_AVDT_TRACE_LEVEL_API bool "API" - config AVDT_TRACE_LEVEL_EVENT + config BT_LOG_AVDT_TRACE_LEVEL_EVENT bool "EVENT" - config AVDT_TRACE_LEVEL_DEBUG + config BT_LOG_AVDT_TRACE_LEVEL_DEBUG bool "DEBUG" - config AVDT_TRACE_LEVEL_VERBOSE + config BT_LOG_AVDT_TRACE_LEVEL_VERBOSE bool "VERBOSE" endchoice - config AVDT_INITIAL_TRACE_LEVEL + config BT_LOG_AVDT_TRACE_LEVEL int - depends on BLUEDROID_ENABLED - default 0 if AVDT_TRACE_LEVEL_NONE - default 1 if AVDT_TRACE_LEVEL_ERROR - default 2 if AVDT_TRACE_LEVEL_WARNING - default 3 if AVDT_TRACE_LEVEL_API - default 4 if AVDT_TRACE_LEVEL_EVENT - default 5 if AVDT_TRACE_LEVEL_DEBUG - default 6 if AVDT_TRACE_LEVEL_VERBOSE + depends on BT_BLUEDROID_ENABLED + default 0 if BT_LOG_AVDT_TRACE_LEVEL_NONE + default 1 if BT_LOG_AVDT_TRACE_LEVEL_ERROR + default 2 if BT_LOG_AVDT_TRACE_LEVEL_WARNING + default 3 if BT_LOG_AVDT_TRACE_LEVEL_API + default 4 if BT_LOG_AVDT_TRACE_LEVEL_EVENT + default 5 if BT_LOG_AVDT_TRACE_LEVEL_DEBUG + default 6 if BT_LOG_AVDT_TRACE_LEVEL_VERBOSE default 2 - choice AVCT_INITIAL_TRACE_LEVEL + choice BT_LOG_AVCT_TRACE_LEVEL prompt "AVCT layer" - default AVCT_TRACE_LEVEL_WARNING - depends on BLUEDROID_ENABLED && !BT_STACK_NO_LOG + default BT_LOG_AVCT_TRACE_LEVEL_WARNING + depends on BT_BLUEDROID_ENABLED && !BT_STACK_NO_LOG help Define BT trace level for AVCT layer - config AVCT_TRACE_LEVEL_NONE + config BT_LOG_AVCT_TRACE_LEVEL_NONE bool "NONE" - config AVCT_TRACE_LEVEL_ERROR + config BT_LOG_AVCT_TRACE_LEVEL_ERROR bool "ERROR" - config AVCT_TRACE_LEVEL_WARNING + config BT_LOG_AVCT_TRACE_LEVEL_WARNING bool "WARNING" - config AVCT_TRACE_LEVEL_API + config BT_LOG_AVCT_TRACE_LEVEL_API bool "API" - config AVCT_TRACE_LEVEL_EVENT + config BT_LOG_AVCT_TRACE_LEVEL_EVENT bool "EVENT" - config AVCT_TRACE_LEVEL_DEBUG + config BT_LOG_AVCT_TRACE_LEVEL_DEBUG bool "DEBUG" - config AVCT_TRACE_LEVEL_VERBOSE + config BT_LOG_AVCT_TRACE_LEVEL_VERBOSE bool "VERBOSE" endchoice - config AVCT_INITIAL_TRACE_LEVEL + config BT_LOG_AVCT_TRACE_LEVEL int - depends on BLUEDROID_ENABLED - default 0 if AVCT_TRACE_LEVEL_NONE - default 1 if AVCT_TRACE_LEVEL_ERROR - default 2 if AVCT_TRACE_LEVEL_WARNING - default 3 if AVCT_TRACE_LEVEL_API - default 4 if AVCT_TRACE_LEVEL_EVENT - default 5 if AVCT_TRACE_LEVEL_DEBUG - default 6 if AVCT_TRACE_LEVEL_VERBOSE + depends on BT_BLUEDROID_ENABLED + default 0 if BT_LOG_AVCT_TRACE_LEVEL_NONE + default 1 if BT_LOG_AVCT_TRACE_LEVEL_ERROR + default 2 if BT_LOG_AVCT_TRACE_LEVEL_WARNING + default 3 if BT_LOG_AVCT_TRACE_LEVEL_API + default 4 if BT_LOG_AVCT_TRACE_LEVEL_EVENT + default 5 if BT_LOG_AVCT_TRACE_LEVEL_DEBUG + default 6 if BT_LOG_AVCT_TRACE_LEVEL_VERBOSE default 2 - choice AVRC_INITIAL_TRACE_LEVEL + choice BT_LOG_AVRC_TRACE_LEVEL prompt "AVRC layer" - default AVRC_TRACE_LEVEL_WARNING - depends on BLUEDROID_ENABLED && !BT_STACK_NO_LOG + default BT_LOG_AVRC_TRACE_LEVEL_WARNING + depends on BT_BLUEDROID_ENABLED && !BT_STACK_NO_LOG help Define BT trace level for AVRC layer - config AVRC_TRACE_LEVEL_NONE + config BT_LOG_AVRC_TRACE_LEVEL_NONE bool "NONE" - config AVRC_TRACE_LEVEL_ERROR + config BT_LOG_AVRC_TRACE_LEVEL_ERROR bool "ERROR" - config AVRC_TRACE_LEVEL_WARNING + config BT_LOG_AVRC_TRACE_LEVEL_WARNING bool "WARNING" - config AVRC_TRACE_LEVEL_API + config BT_LOG_AVRC_TRACE_LEVEL_API bool "API" - config AVRC_TRACE_LEVEL_EVENT + config BT_LOG_AVRC_TRACE_LEVEL_EVENT bool "EVENT" - config AVRC_TRACE_LEVEL_DEBUG + config BT_LOG_AVRC_TRACE_LEVEL_DEBUG bool "DEBUG" - config AVRC_TRACE_LEVEL_VERBOSE + config BT_LOG_AVRC_TRACE_LEVEL_VERBOSE bool "VERBOSE" endchoice - config AVRC_INITIAL_TRACE_LEVEL + config BT_LOG_AVRC_TRACE_LEVEL int - depends on BLUEDROID_ENABLED - default 0 if AVRC_TRACE_LEVEL_NONE - default 1 if AVRC_TRACE_LEVEL_ERROR - default 2 if AVRC_TRACE_LEVEL_WARNING - default 3 if AVRC_TRACE_LEVEL_API - default 4 if AVRC_TRACE_LEVEL_EVENT - default 5 if AVRC_TRACE_LEVEL_DEBUG - default 6 if AVRC_TRACE_LEVEL_VERBOSE + depends on BT_BLUEDROID_ENABLED + default 0 if BT_LOG_AVRC_TRACE_LEVEL_NONE + default 1 if BT_LOG_AVRC_TRACE_LEVEL_ERROR + default 2 if BT_LOG_AVRC_TRACE_LEVEL_WARNING + default 3 if BT_LOG_AVRC_TRACE_LEVEL_API + default 4 if BT_LOG_AVRC_TRACE_LEVEL_EVENT + default 5 if BT_LOG_AVRC_TRACE_LEVEL_DEBUG + default 6 if BT_LOG_AVRC_TRACE_LEVEL_VERBOSE default 2 - choice MCA_INITIAL_TRACE_LEVEL + choice BT_LOG_MCA_TRACE_LEVEL prompt "MCA layer" - default MCA_TRACE_LEVEL_WARNING - depends on BLUEDROID_ENABLED && !BT_STACK_NO_LOG + default BT_LOG_MCA_TRACE_LEVEL_WARNING + depends on BT_BLUEDROID_ENABLED && !BT_STACK_NO_LOG help Define BT trace level for MCA layer - config MCA_TRACE_LEVEL_NONE + config BT_LOG_MCA_TRACE_LEVEL_NONE bool "NONE" - config MCA_TRACE_LEVEL_ERROR + config BT_LOG_MCA_TRACE_LEVEL_ERROR bool "ERROR" - config MCA_TRACE_LEVEL_WARNING + config BT_LOG_MCA_TRACE_LEVEL_WARNING bool "WARNING" - config MCA_TRACE_LEVEL_API + config BT_LOG_MCA_TRACE_LEVEL_API bool "API" - config MCA_TRACE_LEVEL_EVENT + config BT_LOG_MCA_TRACE_LEVEL_EVENT bool "EVENT" - config MCA_TRACE_LEVEL_DEBUG + config BT_LOG_MCA_TRACE_LEVEL_DEBUG bool "DEBUG" - config MCA_TRACE_LEVEL_VERBOSE + config BT_LOG_MCA_TRACE_LEVEL_VERBOSE bool "VERBOSE" endchoice - config MCA_INITIAL_TRACE_LEVEL + config BT_LOG_MCA_TRACE_LEVEL int - depends on BLUEDROID_ENABLED - default 0 if MCA_TRACE_LEVEL_NONE - default 1 if MCA_TRACE_LEVEL_ERROR - default 2 if MCA_TRACE_LEVEL_WARNING - default 3 if MCA_TRACE_LEVEL_API - default 4 if MCA_TRACE_LEVEL_EVENT - default 5 if MCA_TRACE_LEVEL_DEBUG - default 6 if MCA_TRACE_LEVEL_VERBOSE + depends on BT_BLUEDROID_ENABLED + default 0 if BT_LOG_MCA_TRACE_LEVEL_NONE + default 1 if BT_LOG_MCA_TRACE_LEVEL_ERROR + default 2 if BT_LOG_MCA_TRACE_LEVEL_WARNING + default 3 if BT_LOG_MCA_TRACE_LEVEL_API + default 4 if BT_LOG_MCA_TRACE_LEVEL_EVENT + default 5 if BT_LOG_MCA_TRACE_LEVEL_DEBUG + default 6 if BT_LOG_MCA_TRACE_LEVEL_VERBOSE default 2 - choice HID_INITIAL_TRACE_LEVEL + choice BT_LOG_HID_TRACE_LEVEL prompt "HID layer" - default HID_TRACE_LEVEL_WARNING - depends on BLUEDROID_ENABLED && !BT_STACK_NO_LOG + default BT_LOG_HID_TRACE_LEVEL_WARNING + depends on BT_BLUEDROID_ENABLED && !BT_STACK_NO_LOG help Define BT trace level for HID layer - config HID_TRACE_LEVEL_NONE + config BT_LOG_HID_TRACE_LEVEL_NONE bool "NONE" - config HID_TRACE_LEVEL_ERROR + config BT_LOG_HID_TRACE_LEVEL_ERROR bool "ERROR" - config HID_TRACE_LEVEL_WARNING + config BT_LOG_HID_TRACE_LEVEL_WARNING bool "WARNING" - config HID_TRACE_LEVEL_API + config BT_LOG_HID_TRACE_LEVEL_API bool "API" - config HID_TRACE_LEVEL_EVENT + config BT_LOG_HID_TRACE_LEVEL_EVENT bool "EVENT" - config HID_TRACE_LEVEL_DEBUG + config BT_LOG_HID_TRACE_LEVEL_DEBUG bool "DEBUG" - config HID_TRACE_LEVEL_VERBOSE + config BT_LOG_HID_TRACE_LEVEL_VERBOSE bool "VERBOSE" endchoice - config HID_INITIAL_TRACE_LEVEL + config BT_LOG_HID_TRACE_LEVEL int - depends on BLUEDROID_ENABLED - default 0 if HID_TRACE_LEVEL_NONE - default 1 if HID_TRACE_LEVEL_ERROR - default 2 if HID_TRACE_LEVEL_WARNING - default 3 if HID_TRACE_LEVEL_API - default 4 if HID_TRACE_LEVEL_EVENT - default 5 if HID_TRACE_LEVEL_DEBUG - default 6 if HID_TRACE_LEVEL_VERBOSE + depends on BT_BLUEDROID_ENABLED + default 0 if BT_LOG_HID_TRACE_LEVEL_NONE + default 1 if BT_LOG_HID_TRACE_LEVEL_ERROR + default 2 if BT_LOG_HID_TRACE_LEVEL_WARNING + default 3 if BT_LOG_HID_TRACE_LEVEL_API + default 4 if BT_LOG_HID_TRACE_LEVEL_EVENT + default 5 if BT_LOG_HID_TRACE_LEVEL_DEBUG + default 6 if BT_LOG_HID_TRACE_LEVEL_VERBOSE default 2 - choice APPL_INITIAL_TRACE_LEVEL + choice BT_LOG_APPL_TRACE_LEVEL prompt "APPL layer" - default APPL_TRACE_LEVEL_WARNING - depends on BLUEDROID_ENABLED && !BT_STACK_NO_LOG + default BT_LOG_APPL_TRACE_LEVEL_WARNING + depends on BT_BLUEDROID_ENABLED && !BT_STACK_NO_LOG help Define BT trace level for APPL layer - config APPL_TRACE_LEVEL_NONE + config BT_LOG_APPL_TRACE_LEVEL_NONE bool "NONE" - config APPL_TRACE_LEVEL_ERROR + config BT_LOG_APPL_TRACE_LEVEL_ERROR bool "ERROR" - config APPL_TRACE_LEVEL_WARNING + config BT_LOG_APPL_TRACE_LEVEL_WARNING bool "WARNING" - config APPL_TRACE_LEVEL_API + config BT_LOG_APPL_TRACE_LEVEL_API bool "API" - config APPL_TRACE_LEVEL_EVENT + config BT_LOG_APPL_TRACE_LEVEL_EVENT bool "EVENT" - config APPL_TRACE_LEVEL_DEBUG + config BT_LOG_APPL_TRACE_LEVEL_DEBUG bool "DEBUG" - config APPL_TRACE_LEVEL_VERBOSE + config BT_LOG_APPL_TRACE_LEVEL_VERBOSE bool "VERBOSE" endchoice - config APPL_INITIAL_TRACE_LEVEL + config BT_LOG_APPL_TRACE_LEVEL int - depends on BLUEDROID_ENABLED - default 0 if APPL_TRACE_LEVEL_NONE - default 1 if APPL_TRACE_LEVEL_ERROR - default 2 if APPL_TRACE_LEVEL_WARNING - default 3 if APPL_TRACE_LEVEL_API - default 4 if APPL_TRACE_LEVEL_EVENT - default 5 if APPL_TRACE_LEVEL_DEBUG - default 6 if APPL_TRACE_LEVEL_VERBOSE + depends on BT_BLUEDROID_ENABLED + default 0 if BT_LOG_APPL_TRACE_LEVEL_NONE + default 1 if BT_LOG_APPL_TRACE_LEVEL_ERROR + default 2 if BT_LOG_APPL_TRACE_LEVEL_WARNING + default 3 if BT_LOG_APPL_TRACE_LEVEL_API + default 4 if BT_LOG_APPL_TRACE_LEVEL_EVENT + default 5 if BT_LOG_APPL_TRACE_LEVEL_DEBUG + default 6 if BT_LOG_APPL_TRACE_LEVEL_VERBOSE default 2 - choice GATT_INITIAL_TRACE_LEVEL + choice BT_LOG_GATT_TRACE_LEVEL prompt "GATT layer" - default GATT_TRACE_LEVEL_WARNING - depends on BLUEDROID_ENABLED && !BT_STACK_NO_LOG + default BT_LOG_GATT_TRACE_LEVEL_WARNING + depends on BT_BLUEDROID_ENABLED && !BT_STACK_NO_LOG help Define BT trace level for GATT layer - config GATT_TRACE_LEVEL_NONE + config BT_LOG_GATT_TRACE_LEVEL_NONE bool "NONE" - config GATT_TRACE_LEVEL_ERROR + config BT_LOG_GATT_TRACE_LEVEL_ERROR bool "ERROR" - config GATT_TRACE_LEVEL_WARNING + config BT_LOG_GATT_TRACE_LEVEL_WARNING bool "WARNING" - config GATT_TRACE_LEVEL_API + config BT_LOG_GATT_TRACE_LEVEL_API bool "API" - config GATT_TRACE_LEVEL_EVENT + config BT_LOG_GATT_TRACE_LEVEL_EVENT bool "EVENT" - config GATT_TRACE_LEVEL_DEBUG + config BT_LOG_GATT_TRACE_LEVEL_DEBUG bool "DEBUG" - config GATT_TRACE_LEVEL_VERBOSE + config BT_LOG_GATT_TRACE_LEVEL_VERBOSE bool "VERBOSE" endchoice - config GATT_INITIAL_TRACE_LEVEL + config BT_LOG_GATT_TRACE_LEVEL int - depends on BLUEDROID_ENABLED - default 0 if GATT_TRACE_LEVEL_NONE - default 1 if GATT_TRACE_LEVEL_ERROR - default 2 if GATT_TRACE_LEVEL_WARNING - default 3 if GATT_TRACE_LEVEL_API - default 4 if GATT_TRACE_LEVEL_EVENT - default 5 if GATT_TRACE_LEVEL_DEBUG - default 6 if GATT_TRACE_LEVEL_VERBOSE + depends on BT_BLUEDROID_ENABLED + default 0 if BT_LOG_GATT_TRACE_LEVEL_NONE + default 1 if BT_LOG_GATT_TRACE_LEVEL_ERROR + default 2 if BT_LOG_GATT_TRACE_LEVEL_WARNING + default 3 if BT_LOG_GATT_TRACE_LEVEL_API + default 4 if BT_LOG_GATT_TRACE_LEVEL_EVENT + default 5 if BT_LOG_GATT_TRACE_LEVEL_DEBUG + default 6 if BT_LOG_GATT_TRACE_LEVEL_VERBOSE default 2 - choice SMP_INITIAL_TRACE_LEVEL + choice BT_LOG_SMP_TRACE_LEVEL prompt "SMP layer" - default SMP_TRACE_LEVEL_WARNING - depends on BLUEDROID_ENABLED && !BT_STACK_NO_LOG + default BT_LOG_SMP_TRACE_LEVEL_WARNING + depends on BT_BLUEDROID_ENABLED && !BT_STACK_NO_LOG help Define BT trace level for SMP layer - config SMP_TRACE_LEVEL_NONE + config BT_LOG_SMP_TRACE_LEVEL_NONE bool "NONE" - config SMP_TRACE_LEVEL_ERROR + config BT_LOG_SMP_TRACE_LEVEL_ERROR bool "ERROR" - config SMP_TRACE_LEVEL_WARNING + config BT_LOG_SMP_TRACE_LEVEL_WARNING bool "WARNING" - config SMP_TRACE_LEVEL_API + config BT_LOG_SMP_TRACE_LEVEL_API bool "API" - config SMP_TRACE_LEVEL_EVENT + config BT_LOG_SMP_TRACE_LEVEL_EVENT bool "EVENT" - config SMP_TRACE_LEVEL_DEBUG + config BT_LOG_SMP_TRACE_LEVEL_DEBUG bool "DEBUG" - config SMP_TRACE_LEVEL_VERBOSE + config BT_LOG_SMP_TRACE_LEVEL_VERBOSE bool "VERBOSE" endchoice - config SMP_INITIAL_TRACE_LEVEL + config BT_LOG_SMP_TRACE_LEVEL int - depends on BLUEDROID_ENABLED - default 0 if SMP_TRACE_LEVEL_NONE - default 1 if SMP_TRACE_LEVEL_ERROR - default 2 if SMP_TRACE_LEVEL_WARNING - default 3 if SMP_TRACE_LEVEL_API - default 4 if SMP_TRACE_LEVEL_EVENT - default 5 if SMP_TRACE_LEVEL_DEBUG - default 6 if SMP_TRACE_LEVEL_VERBOSE + depends on BT_BLUEDROID_ENABLED + default 0 if BT_LOG_SMP_TRACE_LEVEL_NONE + default 1 if BT_LOG_SMP_TRACE_LEVEL_ERROR + default 2 if BT_LOG_SMP_TRACE_LEVEL_WARNING + default 3 if BT_LOG_SMP_TRACE_LEVEL_API + default 4 if BT_LOG_SMP_TRACE_LEVEL_EVENT + default 5 if BT_LOG_SMP_TRACE_LEVEL_DEBUG + default 6 if BT_LOG_SMP_TRACE_LEVEL_VERBOSE default 2 - choice BTIF_INITIAL_TRACE_LEVEL + choice BT_LOG_BTIF_TRACE_LEVEL prompt "BTIF layer" - default BTIF_TRACE_LEVEL_WARNING - depends on BLUEDROID_ENABLED && !BT_STACK_NO_LOG + default BT_LOG_BTIF_TRACE_LEVEL_WARNING + depends on BT_BLUEDROID_ENABLED && !BT_STACK_NO_LOG help Define BT trace level for BTIF layer - config BTIF_TRACE_LEVEL_NONE + config BT_LOG_BTIF_TRACE_LEVEL_NONE bool "NONE" - config BTIF_TRACE_LEVEL_ERROR + config BT_LOG_BTIF_TRACE_LEVEL_ERROR bool "ERROR" - config BTIF_TRACE_LEVEL_WARNING + config BT_LOG_BTIF_TRACE_LEVEL_WARNING bool "WARNING" - config BTIF_TRACE_LEVEL_API + config BT_LOG_BTIF_TRACE_LEVEL_API bool "API" - config BTIF_TRACE_LEVEL_EVENT + config BT_LOG_BTIF_TRACE_LEVEL_EVENT bool "EVENT" - config BTIF_TRACE_LEVEL_DEBUG + config BT_LOG_BTIF_TRACE_LEVEL_DEBUG bool "DEBUG" - config BTIF_TRACE_LEVEL_VERBOSE + config BT_LOG_BTIF_TRACE_LEVEL_VERBOSE bool "VERBOSE" endchoice - config BTIF_INITIAL_TRACE_LEVEL + config BT_LOG_BTIF_TRACE_LEVEL int - depends on BLUEDROID_ENABLED - default 0 if BTIF_TRACE_LEVEL_NONE - default 1 if BTIF_TRACE_LEVEL_ERROR - default 2 if BTIF_TRACE_LEVEL_WARNING - default 3 if BTIF_TRACE_LEVEL_API - default 4 if BTIF_TRACE_LEVEL_EVENT - default 5 if BTIF_TRACE_LEVEL_DEBUG - default 6 if BTIF_TRACE_LEVEL_VERBOSE + depends on BT_BLUEDROID_ENABLED + default 0 if BT_LOG_BTIF_TRACE_LEVEL_NONE + default 1 if BT_LOG_BTIF_TRACE_LEVEL_ERROR + default 2 if BT_LOG_BTIF_TRACE_LEVEL_WARNING + default 3 if BT_LOG_BTIF_TRACE_LEVEL_API + default 4 if BT_LOG_BTIF_TRACE_LEVEL_EVENT + default 5 if BT_LOG_BTIF_TRACE_LEVEL_DEBUG + default 6 if BT_LOG_BTIF_TRACE_LEVEL_VERBOSE default 2 - choice BTC_INITIAL_TRACE_LEVEL + choice BT_LOG_BTC_TRACE_LEVEL prompt "BTC layer" - default BTC_TRACE_LEVEL_WARNING - depends on BLUEDROID_ENABLED && !BT_STACK_NO_LOG + default BT_LOG_BTC_TRACE_LEVEL_WARNING + depends on BT_BLUEDROID_ENABLED && !BT_STACK_NO_LOG help Define BT trace level for BTC layer - config BTC_TRACE_LEVEL_NONE + config BT_LOG_BTC_TRACE_LEVEL_NONE bool "NONE" - config BTC_TRACE_LEVEL_ERROR + config BT_LOG_BTC_TRACE_LEVEL_ERROR bool "ERROR" - config BTC_TRACE_LEVEL_WARNING + config BT_LOG_BTC_TRACE_LEVEL_WARNING bool "WARNING" - config BTC_TRACE_LEVEL_API + config BT_LOG_BTC_TRACE_LEVEL_API bool "API" - config BTC_TRACE_LEVEL_EVENT + config BT_LOG_BTC_TRACE_LEVEL_EVENT bool "EVENT" - config BTC_TRACE_LEVEL_DEBUG + config BT_LOG_BTC_TRACE_LEVEL_DEBUG bool "DEBUG" - config BTC_TRACE_LEVEL_VERBOSE + config BT_LOG_BTC_TRACE_LEVEL_VERBOSE bool "VERBOSE" endchoice - config BTC_INITIAL_TRACE_LEVEL + config BT_LOG_BTC_TRACE_LEVEL int - depends on BLUEDROID_ENABLED - default 0 if BTC_TRACE_LEVEL_NONE - default 1 if BTC_TRACE_LEVEL_ERROR - default 2 if BTC_TRACE_LEVEL_WARNING - default 3 if BTC_TRACE_LEVEL_API - default 4 if BTC_TRACE_LEVEL_EVENT - default 5 if BTC_TRACE_LEVEL_DEBUG - default 6 if BTC_TRACE_LEVEL_VERBOSE + depends on BT_BLUEDROID_ENABLED + default 0 if BT_LOG_BTC_TRACE_LEVEL_NONE + default 1 if BT_LOG_BTC_TRACE_LEVEL_ERROR + default 2 if BT_LOG_BTC_TRACE_LEVEL_WARNING + default 3 if BT_LOG_BTC_TRACE_LEVEL_API + default 4 if BT_LOG_BTC_TRACE_LEVEL_EVENT + default 5 if BT_LOG_BTC_TRACE_LEVEL_DEBUG + default 6 if BT_LOG_BTC_TRACE_LEVEL_VERBOSE default 2 - choice OSI_INITIAL_TRACE_LEVEL + choice BT_LOG_OSI_TRACE_LEVEL prompt "OSI layer" - default OSI_TRACE_LEVEL_WARNING - depends on BLUEDROID_ENABLED && !BT_STACK_NO_LOG + default BT_LOG_OSI_TRACE_LEVEL_WARNING + depends on BT_BLUEDROID_ENABLED && !BT_STACK_NO_LOG help Define BT trace level for OSI layer - config OSI_TRACE_LEVEL_NONE + config BT_LOG_OSI_TRACE_LEVEL_NONE bool "NONE" - config OSI_TRACE_LEVEL_ERROR + config BT_LOG_OSI_TRACE_LEVEL_ERROR bool "ERROR" - config OSI_TRACE_LEVEL_WARNING + config BT_LOG_OSI_TRACE_LEVEL_WARNING bool "WARNING" - config OSI_TRACE_LEVEL_API + config BT_LOG_OSI_TRACE_LEVEL_API bool "API" - config OSI_TRACE_LEVEL_EVENT + config BT_LOG_OSI_TRACE_LEVEL_EVENT bool "EVENT" - config OSI_TRACE_LEVEL_DEBUG + config BT_LOG_OSI_TRACE_LEVEL_DEBUG bool "DEBUG" - config OSI_TRACE_LEVEL_VERBOSE + config BT_LOG_OSI_TRACE_LEVEL_VERBOSE bool "VERBOSE" endchoice - config OSI_INITIAL_TRACE_LEVEL + config BT_LOG_OSI_TRACE_LEVEL int - depends on BLUEDROID_ENABLED - default 0 if OSI_TRACE_LEVEL_NONE - default 1 if OSI_TRACE_LEVEL_ERROR - default 2 if OSI_TRACE_LEVEL_WARNING - default 3 if OSI_TRACE_LEVEL_API - default 4 if OSI_TRACE_LEVEL_EVENT - default 5 if OSI_TRACE_LEVEL_DEBUG - default 6 if OSI_TRACE_LEVEL_VERBOSE + depends on BT_BLUEDROID_ENABLED + default 0 if BT_LOG_OSI_TRACE_LEVEL_NONE + default 1 if BT_LOG_OSI_TRACE_LEVEL_ERROR + default 2 if BT_LOG_OSI_TRACE_LEVEL_WARNING + default 3 if BT_LOG_OSI_TRACE_LEVEL_API + default 4 if BT_LOG_OSI_TRACE_LEVEL_EVENT + default 5 if BT_LOG_OSI_TRACE_LEVEL_DEBUG + default 6 if BT_LOG_OSI_TRACE_LEVEL_VERBOSE default 2 - choice BLUFI_INITIAL_TRACE_LEVEL + choice BT_LOG_BLUFI_TRACE_LEVEL prompt "BLUFI layer" - default BLUFI_TRACE_LEVEL_WARNING - depends on BLUEDROID_ENABLED && !BT_STACK_NO_LOG + default BT_LOG_BLUFI_TRACE_LEVEL_WARNING + depends on BT_BLUEDROID_ENABLED && !BT_STACK_NO_LOG help Define BT trace level for BLUFI layer - config BLUFI_TRACE_LEVEL_NONE + config BT_LOG_BLUFI_TRACE_LEVEL_NONE bool "NONE" - config BLUFI_TRACE_LEVEL_ERROR + config BT_LOG_BLUFI_TRACE_LEVEL_ERROR bool "ERROR" - config BLUFI_TRACE_LEVEL_WARNING + config BT_LOG_BLUFI_TRACE_LEVEL_WARNING bool "WARNING" - config BLUFI_TRACE_LEVEL_API + config BT_LOG_BLUFI_TRACE_LEVEL_API bool "API" - config BLUFI_TRACE_LEVEL_EVENT + config BT_LOG_BLUFI_TRACE_LEVEL_EVENT bool "EVENT" - config BLUFI_TRACE_LEVEL_DEBUG + config BT_LOG_BLUFI_TRACE_LEVEL_DEBUG bool "DEBUG" - config BLUFI_TRACE_LEVEL_VERBOSE + config BT_LOG_BLUFI_TRACE_LEVEL_VERBOSE bool "VERBOSE" endchoice - config BLUFI_INITIAL_TRACE_LEVEL + config BT_LOG_BLUFI_TRACE_LEVEL int - depends on BLUEDROID_ENABLED - default 0 if BLUFI_TRACE_LEVEL_NONE - default 1 if BLUFI_TRACE_LEVEL_ERROR - default 2 if BLUFI_TRACE_LEVEL_WARNING - default 3 if BLUFI_TRACE_LEVEL_API - default 4 if BLUFI_TRACE_LEVEL_EVENT - default 5 if BLUFI_TRACE_LEVEL_DEBUG - default 6 if BLUFI_TRACE_LEVEL_VERBOSE + depends on BT_BLUEDROID_ENABLED + default 0 if BT_LOG_BLUFI_TRACE_LEVEL_NONE + default 1 if BT_LOG_BLUFI_TRACE_LEVEL_ERROR + default 2 if BT_LOG_BLUFI_TRACE_LEVEL_WARNING + default 3 if BT_LOG_BLUFI_TRACE_LEVEL_API + default 4 if BT_LOG_BLUFI_TRACE_LEVEL_EVENT + default 5 if BT_LOG_BLUFI_TRACE_LEVEL_DEBUG + default 6 if BT_LOG_BLUFI_TRACE_LEVEL_VERBOSE default 2 endmenu #BT DEBUG LOG LEVEL @@ -1219,7 +1219,7 @@ menu Bluetooth config BT_ACL_CONNECTIONS int "BT/BLE MAX ACL CONNECTIONS(1~7)" - depends on BLUEDROID_ENABLED + depends on BT_BLUEDROID_ENABLED range 1 7 default 4 help @@ -1227,35 +1227,35 @@ menu Bluetooth config BT_ALLOCATION_FROM_SPIRAM_FIRST bool "BT/BLE will first malloc the memory from the PSRAM" - depends on BLUEDROID_ENABLED + depends on BT_BLUEDROID_ENABLED default n help This select can save the internal RAM if there have the PSRAM config BT_BLE_DYNAMIC_ENV_MEMORY bool "Use dynamic memory allocation in BT/BLE stack" - depends on BLUEDROID_ENABLED + depends on BT_BLUEDROID_ENABLED default n help This select can make the allocation of memory will become more flexible - config BLE_HOST_QUEUE_CONGESTION_CHECK + config BT_BLE_HOST_QUEUE_CONG_CHECK bool "BLE queue congestion check" - depends on BLUEDROID_ENABLED + depends on BT_BLUEDROID_ENABLED default n help When scanning and scan duplicate is not enabled, if there are a lot of adv packets around or application layer handling adv packets is slow, it will cause the controller memory to run out. if enabled, adv packets will be lost when host queue is congested. - config SMP_ENABLE + config BT_SMP_ENABLE bool - depends on BLUEDROID_ENABLED - default CLASSIC_BT_ENABLED || BLE_SMP_ENABLE + depends on BT_BLUEDROID_ENABLED + default BT_CLASSIC_ENABLED || BT_BLE_SMP_ENABLE - config BLE_ACTIVE_SCAN_REPORT_ADV_SCAN_RSP_INDIVIDUALLY + config BT_BLE_ACT_SCAN_REP_ADV_SCAN bool "Report adv data and scan response individually when BLE active scan" - depends on BLUEDROID_ENABLED && (BTDM_CONTROLLER_MODE_BTDM || BTDM_CONTROLLER_MODE_BLE_ONLY) + depends on BT_BLUEDROID_ENABLED && (BTDM_CTRL_MODE_BTDM || BTDM_CTRL_MODE_BLE_ONLY) default n help Originally, when doing BLE active scan, Bluedroid will not report adv to application layer @@ -1264,9 +1264,9 @@ menu Bluetooth # Memory reserved at start of DRAM for Bluetooth stack - config BLE_ESTABLISH_LINK_CONNECTION_TIMEOUT + config BT_BLE_ESTAB_LINK_CONN_TOUT int "Timeout of BLE connection establishment" - depends on BLUEDROID_ENABLED + depends on BT_BLUEDROID_ENABLED range 1 60 default 30 help diff --git a/components/bt/bluedroid/api/esp_bt_main.c b/components/bt/bluedroid/api/esp_bt_main.c index 8aff98e8b..1620ae9d8 100644 --- a/components/bt/bluedroid/api/esp_bt_main.c +++ b/components/bt/bluedroid/api/esp_bt_main.c @@ -128,7 +128,7 @@ esp_err_t esp_bluedroid_init(void) return ESP_ERR_INVALID_STATE; } -#ifdef CONFIG_BLUEDROID_MEM_DEBUG +#ifdef CONFIG_BT_BLUEDROID_MEM_DEBUG osi_mem_dbg_init(); #endif diff --git a/components/bt/bluedroid/btc/core/btc_task.c b/components/bt/bluedroid/btc/core/btc_task.c index 338d6841f..86d2b4a63 100644 --- a/components/bt/bluedroid/btc/core/btc_task.c +++ b/components/bt/bluedroid/btc/core/btc_task.c @@ -30,7 +30,7 @@ #include "btc/btc_dm.h" #include "btc/btc_alarm.h" #include "bta/bta_gatt_api.h" -#if CONFIG_CLASSIC_BT_ENABLED +#if CONFIG_BT_CLASSIC_ENABLED #include "btc/btc_profile_queue.h" #if (BTC_GAP_BT_INCLUDED == TRUE) #include "btc_gap_bt.h" @@ -45,7 +45,7 @@ #if BTC_HF_CLIENT_INCLUDED #include "btc_hf_client.h" #endif /* #if BTC_HF_CLIENT_INCLUDED */ -#endif /* #if CONFIG_CLASSIC_BT_ENABLED */ +#endif /* #if CONFIG_BT_CLASSIC_ENABLED */ static xTaskHandle xBtcTaskHandle = NULL; @@ -71,7 +71,7 @@ static btc_func_t profile_tab[BTC_PID_NUM] = { #endif ///GATTS_INCLUDED == TRUE [BTC_PID_DM_SEC] = {NULL, btc_dm_sec_cb_handler }, [BTC_PID_ALARM] = {btc_alarm_handler, NULL }, -#if CONFIG_CLASSIC_BT_ENABLED +#if CONFIG_BT_CLASSIC_ENABLED #if (BTC_GAP_BT_INCLUDED == TRUE) [BTC_PID_GAP_BT] = {btc_gap_bt_call_handler, btc_gap_bt_cb_handler }, #endif /* (BTC_GAP_BT_INCLUDED == TRUE) */ @@ -87,7 +87,7 @@ static btc_func_t profile_tab[BTC_PID_NUM] = { #if BTC_HF_CLIENT_INCLUDED [BTC_PID_HF_CLIENT] = {btc_hf_client_call_handler, btc_hf_client_cb_handler}, #endif /* #if BTC_HF_CLIENT_INCLUDED */ -#endif /* #if CONFIG_CLASSIC_BT_ENABLED */ +#endif /* #if CONFIG_BT_CLASSIC_ENABLED */ }; /***************************************************************************** diff --git a/components/bt/bluedroid/btc/include/btc/btc_task.h b/components/bt/bluedroid/btc/include/btc/btc_task.h index ca5abd375..2ea76c177 100644 --- a/components/bt/bluedroid/btc/include/btc/btc_task.h +++ b/components/bt/bluedroid/btc/include/btc/btc_task.h @@ -53,7 +53,7 @@ typedef enum { BTC_PID_BLUFI, BTC_PID_DM_SEC, BTC_PID_ALARM, -#if CONFIG_CLASSIC_BT_ENABLED +#if CONFIG_BT_CLASSIC_ENABLED BTC_PID_GAP_BT, BTC_PID_PRF_QUE, BTC_PID_A2DP, @@ -63,7 +63,7 @@ typedef enum { #if BTC_HF_CLIENT_INCLUDED BTC_PID_HF_CLIENT, #endif /* BTC_HF_CLIENT_INCLUDED */ -#endif /* CONFIG_CLASSIC_BT_ENABLED */ +#endif /* CONFIG_BT_CLASSIC_ENABLED */ BTC_PID_NUM, } btc_pid_t; //btc profile id diff --git a/components/bt/bluedroid/btc/profile/std/hf_client/btc_hf_client.c b/components/bt/bluedroid/btc/profile/std/hf_client/btc_hf_client.c index a4fabfecd..3ae296cf0 100644 --- a/components/bt/bluedroid/btc/profile/std/hf_client/btc_hf_client.c +++ b/components/bt/bluedroid/btc/profile/std/hf_client/btc_hf_client.c @@ -174,7 +174,7 @@ bt_status_t btc_hf_client_init(void) btc_hf_client_cb.initialized = true; -#if CONFIG_HFP_AUDIO_DATA_PATH_HCI +#if CONFIG_BT_HFP_AUDIO_DATA_PATH_HCI data_path = ESP_SCO_DATA_PATH_HCI; #else data_path = ESP_SCO_DATA_PATH_PCM; diff --git a/components/bt/bluedroid/common/include/common/bt_target.h b/components/bt/bluedroid/common/include/common/bt_target.h index 7f7027fb9..98dbe7a16 100644 --- a/components/bt/bluedroid/common/include/common/bt_target.h +++ b/components/bt/bluedroid/common/include/common/bt_target.h @@ -44,7 +44,7 @@ ** Classic BT features ** ******************************************************************************/ -#if CONFIG_CLASSIC_BT_ENABLED +#if CONFIG_BT_CLASSIC_ENABLED #define CLASSIC_BT_INCLUDED TRUE #define BTC_SM_INCLUDED TRUE #define BTC_PRF_QUEUE_INCLUDED TRUE @@ -53,7 +53,7 @@ #define BTA_DM_PM_INCLUDED TRUE #define SDP_INCLUDED TRUE -#if CONFIG_A2DP_ENABLE +#if CONFIG_BT_A2DP_ENABLE #define BTA_AR_INCLUDED TRUE #define BTA_AV_INCLUDED TRUE #define AVDT_INCLUDED TRUE @@ -66,7 +66,7 @@ #define SBC_DEC_INCLUDED TRUE #define BTC_AV_SRC_INCLUDED TRUE #define SBC_ENC_INCLUDED TRUE -#endif /* CONFIG_A2DP_ENABLE */ +#endif /* CONFIG_BT_A2DP_ENABLE */ #if CONFIG_BT_SPP_ENABLED #define RFCOMM_INCLUDED TRUE @@ -74,7 +74,7 @@ #define BTC_SPP_INCLUDED TRUE #endif /* CONFIG_BT_SPP_ENABLED */ -#if CONFIG_HFP_CLIENT_ENABLE +#if CONFIG_BT_HFP_CLIENT_ENABLE #define BTC_HF_CLIENT_INCLUDED TRUE #define BTA_HF_INCLUDED TRUE #ifndef RFCOMM_INCLUDED @@ -92,49 +92,49 @@ #define BT_SSP_INCLUDED TRUE #endif /* CONFIG_BT_SSP_ENABLED */ -#endif /* #if CONFIG_CLASSIC_BT_ENABLED */ +#endif /* #if CONFIG_BT_CLASSIC_ENABLED */ #ifndef CLASSIC_BT_INCLUDED #define CLASSIC_BT_INCLUDED FALSE #endif /* CLASSIC_BT_INCLUDED */ -#ifndef CONFIG_GATTC_CACHE_NVS_FLASH -#define CONFIG_GATTC_CACHE_NVS_FLASH FALSE -#endif /* CONFIG_GATTC_CACHE_NVS_FLASH */ +#ifndef CONFIG_BT_GATTC_CACHE_NVS_FLASH +#define CONFIG_BT_GATTC_CACHE_NVS_FLASH FALSE +#endif /* CONFIG_BT_GATTC_CACHE_NVS_FLASH */ /****************************************************************************** ** ** BLE features ** ******************************************************************************/ -#if (CONFIG_GATTS_ENABLE) +#if (CONFIG_BT_GATTS_ENABLE) #define GATTS_INCLUDED TRUE #else #define GATTS_INCLUDED FALSE -#endif /* CONFIG_GATTS_ENABLE */ +#endif /* CONFIG_BT_GATTS_ENABLE */ -#if (CONFIG_GATTC_ENABLE) +#if (CONFIG_BT_GATTC_ENABLE) #define GATTC_INCLUDED TRUE #else #define GATTC_INCLUDED FALSE -#endif /* CONFIG_GATTC_ENABLE */ +#endif /* CONFIG_BT_GATTC_ENABLE */ -#if (CONFIG_GATTC_ENABLE && CONFIG_GATTC_CACHE_NVS_FLASH) +#if (CONFIG_BT_GATTC_ENABLE && CONFIG_BT_GATTC_CACHE_NVS_FLASH) #define GATTC_CACHE_NVS TRUE #else #define GATTC_CACHE_NVS FALSE -#endif /* CONFIG_GATTC_CACHE_NVS_FLASH */ +#endif /* CONFIG_BT_GATTC_CACHE_NVS_FLASH */ -#if (CONFIG_SMP_ENABLE) +#if (CONFIG_BT_SMP_ENABLE) #define SMP_INCLUDED TRUE #define BLE_PRIVACY_SPT TRUE #else #define SMP_INCLUDED FALSE #define BLE_PRIVACY_SPT FALSE -#endif /* CONFIG_SMP_ENABLE */ +#endif /* CONFIG_BT_SMP_ENABLE */ -#ifdef CONFIG_SMP_SLAVE_CON_PARAMS_UPD_ENABLE -#if(CONFIG_SMP_SLAVE_CON_PARAMS_UPD_ENABLE) +#ifdef CONFIG_BT_SMP_SLAVE_CON_PARAMS_UPD_ENABLE +#if(CONFIG_BT_SMP_SLAVE_CON_PARAMS_UPD_ENABLE) #define SMP_SLAVE_CON_PARAMS_UPD_ENABLE TRUE #else #define SMP_SLAVE_CON_PARAMS_UPD_ENABLE FALSE @@ -143,31 +143,31 @@ #define SMP_SLAVE_CON_PARAMS_UPD_ENABLE FALSE #endif -#ifndef CONFIG_BLE_ADV_REPORT_FLOW_CONTROL_SUPPORTED +#ifndef CONFIG_BTDM_BLE_ADV_REPORT_FLOW_CTRL_SUPP #define BLE_ADV_REPORT_FLOW_CONTROL FALSE #else -#define BLE_ADV_REPORT_FLOW_CONTROL CONFIG_BLE_ADV_REPORT_FLOW_CONTROL_SUPPORTED -#endif /* CONFIG_BLE_ADV_REPORT_FLOW_CONTROL_SUPPORTED */ +#define BLE_ADV_REPORT_FLOW_CONTROL CONFIG_BTDM_BLE_ADV_REPORT_FLOW_CTRL_SUPP +#endif /* CONFIG_BTDM_BLE_ADV_REPORT_FLOW_CTRL_SUPP */ -#ifndef CONFIG_BLE_ADV_REPORT_FLOW_CONTROL_NUM +#ifndef CONFIG_BTDM_BLE_ADV_REPORT_FLOW_CTRL_NUM #define BLE_ADV_REPORT_FLOW_CONTROL_NUM 100 #else -#define BLE_ADV_REPORT_FLOW_CONTROL_NUM CONFIG_BLE_ADV_REPORT_FLOW_CONTROL_NUM -#endif /* CONFIG_BLE_ADV_REPORT_FLOW_CONTROL_NUM */ +#define BLE_ADV_REPORT_FLOW_CONTROL_NUM CONFIG_BTDM_BLE_ADV_REPORT_FLOW_CTRL_NUM +#endif /* CONFIG_BTDM_BLE_ADV_REPORT_FLOW_CTRL_NUM */ -#ifndef CONFIG_BLE_ADV_REPORT_DISCARD_THRSHOLD +#ifndef CONFIG_BTDM_BLE_ADV_REPORT_DISCARD_THRSHOLD #define BLE_ADV_REPORT_DISCARD_THRSHOLD 20 #else -#define BLE_ADV_REPORT_DISCARD_THRSHOLD CONFIG_BLE_ADV_REPORT_DISCARD_THRSHOLD -#endif /* CONFIG_BLE_ADV_REPORT_DISCARD_THRSHOLD */ +#define BLE_ADV_REPORT_DISCARD_THRSHOLD CONFIG_BTDM_BLE_ADV_REPORT_DISCARD_THRSHOLD +#endif /* CONFIG_BTDM_BLE_ADV_REPORT_DISCARD_THRSHOLD */ #if (CONFIG_BT_ACL_CONNECTIONS) #define MAX_ACL_CONNECTIONS CONFIG_BT_ACL_CONNECTIONS #define GATT_MAX_PHY_CHANNEL CONFIG_BT_ACL_CONNECTIONS #endif /* CONFIG_BT_ACL_CONNECTIONS */ -#if(CONFIG_BLE_ESTABLISH_LINK_CONNECTION_TIMEOUT) -#define BLE_ESTABLISH_LINK_CONNECTION_TIMEOUT CONFIG_BLE_ESTABLISH_LINK_CONNECTION_TIMEOUT +#if(CONFIG_BT_BLE_ESTAB_LINK_CONN_TOUT) +#define BLE_ESTABLISH_LINK_CONNECTION_TIMEOUT CONFIG_BT_BLE_ESTAB_LINK_CONN_TOUT #else #define BLE_ESTABLISH_LINK_CONNECTION_TIMEOUT 30 #endif @@ -349,22 +349,22 @@ #define QUEUE_CONGEST_SIZE 40 #endif -#ifndef CONFIG_BLE_HOST_QUEUE_CONGESTION_CHECK +#ifndef CONFIG_BT_BLE_HOST_QUEUE_CONG_CHECK #define SCAN_QUEUE_CONGEST_CHECK FALSE #else -#define SCAN_QUEUE_CONGEST_CHECK CONFIG_BLE_HOST_QUEUE_CONGESTION_CHECK +#define SCAN_QUEUE_CONGEST_CHECK CONFIG_BT_BLE_HOST_QUEUE_CONG_CHECK #endif -#ifndef CONFIG_GATTS_SEND_SERVICE_CHANGE_MODE +#ifndef CONFIG_BT_GATTS_SEND_SERVICE_CHANGE_MODE #define GATTS_SEND_SERVICE_CHANGE_MODE GATTS_SEND_SERVICE_CHANGE_AUTO #else -#define GATTS_SEND_SERVICE_CHANGE_MODE CONFIG_GATTS_SEND_SERVICE_CHANGE_MODE +#define GATTS_SEND_SERVICE_CHANGE_MODE CONFIG_BT_GATTS_SEND_SERVICE_CHANGE_MODE #endif -#ifndef CONFIG_BLE_ACTIVE_SCAN_REPORT_ADV_SCAN_RSP_INDIVIDUALLY +#ifndef CONFIG_BT_BLE_ACT_SCAN_REP_ADV_SCAN #define BTM_BLE_ACTIVE_SCAN_REPORT_ADV_SCAN_RSP_INDIVIDUALLY FALSE #else -#define BTM_BLE_ACTIVE_SCAN_REPORT_ADV_SCAN_RSP_INDIVIDUALLY CONFIG_BLE_ACTIVE_SCAN_REPORT_ADV_SCAN_RSP_INDIVIDUALLY +#define BTM_BLE_ACTIVE_SCAN_REPORT_ADV_SCAN_RSP_INDIVIDUALLY CONFIG_BT_BLE_ACT_SCAN_REP_ADV_SCAN #endif /* This feature is used to eanble interleaved scan*/ @@ -582,11 +582,11 @@ /* Includes SCO if TRUE */ #ifndef BTM_SCO_HCI_INCLUDED -#if CONFIG_HFP_AUDIO_DATA_PATH_HCI +#if CONFIG_BT_HFP_AUDIO_DATA_PATH_HCI #define BTM_SCO_HCI_INCLUDED TRUE /* TRUE includes SCO over HCI code */ #else #define BTM_SCO_HCI_INCLUDED FALSE -#endif /* CONFIG_HFP_AUDIO_DATA_PATH_HCI */ +#endif /* CONFIG_BT_HFP_AUDIO_DATA_PATH_HCI */ #endif /* Includes WBS if TRUE */ diff --git a/components/bt/bluedroid/common/include/common/bt_trace.h b/components/bt/bluedroid/common/include/common/bt_trace.h index 0cda79f3a..7c4f25a51 100644 --- a/components/bt/bluedroid/common/include/common/bt_trace.h +++ b/components/bt/bluedroid/common/include/common/bt_trace.h @@ -217,26 +217,26 @@ inline void trc_dump_buffer(const char *prefix, uint8_t *data, uint16_t len) // btla-specific ++ /* Core Stack default trace levels */ -#ifdef CONFIG_HCI_INITIAL_TRACE_LEVEL -#define HCI_INITIAL_TRACE_LEVEL CONFIG_HCI_INITIAL_TRACE_LEVEL +#ifdef CONFIG_BT_LOG_HCI_TRACE_LEVEL +#define HCI_INITIAL_TRACE_LEVEL CONFIG_BT_LOG_HCI_TRACE_LEVEL #else #define HCI_INITIAL_TRACE_LEVEL BT_TRACE_LEVEL_WARNING #endif -#ifdef CONFIG_BTM_INITIAL_TRACE_LEVEL -#define BTM_INITIAL_TRACE_LEVEL CONFIG_BTM_INITIAL_TRACE_LEVEL +#ifdef CONFIG_BT_LOG_BTM_TRACE_LEVEL +#define BTM_INITIAL_TRACE_LEVEL CONFIG_BT_LOG_BTM_TRACE_LEVEL #else #define BTM_INITIAL_TRACE_LEVEL BT_TRACE_LEVEL_WARNING #endif -#ifdef CONFIG_L2CAP_INITIAL_TRACE_LEVEL -#define L2CAP_INITIAL_TRACE_LEVEL CONFIG_L2CAP_INITIAL_TRACE_LEVEL +#ifdef CONFIG_BT_LOG_L2CAP_TRACE_LEVEL +#define L2CAP_INITIAL_TRACE_LEVEL CONFIG_BT_LOG_L2CAP_TRACE_LEVEL #else #define L2CAP_INITIAL_TRACE_LEVEL BT_TRACE_LEVEL_WARNING #endif -#ifdef CONFIG_RFCOMM_INITIAL_TRACE_LEVEL -#define RFCOMM_INITIAL_TRACE_LEVEL CONFIG_RFCOMM_INITIAL_TRACE_LEVEL +#ifdef CONFIG_BT_LOG_RFCOMM_TRACE_LEVEL +#define RFCOMM_INITIAL_TRACE_LEVEL CONFIG_BT_LOG_RFCOMM_TRACE_LEVEL #else #define RFCOMM_INITIAL_TRACE_LEVEL BT_TRACE_LEVEL_WARNING #endif @@ -247,98 +247,98 @@ inline void trc_dump_buffer(const char *prefix, uint8_t *data, uint16_t len) #define SDP_INITIAL_TRACE_LEVEL BT_TRACE_LEVEL_WARNING #endif -#ifdef CONFIG_GAP_INITIAL_TRACE_LEVEL -#define GAP_INITIAL_TRACE_LEVEL CONFIG_GAP_INITIAL_TRACE_LEVEL +#ifdef CONFIG_BT_LOG_GAP_TRACE_LEVEL +#define GAP_INITIAL_TRACE_LEVEL CONFIG_BT_LOG_GAP_TRACE_LEVEL #else #define GAP_INITIAL_TRACE_LEVEL BT_TRACE_LEVEL_WARNING #endif -#ifdef CONFIG_BNEP_INITIAL_TRACE_LEVEL -#define BNEP_INITIAL_TRACE_LEVEL CONFIG_BNEP_INITIAL_TRACE_LEVEL +#ifdef CONFIG_BT_LOG_BNEP_TRACE_LEVEL +#define BNEP_INITIAL_TRACE_LEVEL CONFIG_BT_LOG_BNEP_TRACE_LEVEL #else #define BNEP_INITIAL_TRACE_LEVEL BT_TRACE_LEVEL_WARNING #endif -#ifdef CONFIG_PAN_INITIAL_TRACE_LEVEL -#define PAN_INITIAL_TRACE_LEVEL CONFIG_PAN_INITIAL_TRACE_LEVEL +#ifdef CONFIG_BT_LOG_PAN_TRACE_LEVEL +#define PAN_INITIAL_TRACE_LEVEL CONFIG_BT_LOG_PAN_TRACE_LEVEL #else #define PAN_INITIAL_TRACE_LEVEL BT_TRACE_LEVEL_WARNING #endif -#ifdef CONFIG_A2D_INITIAL_TRACE_LEVEL -#define A2D_INITIAL_TRACE_LEVEL CONFIG_A2D_INITIAL_TRACE_LEVEL +#ifdef CONFIG_BT_LOG_A2D_TRACE_LEVEL +#define A2D_INITIAL_TRACE_LEVEL CONFIG_BT_LOG_A2D_TRACE_LEVEL #else #define A2D_INITIAL_TRACE_LEVEL BT_TRACE_LEVEL_WARNING #endif -#ifdef CONFIG_AVDT_INITIAL_TRACE_LEVEL -#define AVDT_INITIAL_TRACE_LEVEL CONFIG_AVDT_INITIAL_TRACE_LEVEL +#ifdef CONFIG_BT_LOG_AVDT_TRACE_LEVEL +#define AVDT_INITIAL_TRACE_LEVEL CONFIG_BT_LOG_AVDT_TRACE_LEVEL #else #define AVDT_INITIAL_TRACE_LEVEL BT_TRACE_LEVEL_WARNING #endif -#ifdef CONFIG_AVCT_INITIAL_TRACE_LEVEL -#define AVCT_INITIAL_TRACE_LEVEL CONFIG_AVCT_INITIAL_TRACE_LEVEL +#ifdef CONFIG_BT_LOG_AVCT_TRACE_LEVEL +#define AVCT_INITIAL_TRACE_LEVEL CONFIG_BT_LOG_AVCT_TRACE_LEVEL #else #define AVCT_INITIAL_TRACE_LEVEL BT_TRACE_LEVEL_WARNING #endif -#ifdef CONFIG_AVRC_INITIAL_TRACE_LEVEL -#define AVRC_INITIAL_TRACE_LEVEL CONFIG_AVRC_INITIAL_TRACE_LEVEL +#ifdef CONFIG_BT_LOG_AVRC_TRACE_LEVEL +#define AVRC_INITIAL_TRACE_LEVEL CONFIG_BT_LOG_AVRC_TRACE_LEVEL #else #define AVRC_INITIAL_TRACE_LEVEL BT_TRACE_LEVEL_WARNING #endif -#ifdef CONFIG_MCA_INITIAL_TRACE_LEVEL -#define MCA_INITIAL_TRACE_LEVEL CONFIG_MCA_INITIAL_TRACE_LEVEL +#ifdef CONFIG_BT_LOG_MCA_TRACE_LEVEL +#define MCA_INITIAL_TRACE_LEVEL CONFIG_BT_LOG_MCA_TRACE_LEVEL #else #define MCA_INITIAL_TRACE_LEVEL BT_TRACE_LEVEL_WARNING #endif -#ifdef CONFIG_HID_INITIAL_TRACE_LEVEL -#define HID_INITIAL_TRACE_LEVEL CONFIG_HID_INITIAL_TRACE_LEVEL +#ifdef CONFIG_BT_LOG_HID_TRACE_LEVEL +#define HID_INITIAL_TRACE_LEVEL CONFIG_BT_LOG_HID_TRACE_LEVEL #else #define HID_INITIAL_TRACE_LEVEL BT_TRACE_LEVEL_WARNING #endif -#ifdef CONFIG_APPL_INITIAL_TRACE_LEVEL -#define APPL_INITIAL_TRACE_LEVEL CONFIG_APPL_INITIAL_TRACE_LEVEL +#ifdef CONFIG_BT_LOG_APPL_TRACE_LEVEL +#define APPL_INITIAL_TRACE_LEVEL CONFIG_BT_LOG_APPL_TRACE_LEVEL #else #define APPL_INITIAL_TRACE_LEVEL BT_TRACE_LEVEL_WARNING #endif -#ifdef CONFIG_GATT_INITIAL_TRACE_LEVEL -#define GATT_INITIAL_TRACE_LEVEL CONFIG_GATT_INITIAL_TRACE_LEVEL +#ifdef CONFIG_BT_LOG_GATT_TRACE_LEVEL +#define GATT_INITIAL_TRACE_LEVEL CONFIG_BT_LOG_GATT_TRACE_LEVEL #else #define GATT_INITIAL_TRACE_LEVEL BT_TRACE_LEVEL_WARNING #endif -#ifdef CONFIG_SMP_INITIAL_TRACE_LEVEL -#define SMP_INITIAL_TRACE_LEVEL CONFIG_SMP_INITIAL_TRACE_LEVEL +#ifdef CONFIG_BT_LOG_SMP_TRACE_LEVEL +#define SMP_INITIAL_TRACE_LEVEL CONFIG_BT_LOG_SMP_TRACE_LEVEL #else #define SMP_INITIAL_TRACE_LEVEL BT_TRACE_LEVEL_WARNING #endif -#ifdef CONFIG_BTIF_INITIAL_TRACE_LEVEL -#define BTIF_INITIAL_TRACE_LEVEL CONFIG_BTIF_INITIAL_TRACE_LEVEL +#ifdef CONFIG_BT_LOG_BTIF_TRACE_LEVEL +#define BTIF_INITIAL_TRACE_LEVEL CONFIG_BT_LOG_BTIF_TRACE_LEVEL #else #define BTIF_INITIAL_TRACE_LEVEL BT_TRACE_LEVEL_WARNING #endif -#ifdef CONFIG_BTC_INITIAL_TRACE_LEVEL -#define BTC_INITIAL_TRACE_LEVEL CONFIG_BTC_INITIAL_TRACE_LEVEL +#ifdef CONFIG_BT_LOG_BTC_TRACE_LEVEL +#define BTC_INITIAL_TRACE_LEVEL CONFIG_BT_LOG_BTC_TRACE_LEVEL #else #define BTC_INITIAL_TRACE_LEVEL BT_TRACE_LEVEL_WARNING #endif -#ifdef CONFIG_OSI_INITIAL_TRACE_LEVEL -#define OSI_INITIAL_TRACE_LEVEL CONFIG_OSI_INITIAL_TRACE_LEVEL +#ifdef CONFIG_BT_LOG_OSI_TRACE_LEVEL +#define OSI_INITIAL_TRACE_LEVEL CONFIG_BT_LOG_OSI_TRACE_LEVEL #else #define OSI_INITIAL_TRACE_LEVEL BT_TRACE_LEVEL_WARNING #endif -#ifdef CONFIG_BLUFI_INITIAL_TRACE_LEVEL -#define BLUFI_INITIAL_TRACE_LEVEL CONFIG_BLUFI_INITIAL_TRACE_LEVEL +#ifdef CONFIG_BT_LOG_BLUFI_TRACE_LEVEL +#define BLUFI_INITIAL_TRACE_LEVEL CONFIG_BT_LOG_BLUFI_TRACE_LEVEL #else #define BLUFI_INITIAL_TRACE_LEVEL BT_TRACE_LEVEL_WARNING #endif diff --git a/components/bt/bluedroid/osi/allocator.c b/components/bt/bluedroid/osi/allocator.c index 7a06015e2..866ccc2e2 100644 --- a/components/bt/bluedroid/osi/allocator.c +++ b/components/bt/bluedroid/osi/allocator.c @@ -24,7 +24,7 @@ extern void *pvPortZalloc(size_t size); extern void vPortFree(void *pv); -#ifdef CONFIG_BLUEDROID_MEM_DEBUG +#ifdef CONFIG_BT_BLUEDROID_MEM_DEBUG #define OSI_MEM_DBG_INFO_MAX 1024*3 typedef struct { @@ -130,7 +130,7 @@ char *osi_strdup(const char *str) void *osi_malloc_func(size_t size) { -#ifdef CONFIG_BLUEDROID_MEM_DEBUG +#ifdef CONFIG_BT_BLUEDROID_MEM_DEBUG void *p; #if CONFIG_BT_ALLOCATION_FROM_SPIRAM_FIRST p = heap_caps_malloc_prefer(size, 2, MALLOC_CAP_DEFAULT|MALLOC_CAP_SPIRAM, MALLOC_CAP_DEFAULT|MALLOC_CAP_INTERNAL); @@ -145,12 +145,12 @@ void *osi_malloc_func(size_t size) #else return malloc(size); #endif /* #if CONFIG_BT_ALLOCATION_FROM_SPIRAM_FIRST */ -#endif /* #ifdef CONFIG_BLUEDROID_MEM_DEBUG */ +#endif /* #ifdef CONFIG_BT_BLUEDROID_MEM_DEBUG */ } void *osi_calloc_func(size_t size) { -#ifdef CONFIG_BLUEDROID_MEM_DEBUG +#ifdef CONFIG_BT_BLUEDROID_MEM_DEBUG void *p; #if CONFIG_BT_ALLOCATION_FROM_SPIRAM_FIRST p = heap_caps_calloc_prefer(1, size, 2, MALLOC_CAP_DEFAULT|MALLOC_CAP_SPIRAM, MALLOC_CAP_DEFAULT|MALLOC_CAP_INTERNAL); @@ -165,12 +165,12 @@ void *osi_calloc_func(size_t size) #else return calloc(1, size); #endif /* #if CONFIG_BT_ALLOCATION_FROM_SPIRAM_FIRST */ -#endif /* #ifdef CONFIG_BLUEDROID_MEM_DEBUG */ +#endif /* #ifdef CONFIG_BT_BLUEDROID_MEM_DEBUG */ } void osi_free_func(void *ptr) { -#ifdef CONFIG_BLUEDROID_MEM_DEBUG +#ifdef CONFIG_BT_BLUEDROID_MEM_DEBUG osi_mem_dbg_clean(ptr, __func__, __LINE__); #endif free(ptr); diff --git a/components/bt/bluedroid/osi/include/osi/allocator.h b/components/bt/bluedroid/osi/include/osi/allocator.h index 888d81346..3be366e76 100644 --- a/components/bt/bluedroid/osi/include/osi/allocator.h +++ b/components/bt/bluedroid/osi/include/osi/allocator.h @@ -30,7 +30,7 @@ void *osi_malloc_func(size_t size); void *osi_calloc_func(size_t size); void osi_free_func(void *ptr); -#ifdef CONFIG_BLUEDROID_MEM_DEBUG +#ifdef CONFIG_BT_BLUEDROID_MEM_DEBUG void osi_mem_dbg_init(void); void osi_mem_dbg_record(void *p, int size, const char *func, int line); @@ -127,7 +127,7 @@ do { \ #endif /* #if CONFIG_BT_ALLOCATION_FROM_SPIRAM_FIRST */ #define osi_free(p) free((p)) -#endif /* CONFIG_BLUEDROID_MEM_DEBUG */ +#endif /* CONFIG_BT_BLUEDROID_MEM_DEBUG */ #define FREE_AND_RESET(a) \ do { \ diff --git a/components/bt/bluedroid/osi/include/osi/thread.h b/components/bt/bluedroid/osi/include/osi/thread.h index e3b51ed28..86bb3d21e 100644 --- a/components/bt/bluedroid/osi/include/osi/thread.h +++ b/components/bt/bluedroid/osi/include/osi/thread.h @@ -57,7 +57,7 @@ typedef enum { SIG_BTU_NUM, } SIG_BTU_t; -#define TASK_PINNED_TO_CORE (CONFIG_BLUEDROID_PINNED_TO_CORE < portNUM_PROCESSORS ? CONFIG_BLUEDROID_PINNED_TO_CORE : tskNO_AFFINITY) +#define TASK_PINNED_TO_CORE (CONFIG_BT_BLUEDROID_PINNED_TO_CORE < portNUM_PROCESSORS ? CONFIG_BT_BLUEDROID_PINNED_TO_CORE : tskNO_AFFINITY) #define HCI_HOST_TASK_PINNED_TO_CORE (TASK_PINNED_TO_CORE) #define HCI_HOST_TASK_STACK_SIZE (2048 + BT_TASK_EXTRA_STACK_SIZE) @@ -72,19 +72,19 @@ typedef enum { #define HCI_H4_QUEUE_LEN 1 #define BTU_TASK_PINNED_TO_CORE (TASK_PINNED_TO_CORE) -#define BTU_TASK_STACK_SIZE (CONFIG_BTU_TASK_STACK_SIZE + BT_TASK_EXTRA_STACK_SIZE) +#define BTU_TASK_STACK_SIZE (CONFIG_BT_BTU_TASK_STACK_SIZE + BT_TASK_EXTRA_STACK_SIZE) #define BTU_TASK_PRIO (configMAX_PRIORITIES - 5) #define BTU_TASK_NAME "btuT" #define BTU_QUEUE_LEN 50 #define BTC_TASK_PINNED_TO_CORE (TASK_PINNED_TO_CORE) -#define BTC_TASK_STACK_SIZE (CONFIG_BTC_TASK_STACK_SIZE + BT_TASK_EXTRA_STACK_SIZE) //by menuconfig +#define BTC_TASK_STACK_SIZE (CONFIG_BT_BTC_TASK_STACK_SIZE + BT_TASK_EXTRA_STACK_SIZE) //by menuconfig #define BTC_TASK_NAME "btcT" #define BTC_TASK_PRIO (configMAX_PRIORITIES - 6) #define BTC_TASK_QUEUE_LEN 60 #define BTC_A2DP_SINK_TASK_PINNED_TO_CORE (TASK_PINNED_TO_CORE) -#define BTC_A2DP_SINK_TASK_STACK_SIZE (CONFIG_A2DP_SINK_TASK_STACK_SIZE + BT_TASK_EXTRA_STACK_SIZE) // by menuconfig +#define BTC_A2DP_SINK_TASK_STACK_SIZE (CONFIG_BT_A2DP_SINK_TASK_STACK_SIZE + BT_TASK_EXTRA_STACK_SIZE) // by menuconfig #define BTC_A2DP_SINK_TASK_NAME "BtA2dSinkT" #define BTC_A2DP_SINK_TASK_PRIO (configMAX_PRIORITIES - 3) #define BTC_A2DP_SINK_DATA_QUEUE_LEN (3) @@ -92,7 +92,7 @@ typedef enum { #define BTC_A2DP_SINK_TASK_QUEUE_SET_LEN (BTC_A2DP_SINK_DATA_QUEUE_LEN + BTC_A2DP_SINK_CTRL_QUEUE_LEN) #define BTC_A2DP_SOURCE_TASK_PINNED_TO_CORE (TASK_PINNED_TO_CORE) -#define BTC_A2DP_SOURCE_TASK_STACK_SIZE (CONFIG_A2DP_SOURCE_TASK_STACK_SIZE + BT_TASK_EXTRA_STACK_SIZE) // by menuconfig +#define BTC_A2DP_SOURCE_TASK_STACK_SIZE (CONFIG_BT_A2DP_SOURCE_TASK_STACK_SIZE + BT_TASK_EXTRA_STACK_SIZE) // by menuconfig #define BTC_A2DP_SOURCE_TASK_NAME "BtA2dSourceT" #define BTC_A2DP_SOURCE_TASK_PRIO (configMAX_PRIORITIES - 3) #define BTC_A2DP_SOURCE_DATA_QUEUE_LEN (3) diff --git a/components/bt/bluedroid/stack/btm/include/btm_int.h b/components/bt/bluedroid/stack/btm/include/btm_int.h index 47ddfd344..79c3eff72 100644 --- a/components/bt/bluedroid/stack/btm/include/btm_int.h +++ b/components/bt/bluedroid/stack/btm/include/btm_int.h @@ -871,7 +871,7 @@ typedef struct { #endif ///SMP_INCLUDED == TRUE #if SMP_INCLUDED == TRUE || CLASSIC_BT_INCLUDED == TRUE tBTM_SEC_SERV_REC sec_serv_rec[BTM_SEC_MAX_SERVICE_RECORDS]; -#endif // SMP_INCLUDED == TRUE || CLASSIC_BT_ENABLED == TRUE +#endif // SMP_INCLUDED == TRUE || BT_CLASSIC_ENABLED == TRUE tBTM_SEC_DEV_REC sec_dev_rec[BTM_SEC_MAX_DEVICE_RECORDS]; tBTM_SEC_SERV_REC *p_out_serv; tBTM_MKEY_CALLBACK *mkey_cback; diff --git a/components/bt/bt.c b/components/bt/bt.c index c35f42e4a..f35af1c74 100644 --- a/components/bt/bt.c +++ b/components/bt/bt.c @@ -900,15 +900,15 @@ static uint32_t btdm_config_mask_load(void) { uint32_t mask = 0x0; -#if CONFIG_BTDM_CONTROLLER_HCI_MODE_UART_H4 +#if CONFIG_BTDM_CTRL_HCI_MODE_UART_H4 mask |= BTDM_CFG_HCI_UART; #endif -#if CONFIG_BTDM_CONTROLLER_PINNED_TO_CORE == 1 +#if CONFIG_BTDM_CTRL_PINNED_TO_CORE == 1 mask |= BTDM_CFG_CONTROLLER_RUN_APP_CPU; #endif -#if CONFIG_BTDM_CONTROLLER_FULL_SCAN_SUPPORTED +#if CONFIG_BTDM_CTRL_FULL_SCAN_SUPPORTED mask |= BTDM_CFG_BLE_FULL_SCAN_SUPPORTED; -#endif /* CONFIG_BTDM_CONTROLLER_FULL_SCAN_SUPPORTED */ +#endif /* CONFIG_BTDM_CTRL_FULL_SCAN_SUPPORTED */ mask |= BTDM_CFG_SCAN_DUPLICATE_OPTIONS; mask |= BTDM_CFG_SEND_ADV_RESERVED_SIZE; @@ -1073,7 +1073,7 @@ esp_err_t esp_bt_controller_init(esp_bt_controller_config_t *cfg) } //overwrite some parameters - cfg->bt_max_sync_conn = CONFIG_BTDM_CONTROLLER_BR_EDR_MAX_SYNC_CONN_EFF; + cfg->bt_max_sync_conn = CONFIG_BTDM_CTRL_BR_EDR_MAX_SYNC_CONN_EFF; cfg->magic = ESP_BT_CONTROLLER_CONFIG_MAGIC_VAL; if (((cfg->mode & ESP_BT_MODE_BLE) && (cfg->ble_max_conn <= 0 || cfg->ble_max_conn > BTDM_CONTROLLER_BLE_MAX_CONN_LIMIT)) diff --git a/components/bt/component.mk b/components/bt/component.mk index eb9b39c02..d04846919 100644 --- a/components/bt/component.mk +++ b/components/bt/component.mk @@ -25,7 +25,7 @@ endif endif -ifdef CONFIG_BLUEDROID_ENABLED +ifdef CONFIG_BT_BLUEDROID_ENABLED COMPONENT_PRIV_INCLUDEDIRS += bluedroid/bta/include \ bluedroid/bta/ar/include \ diff --git a/components/bt/include/esp_bt.h b/components/bt/include/esp_bt.h index b098c133d..7a0971b13 100644 --- a/components/bt/include/esp_bt.h +++ b/components/bt/include/esp_bt.h @@ -56,30 +56,30 @@ the adv packet will be discarded until the memory is restored. */ #define BT_HCI_UART_BAUDRATE_DEFAULT 921600 #endif /* BT_HCI_UART_BAUDRATE_DEFAULT */ -#ifdef CONFIG_SCAN_DUPLICATE_TYPE -#define SCAN_DUPLICATE_TYPE_VALUE CONFIG_SCAN_DUPLICATE_TYPE +#ifdef CONFIG_BTDM_SCAN_DUPL_TYPE +#define SCAN_DUPLICATE_TYPE_VALUE CONFIG_BTDM_SCAN_DUPL_TYPE #else #define SCAN_DUPLICATE_TYPE_VALUE 0 #endif /* normal adv cache size */ -#ifdef CONFIG_DUPLICATE_SCAN_CACHE_SIZE -#define NORMAL_SCAN_DUPLICATE_CACHE_SIZE CONFIG_DUPLICATE_SCAN_CACHE_SIZE +#ifdef CONFIG_BTDM_SCAN_DUPL_CACHE_SIZE +#define NORMAL_SCAN_DUPLICATE_CACHE_SIZE CONFIG_BTDM_SCAN_DUPL_CACHE_SIZE #else #define NORMAL_SCAN_DUPLICATE_CACHE_SIZE 20 #endif -#ifndef CONFIG_BLE_MESH_SCAN_DUPLICATE_EN -#define CONFIG_BLE_MESH_SCAN_DUPLICATE_EN FALSE +#ifndef CONFIG_BTDM_BLE_MESH_SCAN_DUPL_EN +#define CONFIG_BTDM_BLE_MESH_SCAN_DUPL_EN FALSE #endif #define SCAN_DUPLICATE_MODE_NORMAL_ADV_ONLY 0 #define SCAN_DUPLICATE_MODE_NORMAL_ADV_MESH_ADV 1 -#if CONFIG_BLE_MESH_SCAN_DUPLICATE_EN +#if CONFIG_BTDM_BLE_MESH_SCAN_DUPL_EN #define SCAN_DUPLICATE_MODE SCAN_DUPLICATE_MODE_NORMAL_ADV_MESH_ADV - #ifdef CONFIG_MESH_DUPLICATE_SCAN_CACHE_SIZE - #define MESH_DUPLICATE_SCAN_CACHE_SIZE CONFIG_MESH_DUPLICATE_SCAN_CACHE_SIZE + #ifdef CONFIG_BTDM_MESH_DUPL_SCAN_CACHE_SIZE + #define MESH_DUPLICATE_SCAN_CACHE_SIZE CONFIG_BTDM_MESH_DUPL_SCAN_CACHE_SIZE #else #define MESH_DUPLICATE_SCAN_CACHE_SIZE 50 #endif @@ -88,9 +88,9 @@ the adv packet will be discarded until the memory is restored. */ #define MESH_DUPLICATE_SCAN_CACHE_SIZE 0 #endif -#if defined(CONFIG_BTDM_CONTROLLER_MODE_BLE_ONLY) +#if defined(CONFIG_BTDM_CTRL_MODE_BLE_ONLY) #define BTDM_CONTROLLER_MODE_EFF ESP_BT_MODE_BLE -#elif defined(CONFIG_BTDM_CONTROLLER_MODE_BR_EDR_ONLY) +#elif defined(CONFIG_BTDM_CTRL_MODE_BR_EDR_ONLY) #define BTDM_CONTROLLER_MODE_EFF ESP_BT_MODE_CLASSIC_BT #else #define BTDM_CONTROLLER_MODE_EFF ESP_BT_MODE_BTDM @@ -112,9 +112,9 @@ the adv packet will be discarded until the memory is restored. */ .send_adv_reserved_size = SCAN_SEND_ADV_RESERVED_SIZE, \ .controller_debug_flag = CONTROLLER_ADV_LOST_DEBUG_BIT, \ .mode = BTDM_CONTROLLER_MODE_EFF, \ - .ble_max_conn = CONFIG_BTDM_CONTROLLER_BLE_MAX_CONN_EFF, \ - .bt_max_acl_conn = CONFIG_BTDM_CONTROLLER_BR_EDR_MAX_ACL_CONN_EFF, \ - .bt_max_sync_conn = CONFIG_BTDM_CONTROLLER_BR_EDR_MAX_SYNC_CONN_EFF, \ + .ble_max_conn = CONFIG_BTDM_CTRL_BLE_MAX_CONN_EFF, \ + .bt_max_acl_conn = CONFIG_BTDM_CTRL_BR_EDR_MAX_ACL_CONN_EFF, \ + .bt_max_sync_conn = CONFIG_BTDM_CTRL_BR_EDR_MAX_SYNC_CONN_EFF, \ .magic = ESP_BT_CONTROLLER_CONFIG_MAGIC_VAL, \ }; @@ -408,7 +408,7 @@ esp_err_t esp_bt_mem_release(esp_bt_mode_t mode); * There are currently two options for bluetooth modem sleep, one is ORIG mode, and another is EVED Mode. EVED Mode is intended for BLE only. * * For ORIG mode: - * Bluetooth modem sleep is enabled in controller start up by default if CONFIG_BTDM_CONTROLLER_MODEM_SLEEP is set and "ORIG mode" is selected. In ORIG modem sleep mode, bluetooth controller will switch off some components and pause to work every now and then, if there is no event to process; and wakeup according to the scheduled interval and resume the work. It can also wakeup earlier upon external request using function "esp_bt_controller_wakeup_request". + * Bluetooth modem sleep is enabled in controller start up by default if CONFIG_BTDM_MODEM_SLEEP is set and "ORIG mode" is selected. In ORIG modem sleep mode, bluetooth controller will switch off some components and pause to work every now and then, if there is no event to process; and wakeup according to the scheduled interval and resume the work. It can also wakeup earlier upon external request using function "esp_bt_controller_wakeup_request". * * @return * - ESP_OK : success diff --git a/components/bt/sdkconfig.rename b/components/bt/sdkconfig.rename new file mode 100644 index 000000000..73c222685 --- /dev/null +++ b/components/bt/sdkconfig.rename @@ -0,0 +1,227 @@ +# sdkconfig replacement configurations for deprecated options formatted as +# CONFIG_DEPRECATED_OPTION CONFIG_NEW_OPTION + +CONFIG_BTDM_CONTROLLER_MODE CONFIG_BTDM_CTRL_MODE +CONFIG_BTDM_CONTROLLER_MODE_BLE_ONLY CONFIG_BTDM_CTRL_MODE_BLE_ONLY +CONFIG_BTDM_CONTROLLER_MODE_BR_EDR_ONLY CONFIG_BTDM_CTRL_MODE_BR_EDR_ONLY +CONFIG_BTDM_CONTROLLER_MODE_BTDM CONFIG_BTDM_CTRL_MODE_BTDM +CONFIG_BTDM_CONTROLLER_BLE_MAX_CONN CONFIG_BTDM_CTRL_BLE_MAX_CONN +CONFIG_BTDM_CONTROLLER_BR_EDR_MAX_ACL_CONN CONFIG_BTDM_CTRL_BR_EDR_MAX_ACL_CONN +CONFIG_BTDM_CONTROLLER_BR_EDR_MAX_SYNC_CONN CONFIG_BTDM_CTRL_BR_EDR_MAX_SYNC_CONN +CONFIG_BTDM_CONTROLLER_BLE_MAX_CONN_EFF CONFIG_BTDM_CTRL_BLE_MAX_CONN_EFF +CONFIG_BTDM_CONTROLLER_BR_EDR_MAX_ACL_CONN_EFF CONFIG_BTDM_CTRL_BR_EDR_MAX_ACL_CONN_EFF +CONFIG_BTDM_CONTROLLER_BR_EDR_MAX_SYNC_CONN_EFF CONFIG_BTDM_CTRL_BR_EDR_MAX_SYNC_CONN_EFF +CONFIG_BTDM_CONTROLLER_PINNED_TO_CORE_CHOICE CONFIG_BTDM_CTRL_PINNED_TO_CORE_CHOICE +CONFIG_BTDM_CONTROLLER_PINNED_TO_CORE CONFIG_BTDM_CTRL_PINNED_TO_CORE +CONFIG_BTDM_CONTROLLER_HCI_MODE_CHOICE CONFIG_BTDM_CTRL_HCI_MODE_CHOICE +CONFIG_BTDM_CONTROLLER_HCI_MODE_VHCI CONFIG_BTDM_CTRL_HCI_MODE_VHCI +CONFIG_BTDM_CONTROLLER_HCI_MODE_UART_H4 CONFIG_BTDM_CTRL_HCI_MODE_UART_H4 + +CONFIG_BTDM_CONTROLLER_MODEM_SLEEP CONFIG_BTDM_MODEM_SLEEP + +CONFIG_BLE_SCAN_DUPLICATE CONFIG_BTDM_BLE_SCAN_DUPL +CONFIG_SCAN_DUPLICATE_TYPE CONFIG_BTDM_SCAN_DUPL_TYPE +CONFIG_SCAN_DUPLICATE_BY_DEVICE_ADDR CONFIG_BTDM_SCAN_DUPL_TYPE_DEVICE +CONFIG_SCAN_DUPLICATE_BY_ADV_DATA CONFIG_BTDM_SCAN_DUPL_TYPE_DATA +CONFIG_SCAN_DUPLICATE_BY_ADV_DATA_AND_DEVICE_ADDR CONFIG_BTDM_SCAN_DUPL_TYPE_DATA_DEVICE +CONFIG_DUPLICATE_SCAN_CACHE_SIZE CONFIG_BTDM_SCAN_DUPL_CACHE_SIZE +CONFIG_BLE_MESH_SCAN_DUPLICATE_EN CONFIG_BTDM_BLE_MESH_SCAN_DUPL_EN +CONFIG_MESH_DUPLICATE_SCAN_CACHE_SIZE CONFIG_BTDM_MESH_DUPL_SCAN_CACHE_SIZE +CONFIG_BTDM_CONTROLLER_FULL_SCAN_SUPPORTED CONFIG_BTDM_CTRL_FULL_SCAN_SUPPORTED +CONFIG_BLE_ADV_REPORT_FLOW_CONTROL_SUPPORTED CONFIG_BTDM_BLE_ADV_REPORT_FLOW_CTRL_SUPP +CONFIG_BLE_ADV_REPORT_FLOW_CONTROL_NUM CONFIG_BTDM_BLE_ADV_REPORT_FLOW_CTRL_NUM +CONFIG_BLE_ADV_REPORT_DISCARD_THRSHOLD CONFIG_BTDM_BLE_ADV_REPORT_DISCARD_THRSHOLD + +CONFIG_BLUEDROID_ENABLED CONFIG_BT_BLUEDROID_ENABLED +CONFIG_BLUEDROID_PINNED_TO_CORE_CHOICE CONFIG_BT_BLUEDROID_PINNED_TO_CORE_CHOICE +CONFIG_BLUEDROID_PINNED_TO_CORE CONFIG_BT_BLUEDROID_PINNED_TO_CORE +CONFIG_BLUEDROID_PINNED_TO_CORE_0 CONFIG_BT_BLUEDROID_PINNED_TO_CORE_0 +CONFIG_BLUEDROID_PINNED_TO_CORE_1 CONFIG_BT_BLUEDROID_PINNED_TO_CORE_1 +CONFIG_BTC_TASK_STACK_SIZE CONFIG_BT_BTC_TASK_STACK_SIZE +CONFIG_BTU_TASK_STACK_SIZE CONFIG_BT_BTU_TASK_STACK_SIZE +CONFIG_BLUEDROID_MEM_DEBUG CONFIG_BT_BLUEDROID_MEM_DEBUG +CONFIG_CLASSIC_BT_ENABLED CONFIG_BT_CLASSIC_ENABLED +CONFIG_A2DP_ENABLE CONFIG_BT_A2DP_ENABLE +CONFIG_A2DP_SINK_TASK_STACK_SIZE CONFIG_BT_A2DP_SINK_TASK_STACK_SIZE +CONFIG_A2DP_SOURCE_TASK_STACK_SIZE CONFIG_BT_A2DP_SOURCE_TASK_STACK_SIZE +CONFIG_HFP_ENABLE CONFIG_BT_HFP_ENABLE +CONFIG_HFP_ROLE CONFIG_BT_HFP_ROLE +CONFIG_HFP_CLIENT_ENABLE CONFIG_BT_HFP_CLIENT_ENABLE +CONFIG_HFP_AUDIO_DATA_PATH CONFIG_BT_HFP_AUDIO_DATA_PATH +CONFIG_HFP_AUDIO_DATA_PATH_PCM CONFIG_BT_HFP_AUDIO_DATA_PATH_PCM +CONFIG_HFP_AUDIO_DATA_PATH_HCI CONFIG_BT_HFP_AUDIO_DATA_PATH_HCI +CONFIG_GATTS_ENABLE CONFIG_BT_GATTS_ENABLE +CONFIG_GATTS_SEND_SERVICE_CHANGE_MODE CONFIG_BT_GATTS_SEND_SERVICE_CHANGE_MODE +CONFIG_GATTS_SEND_SERVICE_CHANGE_MANUAL CONFIG_BT_GATTS_SEND_SERVICE_CHANGE_MANUAL +CONFIG_GATTS_SEND_SERVICE_CHANGE_AUTO CONFIG_BT_GATTS_SEND_SERVICE_CHANGE_AUTO +CONFIG_GATTC_ENABLE CONFIG_BT_GATTC_ENABLE +CONFIG_GATTC_CACHE_NVS_FLASH CONFIG_BT_GATTC_CACHE_NVS_FLASH +CONFIG_BLE_SMP_ENABLE CONFIG_BT_BLE_SMP_ENABLE +CONFIG_SMP_SLAVE_CON_PARAMS_UPD_ENABLE CONFIG_BT_SMP_SLAVE_CON_PARAMS_UPD_ENABLE + +CONFIG_HCI_INITIAL_TRACE_LEVEL CONFIG_BT_LOG_HCI_TRACE_LEVEL +CONFIG_HCI_TRACE_LEVEL_NONE CONFIG_BT_LOG_HCI_TRACE_LEVEL_NONE +CONFIG_HCI_TRACE_LEVEL_ERROR CONFIG_BT_LOG_HCI_TRACE_LEVEL_ERROR +CONFIG_HCI_TRACE_LEVEL_WARNING CONFIG_BT_LOG_HCI_TRACE_LEVEL_WARNING +CONFIG_HCI_TRACE_LEVEL_API CONFIG_BT_LOG_HCI_TRACE_LEVEL_API +CONFIG_HCI_TRACE_LEVEL_EVENT CONFIG_BT_LOG_HCI_TRACE_LEVEL_EVENT +CONFIG_HCI_TRACE_LEVEL_DEBUG CONFIG_BT_LOG_HCI_TRACE_LEVEL_DEBUG +CONFIG_HCI_TRACE_LEVEL_VERBOSE CONFIG_BT_LOG_HCI_TRACE_LEVEL_VERBOSE +CONFIG_BTM_INITIAL_TRACE_LEVEL CONFIG_BT_LOG_BTM_TRACE_LEVEL +CONFIG_BTM_TRACE_LEVEL_NONE CONFIG_BT_LOG_BTM_TRACE_LEVEL_NONE +CONFIG_BTM_TRACE_LEVEL_ERROR CONFIG_BT_LOG_BTM_TRACE_LEVEL_ERROR +CONFIG_BTM_TRACE_LEVEL_WARNING CONFIG_BT_LOG_BTM_TRACE_LEVEL_WARNING +CONFIG_BTM_TRACE_LEVEL_API CONFIG_BT_LOG_BTM_TRACE_LEVEL_API +CONFIG_BTM_TRACE_LEVEL_EVENT CONFIG_BT_LOG_BTM_TRACE_LEVEL_EVENT +CONFIG_BTM_TRACE_LEVEL_DEBUG CONFIG_BT_LOG_BTM_TRACE_LEVEL_DEBUG +CONFIG_BTM_TRACE_LEVEL_VERBOSE CONFIG_BT_LOG_BTM_TRACE_LEVEL_VERBOSE +CONFIG_L2CAP_INITIAL_TRACE_LEVEL CONFIG_BT_LOG_L2CAP_TRACE_LEVEL +CONFIG_L2CAP_TRACE_LEVEL_NONE CONFIG_BT_LOG_L2CAP_TRACE_LEVEL_NONE +CONFIG_L2CAP_TRACE_LEVEL_ERROR CONFIG_BT_LOG_L2CAP_TRACE_LEVEL_ERROR +CONFIG_L2CAP_TRACE_LEVEL_WARNING CONFIG_BT_LOG_L2CAP_TRACE_LEVEL_WARNING +CONFIG_L2CAP_TRACE_LEVEL_API CONFIG_BT_LOG_L2CAP_TRACE_LEVEL_API +CONFIG_L2CAP_TRACE_LEVEL_EVENT CONFIG_BT_LOG_L2CAP_TRACE_LEVEL_EVENT +CONFIG_L2CAP_TRACE_LEVEL_DEBUG CONFIG_BT_LOG_L2CAP_TRACE_LEVEL_DEBUG +CONFIG_L2CAP_TRACE_LEVEL_VERBOSE CONFIG_BT_LOG_L2CAP_TRACE_LEVEL_VERBOSE +CONFIG_RFCOMM_INITIAL_TRACE_LEVEL CONFIG_BT_LOG_RFCOMM_TRACE_LEVEL +CONFIG_RFCOMM_TRACE_LEVEL_NONE CONFIG_BT_LOG_RFCOMM_TRACE_LEVEL_NONE +CONFIG_RFCOMM_TRACE_LEVEL_ERROR CONFIG_BT_LOG_RFCOMM_TRACE_LEVEL_ERROR +CONFIG_RFCOMM_TRACE_LEVEL_WARNING CONFIG_BT_LOG_RFCOMM_TRACE_LEVEL_WARNING +CONFIG_RFCOMM_TRACE_LEVEL_API CONFIG_BT_LOG_RFCOMM_TRACE_LEVEL_API +CONFIG_RFCOMM_TRACE_LEVEL_EVENT CONFIG_BT_LOG_RFCOMM_TRACE_LEVEL_EVENT +CONFIG_RFCOMM_TRACE_LEVEL_DEBUG CONFIG_BT_LOG_RFCOMM_TRACE_LEVEL_DEBUG +CONFIG_RFCOMM_TRACE_LEVEL_VERBOSE CONFIG_BT_LOG_RFCOMM_TRACE_LEVEL_VERBOSE +CONFIG_BTH_LOG_SDP_INITIAL_TRACE_LEVEL CONFIG_BT_LOG_SDP_TRACE_LEVEL +CONFIG_SDP_TRACE_LEVEL_NONE CONFIG_BT_LOG_SDP_TRACE_LEVEL_NONE +CONFIG_SDP_TRACE_LEVEL_ERROR CONFIG_BT_LOG_SDP_TRACE_LEVEL_ERROR +CONFIG_SDP_TRACE_LEVEL_WARNING CONFIG_BT_LOG_SDP_TRACE_LEVEL_WARNING +CONFIG_SDP_TRACE_LEVEL_API CONFIG_BT_LOG_SDP_TRACE_LEVEL_API +CONFIG_SDP_TRACE_LEVEL_EVENT CONFIG_BT_LOG_SDP_TRACE_LEVEL_EVENT +CONFIG_SDP_TRACE_LEVEL_DEBUG CONFIG_BT_LOG_SDP_TRACE_LEVEL_DEBUG +CONFIG_SDP_TRACE_LEVEL_VERBOSE CONFIG_BT_LOG_SDP_TRACE_LEVEL_VERBOSE +CONFIG_GAP_INITIAL_TRACE_LEVEL CONFIG_BT_LOG_GAP_TRACE_LEVEL +CONFIG_GAP_TRACE_LEVEL_NONE CONFIG_BT_LOG_GAP_TRACE_LEVEL_NONE +CONFIG_GAP_TRACE_LEVEL_ERROR CONFIG_BT_LOG_GAP_TRACE_LEVEL_ERROR +CONFIG_GAP_TRACE_LEVEL_WARNING CONFIG_BT_LOG_GAP_TRACE_LEVEL_WARNING +CONFIG_GAP_TRACE_LEVEL_API CONFIG_BT_LOG_GAP_TRACE_LEVEL_API +CONFIG_GAP_TRACE_LEVEL_EVENT CONFIG_BT_LOG_GAP_TRACE_LEVEL_EVENT +CONFIG_GAP_TRACE_LEVEL_DEBUG CONFIG_BT_LOG_GAP_TRACE_LEVEL_DEBUG +CONFIG_GAP_TRACE_LEVEL_VERBOSE CONFIG_BT_LOG_GAP_TRACE_LEVEL_VERBOSE +CONFIG_BNEP_INITIAL_TRACE_LEVEL CONFIG_BT_LOG_BNEP_TRACE_LEVEL +CONFIG_PAN_INITIAL_TRACE_LEVEL CONFIG_BT_LOG_PAN_TRACE_LEVEL +CONFIG_PAN_TRACE_LEVEL_NONE CONFIG_BT_LOG_PAN_TRACE_LEVEL_NONE +CONFIG_PAN_TRACE_LEVEL_ERROR CONFIG_BT_LOG_PAN_TRACE_LEVEL_ERROR +CONFIG_PAN_TRACE_LEVEL_WARNING CONFIG_BT_LOG_PAN_TRACE_LEVEL_WARNING +CONFIG_PAN_TRACE_LEVEL_API CONFIG_BT_LOG_PAN_TRACE_LEVEL_API +CONFIG_PAN_TRACE_LEVEL_EVENT CONFIG_BT_LOG_PAN_TRACE_LEVEL_EVENT +CONFIG_PAN_TRACE_LEVEL_DEBUG CONFIG_BT_LOG_PAN_TRACE_LEVEL_DEBUG +CONFIG_PAN_TRACE_LEVEL_VERBOSE CONFIG_BT_LOG_PAN_TRACE_LEVEL_VERBOSE +CONFIG_A2D_INITIAL_TRACE_LEVEL CONFIG_BT_LOG_A2D_TRACE_LEVEL +CONFIG_A2D_TRACE_LEVEL_NONE CONFIG_BT_LOG_A2D_TRACE_LEVEL_NONE +CONFIG_A2D_TRACE_LEVEL_ERROR CONFIG_BT_LOG_A2D_TRACE_LEVEL_ERROR +CONFIG_A2D_TRACE_LEVEL_WARNING CONFIG_BT_LOG_A2D_TRACE_LEVEL_WARNING +CONFIG_A2D_TRACE_LEVEL_API CONFIG_BT_LOG_A2D_TRACE_LEVEL_API +CONFIG_A2D_TRACE_LEVEL_EVENT CONFIG_BT_LOG_A2D_TRACE_LEVEL_EVENT +CONFIG_A2D_TRACE_LEVEL_DEBUG CONFIG_BT_LOG_A2D_TRACE_LEVEL_DEBUG +CONFIG_A2D_TRACE_LEVEL_VERBOSE CONFIG_BT_LOG_A2D_TRACE_LEVEL_VERBOSE +CONFIG_AVDT_INITIAL_TRACE_LEVEL CONFIG_BT_LOG_AVDT_TRACE_LEVEL +CONFIG_AVDT_TRACE_LEVEL_NONE CONFIG_BT_LOG_AVDT_TRACE_LEVEL_NONE +CONFIG_AVDT_TRACE_LEVEL_ERROR CONFIG_BT_LOG_AVDT_TRACE_LEVEL_ERROR +CONFIG_AVDT_TRACE_LEVEL_WARNING CONFIG_BT_LOG_AVDT_TRACE_LEVEL_WARNING +CONFIG_AVDT_TRACE_LEVEL_API CONFIG_BT_LOG_AVDT_TRACE_LEVEL_API +CONFIG_AVDT_TRACE_LEVEL_EVENT CONFIG_BT_LOG_AVDT_TRACE_LEVEL_EVENT +CONFIG_AVDT_TRACE_LEVEL_DEBUG CONFIG_BT_LOG_AVDT_TRACE_LEVEL_DEBUG +CONFIG_AVDT_TRACE_LEVEL_VERBOSE CONFIG_BT_LOG_AVDT_TRACE_LEVEL_VERBOSE +CONFIG_AVCT_INITIAL_TRACE_LEVEL CONFIG_BT_LOG_AVCT_TRACE_LEVEL +CONFIG_AVCT_TRACE_LEVEL_NONE CONFIG_BT_LOG_AVCT_TRACE_LEVEL_NONE +CONFIG_AVCT_TRACE_LEVEL_ERROR CONFIG_BT_LOG_AVCT_TRACE_LEVEL_ERROR +CONFIG_AVCT_TRACE_LEVEL_WARNING CONFIG_BT_LOG_AVCT_TRACE_LEVEL_WARNING +CONFIG_AVCT_TRACE_LEVEL_API CONFIG_BT_LOG_AVCT_TRACE_LEVEL_API +CONFIG_AVCT_TRACE_LEVEL_EVENT CONFIG_BT_LOG_AVCT_TRACE_LEVEL_EVENT +CONFIG_AVCT_TRACE_LEVEL_DEBUG CONFIG_BT_LOG_AVCT_TRACE_LEVEL_DEBUG +CONFIG_AVCT_TRACE_LEVEL_VERBOSE CONFIG_BT_LOG_AVCT_TRACE_LEVEL_VERBOSE +CONFIG_AVRC_INITIAL_TRACE_LEVEL CONFIG_BT_LOG_AVRC_TRACE_LEVEL +CONFIG_AVRC_TRACE_LEVEL_NONE CONFIG_BT_LOG_AVRC_TRACE_LEVEL_NONE +CONFIG_AVRC_TRACE_LEVEL_ERROR CONFIG_BT_LOG_AVRC_TRACE_LEVEL_ERROR +CONFIG_AVRC_TRACE_LEVEL_WARNING CONFIG_BT_LOG_AVRC_TRACE_LEVEL_WARNING +CONFIG_AVRC_TRACE_LEVEL_API CONFIG_BT_LOG_AVRC_TRACE_LEVEL_API +CONFIG_AVRC_TRACE_LEVEL_EVENT CONFIG_BT_LOG_AVRC_TRACE_LEVEL_EVENT +CONFIG_AVRC_TRACE_LEVEL_DEBUG CONFIG_BT_LOG_AVRC_TRACE_LEVEL_DEBUG +CONFIG_AVRC_TRACE_LEVEL_VERBOSE CONFIG_BT_LOG_AVRC_TRACE_LEVEL_VERBOSE +CONFIG_MCA_INITIAL_TRACE_LEVEL CONFIG_BT_LOG_MCA_TRACE_LEVEL +CONFIG_MCA_TRACE_LEVEL_NONE CONFIG_BT_LOG_MCA_TRACE_LEVEL_NONE +CONFIG_MCA_TRACE_LEVEL_ERROR CONFIG_BT_LOG_MCA_TRACE_LEVEL_ERROR +CONFIG_MCA_TRACE_LEVEL_WARNING CONFIG_BT_LOG_MCA_TRACE_LEVEL_WARNING +CONFIG_MCA_TRACE_LEVEL_API CONFIG_BT_LOG_MCA_TRACE_LEVEL_API +CONFIG_MCA_TRACE_LEVEL_EVENT CONFIG_BT_LOG_MCA_TRACE_LEVEL_EVENT +CONFIG_MCA_TRACE_LEVEL_DEBUG CONFIG_BT_LOG_MCA_TRACE_LEVEL_DEBUG +CONFIG_MCA_TRACE_LEVEL_VERBOSE CONFIG_BT_LOG_MCA_TRACE_LEVEL_VERBOSE +CONFIG_HID_INITIAL_TRACE_LEVEL CONFIG_BT_LOG_HID_TRACE_LEVEL +CONFIG_HID_TRACE_LEVEL_NONE CONFIG_BT_LOG_HID_TRACE_LEVEL_NONE +CONFIG_HID_TRACE_LEVEL_ERROR CONFIG_BT_LOG_HID_TRACE_LEVEL_ERROR +CONFIG_HID_TRACE_LEVEL_WARNING CONFIG_BT_LOG_HID_TRACE_LEVEL_WARNING +CONFIG_HID_TRACE_LEVEL_API CONFIG_BT_LOG_HID_TRACE_LEVEL_API +CONFIG_HID_TRACE_LEVEL_EVENT CONFIG_BT_LOG_HID_TRACE_LEVEL_EVENT +CONFIG_HID_TRACE_LEVEL_DEBUG CONFIG_BT_LOG_HID_TRACE_LEVEL_DEBUG +CONFIG_HID_TRACE_LEVEL_VERBOSE CONFIG_BT_LOG_HID_TRACE_LEVEL_VERBOSE +CONFIG_APPL_INITIAL_TRACE_LEVEL CONFIG_BT_LOG_APPL_TRACE_LEVEL +CONFIG_APPL_TRACE_LEVEL_NONE CONFIG_BT_LOG_APPL_TRACE_LEVEL_NONE +CONFIG_APPL_TRACE_LEVEL_ERROR CONFIG_BT_LOG_APPL_TRACE_LEVEL_ERROR +CONFIG_APPL_TRACE_LEVEL_WARNING CONFIG_BT_LOG_APPL_TRACE_LEVEL_WARNING +CONFIG_APPL_TRACE_LEVEL_API CONFIG_BT_LOG_APPL_TRACE_LEVEL_API +CONFIG_APPL_TRACE_LEVEL_EVENT CONFIG_BT_LOG_APPL_TRACE_LEVEL_EVENT +CONFIG_APPL_TRACE_LEVEL_DEBUG CONFIG_BT_LOG_APPL_TRACE_LEVEL_DEBUG +CONFIG_APPL_TRACE_LEVEL_VERBOSE CONFIG_BT_LOG_APPL_TRACE_LEVEL_VERBOSE +CONFIG_GATT_INITIAL_TRACE_LEVEL CONFIG_BT_LOG_GATT_TRACE_LEVEL +CONFIG_GATT_TRACE_LEVEL_NONE CONFIG_BT_LOG_GATT_TRACE_LEVEL_NONE +CONFIG_GATT_TRACE_LEVEL_ERROR CONFIG_BT_LOG_GATT_TRACE_LEVEL_ERROR +CONFIG_GATT_TRACE_LEVEL_WARNING CONFIG_BT_LOG_GATT_TRACE_LEVEL_WARNING +CONFIG_GATT_TRACE_LEVEL_API CONFIG_BT_LOG_GATT_TRACE_LEVEL_API +CONFIG_GATT_TRACE_LEVEL_EVENT CONFIG_BT_LOG_GATT_TRACE_LEVEL_EVENT +CONFIG_GATT_TRACE_LEVEL_DEBUG CONFIG_BT_LOG_GATT_TRACE_LEVEL_DEBUG +CONFIG_GATT_TRACE_LEVEL_VERBOSE CONFIG_BT_LOG_GATT_TRACE_LEVEL_VERBOSE +CONFIG_SMP_INITIAL_TRACE_LEVEL CONFIG_BT_LOG_SMP_TRACE_LEVEL +CONFIG_SMP_TRACE_LEVEL_NONE CONFIG_BT_LOG_SMP_TRACE_LEVEL_NONE +CONFIG_SMP_TRACE_LEVEL_ERROR CONFIG_BT_LOG_SMP_TRACE_LEVEL_ERROR +CONFIG_SMP_TRACE_LEVEL_WARNING CONFIG_BT_LOG_SMP_TRACE_LEVEL_WARNING +CONFIG_SMP_TRACE_LEVEL_API CONFIG_BT_LOG_SMP_TRACE_LEVEL_API +CONFIG_SMP_TRACE_LEVEL_EVENT CONFIG_BT_LOG_SMP_TRACE_LEVEL_EVENT +CONFIG_SMP_TRACE_LEVEL_DEBUG CONFIG_BT_LOG_SMP_TRACE_LEVEL_DEBUG +CONFIG_SMP_TRACE_LEVEL_VERBOSE CONFIG_BT_LOG_SMP_TRACE_LEVEL_VERBOSE +CONFIG_BTIF_INITIAL_TRACE_LEVEL CONFIG_BT_LOG_BTIF_TRACE_LEVEL +CONFIG_BTIF_TRACE_LEVEL_NONE CONFIG_BT_LOG_BTIF_TRACE_LEVEL_NONE +CONFIG_BTIF_TRACE_LEVEL_ERROR CONFIG_BT_LOG_BTIF_TRACE_LEVEL_ERROR +CONFIG_BTIF_TRACE_LEVEL_WARNING CONFIG_BT_LOG_BTIF_TRACE_LEVEL_WARNING +CONFIG_BTIF_TRACE_LEVEL_API CONFIG_BT_LOG_BTIF_TRACE_LEVEL_API +CONFIG_BTIF_TRACE_LEVEL_EVENT CONFIG_BT_LOG_BTIF_TRACE_LEVEL_EVENT +CONFIG_BTIF_TRACE_LEVEL_DEBUG CONFIG_BT_LOG_BTIF_TRACE_LEVEL_DEBUG +CONFIG_BTIF_TRACE_LEVEL_VERBOSE CONFIG_BT_LOG_BTIF_TRACE_LEVEL_VERBOSE +CONFIG_BTC_INITIAL_TRACE_LEVEL CONFIG_BT_LOG_BTC_TRACE_LEVEL +CONFIG_BTC_TRACE_LEVEL_NONE CONFIG_BT_LOG_BTC_TRACE_LEVEL_NONE +CONFIG_BTC_TRACE_LEVEL_ERROR CONFIG_BT_LOG_BTC_TRACE_LEVEL_ERROR +CONFIG_BTC_TRACE_LEVEL_WARNING CONFIG_BT_LOG_BTC_TRACE_LEVEL_WARNING +CONFIG_BTC_TRACE_LEVEL_API CONFIG_BT_LOG_BTC_TRACE_LEVEL_API +CONFIG_BTC_TRACE_LEVEL_EVENT CONFIG_BT_LOG_BTC_TRACE_LEVEL_EVENT +CONFIG_BTC_TRACE_LEVEL_DEBUG CONFIG_BT_LOG_BTC_TRACE_LEVEL_DEBUG +CONFIG_BTC_TRACE_LEVEL_VERBOSE CONFIG_BT_LOG_BTC_TRACE_LEVEL_VERBOSE +CONFIG_OSI_INITIAL_TRACE_LEVEL CONFIG_BT_LOG_OSI_TRACE_LEVEL +CONFIG_OSI_TRACE_LEVEL_NONE CONFIG_BT_LOG_OSI_TRACE_LEVEL_NONE +CONFIG_OSI_TRACE_LEVEL_ERROR CONFIG_BT_LOG_OSI_TRACE_LEVEL_ERROR +CONFIG_OSI_TRACE_LEVEL_WARNING CONFIG_BT_LOG_OSI_TRACE_LEVEL_WARNING +CONFIG_OSI_TRACE_LEVEL_API CONFIG_BT_LOG_OSI_TRACE_LEVEL_API +CONFIG_OSI_TRACE_LEVEL_EVENT CONFIG_BT_LOG_OSI_TRACE_LEVEL_EVENT +CONFIG_OSI_TRACE_LEVEL_DEBUG CONFIG_BT_LOG_OSI_TRACE_LEVEL_DEBUG +CONFIG_OSI_TRACE_LEVEL_VERBOSE CONFIG_BT_LOG_OSI_TRACE_LEVEL_VERBOSE +CONFIG_BLUFI_INITIAL_TRACE_LEVEL CONFIG_BT_LOG_BLUFI_TRACE_LEVEL +CONFIG_BLUFI_TRACE_LEVEL_NONE CONFIG_BT_LOG_BLUFI_TRACE_LEVEL_NONE +CONFIG_BLUFI_TRACE_LEVEL_ERROR CONFIG_BT_LOG_BLUFI_TRACE_LEVEL_ERROR +CONFIG_BLUFI_TRACE_LEVEL_WARNING CONFIG_BT_LOG_BLUFI_TRACE_LEVEL_WARNING +CONFIG_BLUFI_TRACE_LEVEL_API CONFIG_BT_LOG_BLUFI_TRACE_LEVEL_API +CONFIG_BLUFI_TRACE_LEVEL_EVENT CONFIG_BT_LOG_BLUFI_TRACE_LEVEL_EVENT +CONFIG_BLUFI_TRACE_LEVEL_DEBUG CONFIG_BT_LOG_BLUFI_TRACE_LEVEL_DEBUG +CONFIG_BLUFI_TRACE_LEVEL_VERBOSE CONFIG_BT_LOG_BLUFI_TRACE_LEVEL_VERBOSE + +CONFIG_BLE_HOST_QUEUE_CONGESTION_CHECK CONFIG_BT_BLE_HOST_QUEUE_CONG_CHECK +CONFIG_SMP_ENABLE CONFIG_BT_SMP_ENABLE +CONFIG_BLE_ACTIVE_SCAN_REPORT_ADV_SCAN_RSP_INDIVIDUALLY CONFIG_BT_BLE_ACT_SCAN_REP_ADV_SCAN +CONFIG_BLE_ESTABLISH_LINK_CONNECTION_TIMEOUT CONFIG_BT_BLE_ESTAB_LINK_CONN_TOUT diff --git a/components/protocomm/CMakeLists.txt b/components/protocomm/CMakeLists.txt index ec3a7365b..9f9343815 100644 --- a/components/protocomm/CMakeLists.txt +++ b/components/protocomm/CMakeLists.txt @@ -15,7 +15,7 @@ set(COMPONENT_SRCS "src/common/protocomm.c" set(COMPONENT_PRIV_REQUIRES protobuf-c mbedtls console esp_http_server bt) if(CONFIG_BT_ENABLED) - if(CONFIG_BLUEDROID_ENABLED) + if(CONFIG_BT_BLUEDROID_ENABLED) list(APPEND COMPONENT_SRCS "src/simple_ble/simple_ble.c" "src/transports/protocomm_ble.c") diff --git a/components/protocomm/component.mk b/components/protocomm/component.mk index 3ed61cbc1..918fed4de 100644 --- a/components/protocomm/component.mk +++ b/components/protocomm/component.mk @@ -2,6 +2,6 @@ COMPONENT_ADD_INCLUDEDIRS := include/common include/security include/transports COMPONENT_PRIV_INCLUDEDIRS := proto-c src/common src/simple_ble COMPONENT_SRCDIRS := src/common src/security proto-c src/simple_ble src/transports -ifneq ($(filter y, $(CONFIG_BT_ENABLED) $(CONFIG_BLUEDROID_ENABLED)),y y) +ifneq ($(filter y, $(CONFIG_BT_ENABLED) $(CONFIG_BT_BLUEDROID_ENABLED)),y y) COMPONENT_OBJEXCLUDE := src/simple_ble/simple_ble.o src/transports/protocomm_ble.o endif diff --git a/components/protocomm/src/simple_ble/simple_ble.c b/components/protocomm/src/simple_ble/simple_ble.c index ee5091168..ff57b9595 100644 --- a/components/protocomm/src/simple_ble/simple_ble.c +++ b/components/protocomm/src/simple_ble/simple_ble.c @@ -210,9 +210,9 @@ esp_err_t simple_ble_start(simple_ble_cfg_t *cfg) return ret; } -#ifdef CONFIG_BTDM_CONTROLLER_MODE_BTDM +#ifdef CONFIG_BTDM_CTRL_MODE_BTDM ret = esp_bt_controller_enable(ESP_BT_MODE_BTDM); -#elif defined CONFIG_BTDM_CONTROLLER_MODE_BLE_ONLY +#elif defined CONFIG_BTDM_CTRL_MODE_BLE_ONLY ret = esp_bt_controller_enable(ESP_BT_MODE_BLE); #else ESP_LOGE(TAG, "Configuration mismatch. Select BLE Only or BTDM mode from menuconfig"); diff --git a/components/soc/include/soc/soc_memory_layout.h b/components/soc/include/soc/soc_memory_layout.h index 87454aa5c..118f1d3ac 100644 --- a/components/soc/include/soc/soc_memory_layout.h +++ b/components/soc/include/soc/soc_memory_layout.h @@ -48,7 +48,7 @@ #define SOC_MEM_BT_EM_PER_SYNC_SIZE 0x870 -#define SOC_MEM_BT_EM_BREDR_REAL_END (SOC_MEM_BT_EM_BREDR_NO_SYNC_END + CONFIG_BTDM_CONTROLLER_BR_EDR_MAX_SYNC_CONN_EFF * SOC_MEM_BT_EM_PER_SYNC_SIZE) +#define SOC_MEM_BT_EM_BREDR_REAL_END (SOC_MEM_BT_EM_BREDR_NO_SYNC_END + CONFIG_BTDM_CTRL_BR_EDR_MAX_SYNC_CONN_EFF * SOC_MEM_BT_EM_PER_SYNC_SIZE) #endif //CONFIG_BT_ENABLED diff --git a/examples/bluetooth/a2dp_gatts_coex/sdkconfig.defaults b/examples/bluetooth/a2dp_gatts_coex/sdkconfig.defaults index 1a4822bb3..9c42997e1 100644 --- a/examples/bluetooth/a2dp_gatts_coex/sdkconfig.defaults +++ b/examples/bluetooth/a2dp_gatts_coex/sdkconfig.defaults @@ -1,32 +1,32 @@ # Override some defaults so BT stack is enabled and # Classic BT is enabled and BT_DRAM_RELEASE is disabled CONFIG_BT_ENABLED=y -CONFIG_BTDM_CONTROLLER_MODE_BLE_ONLY= -CONFIG_BTDM_CONTROLLER_MODE_BR_EDR_ONLY= -CONFIG_BTDM_CONTROLLER_MODE_BTDM=y -CONFIG_BTDM_CONTROLLER_PINNED_TO_CORE_0=y -CONFIG_BTDM_CONTROLLER_PINNED_TO_CORE_1=n -CONFIG_BTDM_CONTROLLER_PINNED_TO_CORE=0 -CONFIG_BTDM_CONTROLLER_HCI_MODE_VHCI=y -CONFIG_BTDM_CONTROLLER_HCI_MODE_UART_H4=n -CONFIG_BLUEDROID_ENABLED=y -CONFIG_BLUEDROID_PINNED_TO_CORE_0=y -CONFIG_BLUEDROID_PINNED_TO_CORE_1=n -CONFIG_BLUEDROID_PINNED_TO_CORE=0 -CONFIG_BTC_TASK_STACK_SIZE=3072 -CONFIG_BLUEDROID_MEM_DEBUG=n -CONFIG_CLASSIC_BT_ENABLED=y -CONFIG_A2DP_ENABLE=y +CONFIG_BTDM_CTRL_MODE_BLE_ONLY= +CONFIG_BTDM_CTRL_MODE_BR_EDR_ONLY= +CONFIG_BTDM_CTRL_MODE_BTDM=y +CONFIG_BTDM_CTRL_PINNED_TO_CORE_0=y +CONFIG_BTDM_CTRL_PINNED_TO_CORE_1=n +CONFIG_BTDM_CTRL_PINNED_TO_CORE=0 +CONFIG_BTDM_CTRL_HCI_MODE_VHCI=y +CONFIG_BTDM_CTRL_HCI_MODE_UART_H4=n +CONFIG_BT_BLUEDROID_ENABLED=y +CONFIG_BT_BLUEDROID_PINNED_TO_CORE_0=y +CONFIG_BT_BLUEDROID_PINNED_TO_CORE_1=n +CONFIG_BT_BLUEDROID_PINNED_TO_CORE=0 +CONFIG_BT_BTC_TASK_STACK_SIZE=3072 +CONFIG_BT_BLUEDROID_MEM_DEBUG=n +CONFIG_BT_CLASSIC_ENABLED=y +CONFIG_BT_A2DP_ENABLE=y CONFIG_A2DP_SINK_ENABLE=y CONFIG_A2DP_SRC_ENABLE=n -CONFIG_A2DP_SINK_TASK_STACK_SIZE=2048 +CONFIG_BT_A2DP_SINK_TASK_STACK_SIZE=2048 CONFIG_BT_SPP_ENABLED=n -CONFIG_GATTS_ENABLE=y -CONFIG_GATTC_ENABLE=n -CONFIG_BLE_SMP_ENABLE=n +CONFIG_BT_GATTS_ENABLE=y +CONFIG_BT_GATTC_ENABLE=n +CONFIG_BT_BLE_SMP_ENABLE=n CONFIG_BLE_ENABLE_SRVCHG_REG=y CONFIG_BT_STACK_NO_LOG=n CONFIG_BT_ACL_CONNECTIONS=4 CONFIG_BT_ALLOCATION_FROM_SPIRAM_FIRST=n CONFIG_BT_BLE_DYNAMIC_ENV_MEMORY=n -CONFIG_SMP_ENABLE=y +CONFIG_BT_SMP_ENABLE=y diff --git a/examples/bluetooth/a2dp_sink/sdkconfig.defaults b/examples/bluetooth/a2dp_sink/sdkconfig.defaults index 193dc1c8d..132f512cb 100644 --- a/examples/bluetooth/a2dp_sink/sdkconfig.defaults +++ b/examples/bluetooth/a2dp_sink/sdkconfig.defaults @@ -1,13 +1,13 @@ # Override some defaults so BT stack is enabled and # Classic BT is enabled and BT_DRAM_RELEASE is disabled CONFIG_BT_ENABLED=y -CONFIG_BTDM_CONTROLLER_MODE_BLE_ONLY= -CONFIG_BTDM_CONTROLLER_MODE_BR_EDR_ONLY=y -CONFIG_BTDM_CONTROLLER_MODE_BTDM= -CONFIG_BLUEDROID_ENABLED=y -CONFIG_CLASSIC_BT_ENABLED=y -CONFIG_A2DP_ENABLE=y +CONFIG_BTDM_CTRL_MODE_BLE_ONLY= +CONFIG_BTDM_CTRL_MODE_BR_EDR_ONLY=y +CONFIG_BTDM_CTRL_MODE_BTDM= +CONFIG_BT_BLUEDROID_ENABLED=y +CONFIG_BT_CLASSIC_ENABLED=y +CONFIG_BT_A2DP_ENABLE=y CONFIG_BT_SPP_ENABLED=n -CONFIG_GATTS_ENABLE=n -CONFIG_GATTC_ENABLE=n -CONFIG_BLE_SMP_ENABLE=n +CONFIG_BT_GATTS_ENABLE=n +CONFIG_BT_GATTC_ENABLE=n +CONFIG_BT_BLE_SMP_ENABLE=n diff --git a/examples/bluetooth/a2dp_source/sdkconfig.defaults b/examples/bluetooth/a2dp_source/sdkconfig.defaults index 7741a3428..fbee62650 100644 --- a/examples/bluetooth/a2dp_source/sdkconfig.defaults +++ b/examples/bluetooth/a2dp_source/sdkconfig.defaults @@ -1,13 +1,13 @@ # Override some defaults so BT stack is enabled and # Classic BT is enabled CONFIG_BT_ENABLED=y -CONFIG_BTDM_CONTROLLER_MODE_BLE_ONLY= -CONFIG_BTDM_CONTROLLER_MODE_BR_EDR_ONLY=y -CONFIG_BTDM_CONTROLLER_MODE_BTDM= -CONFIG_BLUEDROID_ENABLED=y -CONFIG_CLASSIC_BT_ENABLED=y -CONFIG_A2DP_ENABLE=y +CONFIG_BTDM_CTRL_MODE_BLE_ONLY= +CONFIG_BTDM_CTRL_MODE_BR_EDR_ONLY=y +CONFIG_BTDM_CTRL_MODE_BTDM= +CONFIG_BT_BLUEDROID_ENABLED=y +CONFIG_BT_CLASSIC_ENABLED=y +CONFIG_BT_A2DP_ENABLE=y CONFIG_BT_SPP_ENABLED=n -CONFIG_GATTS_ENABLE=n -CONFIG_GATTC_ENABLE=n -CONFIG_BLE_SMP_ENABLE=n +CONFIG_BT_GATTS_ENABLE=n +CONFIG_BT_GATTC_ENABLE=n +CONFIG_BT_BLE_SMP_ENABLE=n diff --git a/examples/bluetooth/ble_adv/sdkconfig.defaults b/examples/bluetooth/ble_adv/sdkconfig.defaults index c617298b5..b3e403222 100644 --- a/examples/bluetooth/ble_adv/sdkconfig.defaults +++ b/examples/bluetooth/ble_adv/sdkconfig.defaults @@ -5,6 +5,6 @@ # BT config # CONFIG_BT_ENABLED=y -CONFIG_BTDM_CONTROLLER_MODE_BLE_ONLY=y -CONFIG_BTDM_CONTROLLER_MODE_BR_EDR_ONLY= -CONFIG_BTDM_CONTROLLER_MODE_BTDM= +CONFIG_BTDM_CTRL_MODE_BLE_ONLY=y +CONFIG_BTDM_CTRL_MODE_BR_EDR_ONLY= +CONFIG_BTDM_CTRL_MODE_BTDM= diff --git a/examples/bluetooth/ble_eddystone/sdkconfig.defaults b/examples/bluetooth/ble_eddystone/sdkconfig.defaults index 9ea420884..f0f9acf9f 100644 --- a/examples/bluetooth/ble_eddystone/sdkconfig.defaults +++ b/examples/bluetooth/ble_eddystone/sdkconfig.defaults @@ -1,6 +1,6 @@ # Override some defaults so BT stack is enabled # and WiFi disabled by default in this example CONFIG_BT_ENABLED=y -CONFIG_BTDM_CONTROLLER_MODE_BLE_ONLY=y -CONFIG_BTDM_CONTROLLER_MODE_BR_EDR_ONLY= -CONFIG_BTDM_CONTROLLER_MODE_BTDM= +CONFIG_BTDM_CTRL_MODE_BLE_ONLY=y +CONFIG_BTDM_CTRL_MODE_BR_EDR_ONLY= +CONFIG_BTDM_CTRL_MODE_BTDM= diff --git a/examples/bluetooth/ble_hid_device_demo/sdkconfig.defaults b/examples/bluetooth/ble_hid_device_demo/sdkconfig.defaults index 50fc4ba9d..8dbe56f4f 100644 --- a/examples/bluetooth/ble_hid_device_demo/sdkconfig.defaults +++ b/examples/bluetooth/ble_hid_device_demo/sdkconfig.defaults @@ -1,6 +1,6 @@ # Override some defaults so BT stack is enabled # by default in this example CONFIG_BT_ENABLED=y -CONFIG_BTDM_CONTROLLER_MODE_BLE_ONLY=y -CONFIG_BTDM_CONTROLLER_MODE_BR_EDR_ONLY= -CONFIG_BTDM_CONTROLLER_MODE_BTDM= +CONFIG_BTDM_CTRL_MODE_BLE_ONLY=y +CONFIG_BTDM_CTRL_MODE_BR_EDR_ONLY= +CONFIG_BTDM_CTRL_MODE_BTDM= diff --git a/examples/bluetooth/ble_ibeacon/sdkconfig.defaults b/examples/bluetooth/ble_ibeacon/sdkconfig.defaults index 9ea420884..f0f9acf9f 100644 --- a/examples/bluetooth/ble_ibeacon/sdkconfig.defaults +++ b/examples/bluetooth/ble_ibeacon/sdkconfig.defaults @@ -1,6 +1,6 @@ # Override some defaults so BT stack is enabled # and WiFi disabled by default in this example CONFIG_BT_ENABLED=y -CONFIG_BTDM_CONTROLLER_MODE_BLE_ONLY=y -CONFIG_BTDM_CONTROLLER_MODE_BR_EDR_ONLY= -CONFIG_BTDM_CONTROLLER_MODE_BTDM= +CONFIG_BTDM_CTRL_MODE_BLE_ONLY=y +CONFIG_BTDM_CTRL_MODE_BR_EDR_ONLY= +CONFIG_BTDM_CTRL_MODE_BTDM= diff --git a/examples/bluetooth/ble_spp_client/sdkconfig.defaults b/examples/bluetooth/ble_spp_client/sdkconfig.defaults index 9ea420884..f0f9acf9f 100644 --- a/examples/bluetooth/ble_spp_client/sdkconfig.defaults +++ b/examples/bluetooth/ble_spp_client/sdkconfig.defaults @@ -1,6 +1,6 @@ # Override some defaults so BT stack is enabled # and WiFi disabled by default in this example CONFIG_BT_ENABLED=y -CONFIG_BTDM_CONTROLLER_MODE_BLE_ONLY=y -CONFIG_BTDM_CONTROLLER_MODE_BR_EDR_ONLY= -CONFIG_BTDM_CONTROLLER_MODE_BTDM= +CONFIG_BTDM_CTRL_MODE_BLE_ONLY=y +CONFIG_BTDM_CTRL_MODE_BR_EDR_ONLY= +CONFIG_BTDM_CTRL_MODE_BTDM= diff --git a/examples/bluetooth/ble_spp_server/sdkconfig.defaults b/examples/bluetooth/ble_spp_server/sdkconfig.defaults index 87546674f..ee02dcb06 100644 --- a/examples/bluetooth/ble_spp_server/sdkconfig.defaults +++ b/examples/bluetooth/ble_spp_server/sdkconfig.defaults @@ -5,9 +5,9 @@ # BT config # CONFIG_BT_ENABLED=y -CONFIG_BTDM_CONTROLLER_MODE_BLE_ONLY=y -CONFIG_BTDM_CONTROLLER_MODE_BR_EDR_ONLY= -CONFIG_BTDM_CONTROLLER_MODE_BTDM= +CONFIG_BTDM_CTRL_MODE_BLE_ONLY=y +CONFIG_BTDM_CTRL_MODE_BR_EDR_ONLY= +CONFIG_BTDM_CTRL_MODE_BTDM= # # ESP32-specific config # diff --git a/examples/bluetooth/ble_throughput/throughput_client/sdkconfig.defaults b/examples/bluetooth/ble_throughput/throughput_client/sdkconfig.defaults index 6d5a62b19..fd65ffed2 100644 --- a/examples/bluetooth/ble_throughput/throughput_client/sdkconfig.defaults +++ b/examples/bluetooth/ble_throughput/throughput_client/sdkconfig.defaults @@ -1,14 +1,14 @@ # Override some defaults so BT stack is enabled # by default in this example CONFIG_BT_ENABLED=y -CONFIG_BTDM_CONTROLLER_MODE_BLE_ONLY=y -CONFIG_BTDM_CONTROLLER_MODE_BR_EDR_ONLY= -CONFIG_BTDM_CONTROLLER_MODE_BTDM= -CONFIG_BTDM_CONTROLLER_BLE_MAX_CONN=9 +CONFIG_BTDM_CTRL_MODE_BLE_ONLY=y +CONFIG_BTDM_CTRL_MODE_BR_EDR_ONLY= +CONFIG_BTDM_CTRL_MODE_BTDM= +CONFIG_BTDM_CTRL_BLE_MAX_CONN=9 CONFIG_GATTS_NOTIFY_THROUGHPUT=y -CONFIG_BTDM_CONTROLLER_MODEM_SLEEP=n -CONFIG_BTDM_CONTROLLER_PINNED_TO_CORE_1=y -CONFIG_BTDM_CONTROLLER_PINNED_TO_CORE=1 +CONFIG_BTDM_MODEM_SLEEP=n +CONFIG_BTDM_CTRL_PINNED_TO_CORE_1=y +CONFIG_BTDM_CTRL_PINNED_TO_CORE=1 # # Serial flasher config # diff --git a/examples/bluetooth/ble_throughput/throughput_server/sdkconfig.defaults b/examples/bluetooth/ble_throughput/throughput_server/sdkconfig.defaults index 6d5a62b19..fd65ffed2 100644 --- a/examples/bluetooth/ble_throughput/throughput_server/sdkconfig.defaults +++ b/examples/bluetooth/ble_throughput/throughput_server/sdkconfig.defaults @@ -1,14 +1,14 @@ # Override some defaults so BT stack is enabled # by default in this example CONFIG_BT_ENABLED=y -CONFIG_BTDM_CONTROLLER_MODE_BLE_ONLY=y -CONFIG_BTDM_CONTROLLER_MODE_BR_EDR_ONLY= -CONFIG_BTDM_CONTROLLER_MODE_BTDM= -CONFIG_BTDM_CONTROLLER_BLE_MAX_CONN=9 +CONFIG_BTDM_CTRL_MODE_BLE_ONLY=y +CONFIG_BTDM_CTRL_MODE_BR_EDR_ONLY= +CONFIG_BTDM_CTRL_MODE_BTDM= +CONFIG_BTDM_CTRL_BLE_MAX_CONN=9 CONFIG_GATTS_NOTIFY_THROUGHPUT=y -CONFIG_BTDM_CONTROLLER_MODEM_SLEEP=n -CONFIG_BTDM_CONTROLLER_PINNED_TO_CORE_1=y -CONFIG_BTDM_CONTROLLER_PINNED_TO_CORE=1 +CONFIG_BTDM_MODEM_SLEEP=n +CONFIG_BTDM_CTRL_PINNED_TO_CORE_1=y +CONFIG_BTDM_CTRL_PINNED_TO_CORE=1 # # Serial flasher config # diff --git a/examples/bluetooth/blufi/sdkconfig.defaults b/examples/bluetooth/blufi/sdkconfig.defaults index f0f3f8c1a..aba8be090 100644 --- a/examples/bluetooth/blufi/sdkconfig.defaults +++ b/examples/bluetooth/blufi/sdkconfig.defaults @@ -5,27 +5,27 @@ # BT config # CONFIG_BT_ENABLED=y -CONFIG_BTDM_CONTROLLER_MODE_BLE_ONLY=y -CONFIG_BTDM_CONTROLLER_MODE_BR_EDR_ONLY= -CONFIG_BTDM_CONTROLLER_MODE_BTDM= -CONFIG_BTDM_CONTROLLER_PINNED_TO_CORE_0=y -CONFIG_BTDM_CONTROLLER_PINNED_TO_CORE_1=n -CONFIG_BTDM_CONTROLLER_PINNED_TO_CORE=0 -CONFIG_BTDM_CONTROLLER_HCI_MODE_VHCI=y -CONFIG_BTDM_CONTROLLER_HCI_MODE_UART_H4=n -CONFIG_BLUEDROID_ENABLED=y -CONFIG_BLUEDROID_PINNED_TO_CORE_0=y -CONFIG_BLUEDROID_PINNED_TO_CORE_1=n -CONFIG_BLUEDROID_PINNED_TO_CORE=0 -CONFIG_BTC_TASK_STACK_SIZE=3072 -CONFIG_BLUEDROID_MEM_DEBUG=n -CONFIG_CLASSIC_BT_ENABLED=n -CONFIG_GATTS_ENABLE=y -CONFIG_GATTC_ENABLE=n -CONFIG_BLE_SMP_ENABLE=n -CONFIG_BLE_ENABLE_SRVCHG_REG=y +CONFIG_BTDM_CTRL_MODE_BLE_ONLY=y +CONFIG_BTDM_CTRL_MODE_BR_EDR_ONLY= +CONFIG_BTDM_CTRL_MODE_BTDM= +CONFIG_BTDM_CTRL_PINNED_TO_CORE_0=y +CONFIG_BTDM_CTRL_PINNED_TO_CORE_1=n +CONFIG_BTDM_CTRL_PINNED_TO_CORE=0 +CONFIG_BTDM_CTRL_HCI_MODE_VHCI=y +CONFIG_BTDM_CTRL_HCI_MODE_UART_H4=n +CONFIG_BT_BLUEDROID_ENABLED=y +CONFIG_BT_BLUEDROID_PINNED_TO_CORE_0=y +CONFIG_BT_BLUEDROID_PINNED_TO_CORE_1=n +CONFIG_BT_BLUEDROID_PINNED_TO_CORE=0 +CONFIG_BT_BTC_TASK_STACK_SIZE=3072 +CONFIG_BT_BLUEDROID_MEM_DEBUG=n +CONFIG_BT_CLASSIC_ENABLED=n +CONFIG_BT_GATTS_ENABLE=y +CONFIG_BT_GATTC_ENABLE=n +CONFIG_BT_BLE_SMP_ENABLE=n +CONFIG_BL_ENABLE_SRVCHG_REG=y CONFIG_BT_STACK_NO_LOG=n CONFIG_BT_ACL_CONNECTIONS=4 CONFIG_BT_ALLOCATION_FROM_SPIRAM_FIRST=n CONFIG_BT_BLE_DYNAMIC_ENV_MEMORY=n -CONFIG_SMP_ENABLE=n +CONFIG_BT_SMP_ENABLE=n diff --git a/examples/bluetooth/bt_discovery/sdkconfig.defaults b/examples/bluetooth/bt_discovery/sdkconfig.defaults index 2c792c747..af5b5d9d6 100644 --- a/examples/bluetooth/bt_discovery/sdkconfig.defaults +++ b/examples/bluetooth/bt_discovery/sdkconfig.defaults @@ -1,11 +1,11 @@ # Override some defaults so BT stack is enabled and # Classic BT is enabled and BT_DRAM_RELEASE is disabled CONFIG_BT_ENABLED=y -CONFIG_BTDM_CONTROLLER_MODE_BLE_ONLY= -CONFIG_BTDM_CONTROLLER_MODE_BR_EDR_ONLY=y -CONFIG_BTDM_CONTROLLER_MODE_BTDM= -CONFIG_CLASSIC_BT_ENABLED=y -CONFIG_A2DP_ENABLE=n -CONFIG_GATTS_ENABLE=n -CONFIG_GATTC_ENABLE=n -CONFIG_BLE_SMP_ENABLE=n +CONFIG_BTDM_CTRL_MODE_BLE_ONLY= +CONFIG_BTDM_CTRL_MODE_BR_EDR_ONLY=y +CONFIG_BTDM_CTRL_MODE_BTDM= +CONFIG_BT_CLASSIC_ENABLED=y +CONFIG_BT_A2DP_ENABLE=n +CONFIG_BT_GATTS_ENABLE=n +CONFIG_BT_GATTC_ENABLE=n +CONFIG_BT_BLE_SMP_ENABLE=n diff --git a/examples/bluetooth/bt_spp_acceptor/sdkconfig.defaults b/examples/bluetooth/bt_spp_acceptor/sdkconfig.defaults index dbd886f79..732042822 100644 --- a/examples/bluetooth/bt_spp_acceptor/sdkconfig.defaults +++ b/examples/bluetooth/bt_spp_acceptor/sdkconfig.defaults @@ -1,9 +1,9 @@ # Override some defaults so BT stack is enabled # and WiFi disabled by default in this example CONFIG_BT_ENABLED=y -CONFIG_BTDM_CONTROLLER_MODE_BLE_ONLY= -CONFIG_BTDM_CONTROLLER_MODE_BR_EDR_ONLY=y -CONFIG_BTDM_CONTROLLER_MODE_BTDM= -CONFIG_CLASSIC_BT_ENABLED=y +CONFIG_BTDM_CTRL_MODE_BLE_ONLY= +CONFIG_BTDM_CTRL_MODE_BR_EDR_ONLY=y +CONFIG_BTDM_CTRL_MODE_BTDM= +CONFIG_BT_CLASSIC_ENABLED=y CONFIG_WIFI_ENABLED=n CONFIG_BT_SPP_ENABLED=y diff --git a/examples/bluetooth/bt_spp_initiator/sdkconfig.defaults b/examples/bluetooth/bt_spp_initiator/sdkconfig.defaults index dbd886f79..732042822 100644 --- a/examples/bluetooth/bt_spp_initiator/sdkconfig.defaults +++ b/examples/bluetooth/bt_spp_initiator/sdkconfig.defaults @@ -1,9 +1,9 @@ # Override some defaults so BT stack is enabled # and WiFi disabled by default in this example CONFIG_BT_ENABLED=y -CONFIG_BTDM_CONTROLLER_MODE_BLE_ONLY= -CONFIG_BTDM_CONTROLLER_MODE_BR_EDR_ONLY=y -CONFIG_BTDM_CONTROLLER_MODE_BTDM= -CONFIG_CLASSIC_BT_ENABLED=y +CONFIG_BTDM_CTRL_MODE_BLE_ONLY= +CONFIG_BTDM_CTRL_MODE_BR_EDR_ONLY=y +CONFIG_BTDM_CTRL_MODE_BTDM= +CONFIG_BT_CLASSIC_ENABLED=y CONFIG_WIFI_ENABLED=n CONFIG_BT_SPP_ENABLED=y diff --git a/examples/bluetooth/bt_spp_vfs_acceptor/sdkconfig.defaults b/examples/bluetooth/bt_spp_vfs_acceptor/sdkconfig.defaults index dbd886f79..732042822 100644 --- a/examples/bluetooth/bt_spp_vfs_acceptor/sdkconfig.defaults +++ b/examples/bluetooth/bt_spp_vfs_acceptor/sdkconfig.defaults @@ -1,9 +1,9 @@ # Override some defaults so BT stack is enabled # and WiFi disabled by default in this example CONFIG_BT_ENABLED=y -CONFIG_BTDM_CONTROLLER_MODE_BLE_ONLY= -CONFIG_BTDM_CONTROLLER_MODE_BR_EDR_ONLY=y -CONFIG_BTDM_CONTROLLER_MODE_BTDM= -CONFIG_CLASSIC_BT_ENABLED=y +CONFIG_BTDM_CTRL_MODE_BLE_ONLY= +CONFIG_BTDM_CTRL_MODE_BR_EDR_ONLY=y +CONFIG_BTDM_CTRL_MODE_BTDM= +CONFIG_BT_CLASSIC_ENABLED=y CONFIG_WIFI_ENABLED=n CONFIG_BT_SPP_ENABLED=y diff --git a/examples/bluetooth/bt_spp_vfs_initiator/sdkconfig.defaults b/examples/bluetooth/bt_spp_vfs_initiator/sdkconfig.defaults index dbd886f79..732042822 100644 --- a/examples/bluetooth/bt_spp_vfs_initiator/sdkconfig.defaults +++ b/examples/bluetooth/bt_spp_vfs_initiator/sdkconfig.defaults @@ -1,9 +1,9 @@ # Override some defaults so BT stack is enabled # and WiFi disabled by default in this example CONFIG_BT_ENABLED=y -CONFIG_BTDM_CONTROLLER_MODE_BLE_ONLY= -CONFIG_BTDM_CONTROLLER_MODE_BR_EDR_ONLY=y -CONFIG_BTDM_CONTROLLER_MODE_BTDM= -CONFIG_CLASSIC_BT_ENABLED=y +CONFIG_BTDM_CTRL_MODE_BLE_ONLY= +CONFIG_BTDM_CTRL_MODE_BR_EDR_ONLY=y +CONFIG_BTDM_CTRL_MODE_BTDM= +CONFIG_BT_CLASSIC_ENABLED=y CONFIG_WIFI_ENABLED=n CONFIG_BT_SPP_ENABLED=y diff --git a/examples/bluetooth/controller_hci_uart/sdkconfig.defaults b/examples/bluetooth/controller_hci_uart/sdkconfig.defaults index 51fe6ac90..13c28e405 100644 --- a/examples/bluetooth/controller_hci_uart/sdkconfig.defaults +++ b/examples/bluetooth/controller_hci_uart/sdkconfig.defaults @@ -5,13 +5,13 @@ # BT config # CONFIG_BT_ENABLED=y -CONFIG_BTDM_CONTROLLER_MODE_BLE_ONLY= -CONFIG_BTDM_CONTROLLER_MODE_BR_EDR_ONLY= -CONFIG_BTDM_CONTROLLER_MODE_BTDM=y -CONFIG_BTDM_CONTROLLER_BLE_MAX_CONN=9 -CONFIG_BTDM_CONTROLLER_BR_EDR_MAX_ACL_CONN=7 -CONFIG_BTDM_CONTROLLER_BR_EDR_MAX_SYNC_CONN=3 -CONFIG_BLUEDROID_ENABLED=n +CONFIG_BTDM_CTRL_MODE_BLE_ONLY= +CONFIG_BTDM_CTRL_MODE_BR_EDR_ONLY= +CONFIG_BTDM_CTRL_MODE_BTDM=y +CONFIG_BTDM_CTRL_BLE_MAX_CONN=9 +CONFIG_BTDM_CTRL_BR_EDR_MAX_ACL_CONN=7 +CONFIG_BTDM_CTRL_BR_EDR_MAX_SYNC_CONN=3 +CONFIG_BT_BLUEDROID_ENABLED=n CONFIG_BT_HCI_UART=y CONFIG_BT_HCI_UART_NO_DEFAULT=1 CONFIG_BT_HCI_UART_BAUDRATE_DEFAULT=921600 diff --git a/examples/bluetooth/gatt_client/sdkconfig.defaults b/examples/bluetooth/gatt_client/sdkconfig.defaults index 50fc4ba9d..8dbe56f4f 100644 --- a/examples/bluetooth/gatt_client/sdkconfig.defaults +++ b/examples/bluetooth/gatt_client/sdkconfig.defaults @@ -1,6 +1,6 @@ # Override some defaults so BT stack is enabled # by default in this example CONFIG_BT_ENABLED=y -CONFIG_BTDM_CONTROLLER_MODE_BLE_ONLY=y -CONFIG_BTDM_CONTROLLER_MODE_BR_EDR_ONLY= -CONFIG_BTDM_CONTROLLER_MODE_BTDM= +CONFIG_BTDM_CTRL_MODE_BLE_ONLY=y +CONFIG_BTDM_CTRL_MODE_BR_EDR_ONLY= +CONFIG_BTDM_CTRL_MODE_BTDM= diff --git a/examples/bluetooth/gatt_security_client/sdkconfig.defaults b/examples/bluetooth/gatt_security_client/sdkconfig.defaults index 9ea420884..f0f9acf9f 100644 --- a/examples/bluetooth/gatt_security_client/sdkconfig.defaults +++ b/examples/bluetooth/gatt_security_client/sdkconfig.defaults @@ -1,6 +1,6 @@ # Override some defaults so BT stack is enabled # and WiFi disabled by default in this example CONFIG_BT_ENABLED=y -CONFIG_BTDM_CONTROLLER_MODE_BLE_ONLY=y -CONFIG_BTDM_CONTROLLER_MODE_BR_EDR_ONLY= -CONFIG_BTDM_CONTROLLER_MODE_BTDM= +CONFIG_BTDM_CTRL_MODE_BLE_ONLY=y +CONFIG_BTDM_CTRL_MODE_BR_EDR_ONLY= +CONFIG_BTDM_CTRL_MODE_BTDM= diff --git a/examples/bluetooth/gatt_security_server/sdkconfig.defaults b/examples/bluetooth/gatt_security_server/sdkconfig.defaults index 50fc4ba9d..8dbe56f4f 100644 --- a/examples/bluetooth/gatt_security_server/sdkconfig.defaults +++ b/examples/bluetooth/gatt_security_server/sdkconfig.defaults @@ -1,6 +1,6 @@ # Override some defaults so BT stack is enabled # by default in this example CONFIG_BT_ENABLED=y -CONFIG_BTDM_CONTROLLER_MODE_BLE_ONLY=y -CONFIG_BTDM_CONTROLLER_MODE_BR_EDR_ONLY= -CONFIG_BTDM_CONTROLLER_MODE_BTDM= +CONFIG_BTDM_CTRL_MODE_BLE_ONLY=y +CONFIG_BTDM_CTRL_MODE_BR_EDR_ONLY= +CONFIG_BTDM_CTRL_MODE_BTDM= diff --git a/examples/bluetooth/gatt_server/sdkconfig.defaults b/examples/bluetooth/gatt_server/sdkconfig.defaults index 50fc4ba9d..8dbe56f4f 100644 --- a/examples/bluetooth/gatt_server/sdkconfig.defaults +++ b/examples/bluetooth/gatt_server/sdkconfig.defaults @@ -1,6 +1,6 @@ # Override some defaults so BT stack is enabled # by default in this example CONFIG_BT_ENABLED=y -CONFIG_BTDM_CONTROLLER_MODE_BLE_ONLY=y -CONFIG_BTDM_CONTROLLER_MODE_BR_EDR_ONLY= -CONFIG_BTDM_CONTROLLER_MODE_BTDM= +CONFIG_BTDM_CTRL_MODE_BLE_ONLY=y +CONFIG_BTDM_CTRL_MODE_BR_EDR_ONLY= +CONFIG_BTDM_CTRL_MODE_BTDM= diff --git a/examples/bluetooth/gatt_server_service_table/sdkconfig.defaults b/examples/bluetooth/gatt_server_service_table/sdkconfig.defaults index a24c32100..e8587bbc2 100644 --- a/examples/bluetooth/gatt_server_service_table/sdkconfig.defaults +++ b/examples/bluetooth/gatt_server_service_table/sdkconfig.defaults @@ -5,9 +5,9 @@ # BT config # CONFIG_BT_ENABLED=y -CONFIG_BTDM_CONTROLLER_MODE_BLE_ONLY=y -CONFIG_BTDM_CONTROLLER_MODE_BR_EDR_ONLY= -CONFIG_BTDM_CONTROLLER_MODE_BTDM= +CONFIG_BTDM_CTRL_MODE_BLE_ONLY=y +CONFIG_BTDM_CTRL_MODE_BR_EDR_ONLY= +CONFIG_BTDM_CTRL_MODE_BTDM= # # ESP32-specific config diff --git a/examples/bluetooth/gattc_multi_connect/sdkconfig.defaults b/examples/bluetooth/gattc_multi_connect/sdkconfig.defaults index 711312520..0f7207aee 100644 --- a/examples/bluetooth/gattc_multi_connect/sdkconfig.defaults +++ b/examples/bluetooth/gattc_multi_connect/sdkconfig.defaults @@ -1,7 +1,7 @@ # Override some defaults so BT stack is enabled # and WiFi disabled by default in this example CONFIG_BT_ENABLED=y -CONFIG_BTDM_CONTROLLER_MODE_BLE_ONLY=y -CONFIG_BTDM_CONTROLLER_MODE_BR_EDR_ONLY= -CONFIG_BTDM_CONTROLLER_MODE_BTDM= -CONFIG_BTDM_CONTROLLER_BLE_MAX_CONN=9 +CONFIG_BTDM_CTRL_MODE_BLE_ONLY=y +CONFIG_BTDM_CTRL_MODE_BR_EDR_ONLY= +CONFIG_BTDM_CTRL_MODE_BTDM= +CONFIG_BTDM_CTRL_BLE_MAX_CONN=9 diff --git a/examples/provisioning/ble_prov/sdkconfig.defaults b/examples/provisioning/ble_prov/sdkconfig.defaults index 47e578314..e28cc0506 100644 --- a/examples/provisioning/ble_prov/sdkconfig.defaults +++ b/examples/provisioning/ble_prov/sdkconfig.defaults @@ -1,8 +1,8 @@ # Override some defaults so BT stack is enabled and CONFIG_BT_ENABLED=y -CONFIG_BTDM_CONTROLLER_MODE_BLE_ONLY=y -CONFIG_BTDM_CONTROLLER_MODE_BR_EDR_ONLY= -CONFIG_BTDM_CONTROLLER_MODE_BTDM= +CONFIG_BTDM_CTRL_MODE_BLE_ONLY=y +CONFIG_BTDM_CTRL_MODE_BR_EDR_ONLY= +CONFIG_BTDM_CTRL_MODE_BTDM= # Binary is larger than default size CONFIG_PARTITION_TABLE_CUSTOM=y diff --git a/tools/ldgen/samples/sdkconfig b/tools/ldgen/samples/sdkconfig index 9530a7f32..c2c1cceed 100644 --- a/tools/ldgen/samples/sdkconfig +++ b/tools/ldgen/samples/sdkconfig @@ -118,7 +118,7 @@ CONFIG_AWS_IOT_SDK= # Bluetooth # CONFIG_BT_ENABLED= -CONFIG_BTDM_CONTROLLER_PINNED_TO_CORE=0 +CONFIG_BTDM_CTRL_PINNED_TO_CORE=0 CONFIG_BT_RESERVE_DRAM=0 # diff --git a/tools/unit-test-app/configs/bt b/tools/unit-test-app/configs/bt index 9bb486471..4eb4677ec 100644 --- a/tools/unit-test-app/configs/bt +++ b/tools/unit-test-app/configs/bt @@ -1,4 +1,4 @@ TEST_COMPONENTS=bt TEST_EXCLUDE_COMPONENTS=app_update CONFIG_BT_ENABLED=y -CONFIG_UNITY_FREERTOS_STACK_SIZE=12288 \ No newline at end of file +CONFIG_UNITY_FREERTOS_STACK_SIZE=12288 From 6c0a7a66f38aa2e0fb5599f2827f0ff86fb724a3 Mon Sep 17 00:00:00 2001 From: Roland Dobai Date: Thu, 9 May 2019 13:34:34 +0200 Subject: [PATCH 18/21] Rename Kconfig options (components/app_trace) --- components/app_trace/Kconfig | 2 +- components/app_trace/app_trace.c | 3 ++- components/app_trace/sdkconfig.rename | 4 ++++ components/esp32/panic.c | 16 ++++++++-------- docs/en/api-guides/app_trace.rst | 2 +- docs/zh_CN/api-guides/app_trace.rst | 2 +- examples/system/gcov/sdkconfig.defaults | 2 +- 7 files changed, 18 insertions(+), 13 deletions(-) create mode 100644 components/app_trace/sdkconfig.rename diff --git a/components/app_trace/Kconfig b/components/app_trace/Kconfig index adfe6495f..f1fb35edc 100644 --- a/components/app_trace/Kconfig +++ b/components/app_trace/Kconfig @@ -37,7 +37,7 @@ menu "Application Level Tracing" Timeout for flushing last trace data to host in case of panic. In ms. Use -1 to disable timeout and wait forever. - config ESP32_APPTRACE_POSTMORTEM_FLUSH_TRAX_THRESH + config ESP32_APPTRACE_POSTMORTEM_FLUSH_THRESH int "Threshold for flushing last trace data to host on panic" depends on ESP32_APPTRACE_DEST_TRAX range 0 16384 diff --git a/components/app_trace/app_trace.c b/components/app_trace/app_trace.c index 84e39d7b1..e9b832f0c 100644 --- a/components/app_trace/app_trace.c +++ b/components/app_trace/app_trace.c @@ -75,7 +75,8 @@ // trace data are necessary, e.g. for analyzing crashes. On panic the latest data from current input block are exposed to host and host can read them. // It can happen that system panic occurs when there are very small amount of data which are not exposed to host yet (e.g. crash just after the // TRAX block switch). In this case the previous 16KB of collected data will be dropped and host will see the latest, but very small piece of trace. -// It can be insufficient to diagnose the problem. To avoid such situations there is menuconfig option CONFIG_ESP32_APPTRACE_POSTMORTEM_FLUSH_TRAX_THRESH +// It can be insufficient to diagnose the problem. To avoid such situations there is menuconfig option +// CONFIG_ESP32_APPTRACE_POSTMORTEM_FLUSH_THRESH // which controls the threshold for flushing data in case of panic. // - Streaming mode. Tracing module enters this mode when host connects to target and sets respective bits in control registers (per core). // In this mode before switching the block tracing module waits for the host to read all the data from the previously exposed block. diff --git a/components/app_trace/sdkconfig.rename b/components/app_trace/sdkconfig.rename new file mode 100644 index 000000000..418efcf65 --- /dev/null +++ b/components/app_trace/sdkconfig.rename @@ -0,0 +1,4 @@ +# sdkconfig replacement configurations for deprecated options formatted as +# CONFIG_DEPRECATED_OPTION CONFIG_NEW_OPTION + +CONFIG_ESP32_APPTRACE_POSTMORTEM_FLUSH_TRAX_THRESH CONFIG_ESP32_APPTRACE_POSTMORTEM_FLUSH_THRESH diff --git a/components/esp32/panic.c b/components/esp32/panic.c index 719d6f01a..f27d45720 100644 --- a/components/esp32/panic.c +++ b/components/esp32/panic.c @@ -144,9 +144,9 @@ static __attribute__((noreturn)) inline void invoke_abort() abort_called = true; #if CONFIG_ESP32_APPTRACE_ENABLE #if CONFIG_SYSVIEW_ENABLE - SEGGER_RTT_ESP32_FlushNoLock(CONFIG_ESP32_APPTRACE_POSTMORTEM_FLUSH_TRAX_THRESH, APPTRACE_ONPANIC_HOST_FLUSH_TMO); + SEGGER_RTT_ESP32_FlushNoLock(CONFIG_ESP32_APPTRACE_POSTMORTEM_FLUSH_THRESH, APPTRACE_ONPANIC_HOST_FLUSH_TMO); #else - esp_apptrace_flush_nolock(ESP_APPTRACE_DEST_TRAX, CONFIG_ESP32_APPTRACE_POSTMORTEM_FLUSH_TRAX_THRESH, + esp_apptrace_flush_nolock(ESP_APPTRACE_DEST_TRAX, CONFIG_ESP32_APPTRACE_POSTMORTEM_FLUSH_THRESH, APPTRACE_ONPANIC_HOST_FLUSH_TMO); #endif #endif @@ -315,9 +315,9 @@ void panicHandler(XtExcFrame *frame) } #if CONFIG_ESP32_APPTRACE_ENABLE #if CONFIG_SYSVIEW_ENABLE - SEGGER_RTT_ESP32_FlushNoLock(CONFIG_ESP32_APPTRACE_POSTMORTEM_FLUSH_TRAX_THRESH, APPTRACE_ONPANIC_HOST_FLUSH_TMO); + SEGGER_RTT_ESP32_FlushNoLock(CONFIG_ESP32_APPTRACE_POSTMORTEM_FLUSH_THRESH, APPTRACE_ONPANIC_HOST_FLUSH_TMO); #else - esp_apptrace_flush_nolock(ESP_APPTRACE_DEST_TRAX, CONFIG_ESP32_APPTRACE_POSTMORTEM_FLUSH_TRAX_THRESH, + esp_apptrace_flush_nolock(ESP_APPTRACE_DEST_TRAX, CONFIG_ESP32_APPTRACE_POSTMORTEM_FLUSH_THRESH, APPTRACE_ONPANIC_HOST_FLUSH_TMO); #endif #endif @@ -348,9 +348,9 @@ void xt_unhandled_exception(XtExcFrame *frame) panicPutStr(". Setting bp and returning..\r\n"); #if CONFIG_ESP32_APPTRACE_ENABLE #if CONFIG_SYSVIEW_ENABLE - SEGGER_RTT_ESP32_FlushNoLock(CONFIG_ESP32_APPTRACE_POSTMORTEM_FLUSH_TRAX_THRESH, APPTRACE_ONPANIC_HOST_FLUSH_TMO); + SEGGER_RTT_ESP32_FlushNoLock(CONFIG_ESP32_APPTRACE_POSTMORTEM_FLUSH_THRESH, APPTRACE_ONPANIC_HOST_FLUSH_TMO); #else - esp_apptrace_flush_nolock(ESP_APPTRACE_DEST_TRAX, CONFIG_ESP32_APPTRACE_POSTMORTEM_FLUSH_TRAX_THRESH, + esp_apptrace_flush_nolock(ESP_APPTRACE_DEST_TRAX, CONFIG_ESP32_APPTRACE_POSTMORTEM_FLUSH_THRESH, APPTRACE_ONPANIC_HOST_FLUSH_TMO); #endif #endif @@ -590,9 +590,9 @@ static __attribute__((noreturn)) void commonErrorHandler(XtExcFrame *frame) #if CONFIG_ESP32_APPTRACE_ENABLE disableAllWdts(); #if CONFIG_SYSVIEW_ENABLE - SEGGER_RTT_ESP32_FlushNoLock(CONFIG_ESP32_APPTRACE_POSTMORTEM_FLUSH_TRAX_THRESH, APPTRACE_ONPANIC_HOST_FLUSH_TMO); + SEGGER_RTT_ESP32_FlushNoLock(CONFIG_ESP32_APPTRACE_POSTMORTEM_FLUSH_THRESH, APPTRACE_ONPANIC_HOST_FLUSH_TMO); #else - esp_apptrace_flush_nolock(ESP_APPTRACE_DEST_TRAX, CONFIG_ESP32_APPTRACE_POSTMORTEM_FLUSH_TRAX_THRESH, + esp_apptrace_flush_nolock(ESP_APPTRACE_DEST_TRAX, CONFIG_ESP32_APPTRACE_POSTMORTEM_FLUSH_THRESH, APPTRACE_ONPANIC_HOST_FLUSH_TMO); #endif reconfigureAllWdts(); diff --git a/docs/en/api-guides/app_trace.rst b/docs/en/api-guides/app_trace.rst index f88309ec9..c0b0a0bd4 100644 --- a/docs/en/api-guides/app_trace.rst +++ b/docs/en/api-guides/app_trace.rst @@ -47,7 +47,7 @@ Using of this feature depends on two components: There are two additional menuconfig options not mentioned above: -1. *Threshold for flushing last trace data to host on panic* (:ref:`CONFIG_ESP32_APPTRACE_POSTMORTEM_FLUSH_TRAX_THRESH`). This option is necessary due to the nature of working over JTAG. In that mode trace data are exposed to the host in 16 KB blocks. In post-mortem mode when one block is filled it is exposed to the host and the previous one becomes unavailable. In other words trace data are overwritten in 16 KB granularity. On panic the latest data from the current input block are exposed to host and host can read them for post-analysis. System panic may occur when very small amount of data are not exposed to the host yet. In this case the previous 16 KB of collected data will be lost and host will see the latest, but very small piece of the trace. It can be insufficient to diagnose the problem. This menuconfig option allows avoiding such situations. It controls the threshold for flushing data in case of panic. For example user can decide that it needs not less then 512 bytes of the recent trace data, so if there is less then 512 bytes of pending data at the moment of panic they will not be flushed and will not overwrite previous 16 KB. The option is only meaningful in post-mortem mode and when working over JTAG. +1. *Threshold for flushing last trace data to host on panic* (:ref:`CONFIG_ESP32_APPTRACE_POSTMORTEM_FLUSH_THRESH`). This option is necessary due to the nature of working over JTAG. In that mode trace data are exposed to the host in 16 KB blocks. In post-mortem mode when one block is filled it is exposed to the host and the previous one becomes unavailable. In other words trace data are overwritten in 16 KB granularity. On panic the latest data from the current input block are exposed to host and host can read them for post-analysis. System panic may occur when very small amount of data are not exposed to the host yet. In this case the previous 16 KB of collected data will be lost and host will see the latest, but very small piece of the trace. It can be insufficient to diagnose the problem. This menuconfig option allows avoiding such situations. It controls the threshold for flushing data in case of panic. For example user can decide that it needs not less then 512 bytes of the recent trace data, so if there is less then 512 bytes of pending data at the moment of panic they will not be flushed and will not overwrite previous 16 KB. The option is only meaningful in post-mortem mode and when working over JTAG. 2. *Timeout for flushing last trace data to host on panic* (:ref:`CONFIG_ESP32_APPTRACE_ONPANIC_HOST_FLUSH_TMO`). The option is only meaningful in streaming mode and controls the maximum time tracing module will wait for the host to read the last data in case of panic. diff --git a/docs/zh_CN/api-guides/app_trace.rst b/docs/zh_CN/api-guides/app_trace.rst index a5d0dc0ff..69d408f73 100644 --- a/docs/zh_CN/api-guides/app_trace.rst +++ b/docs/zh_CN/api-guides/app_trace.rst @@ -48,7 +48,7 @@ 以下为前述未提及的另外两个 menuconfig 选项: -1. *Threshold for flushing last trace data to host on panic* (:ref:`CONFIG_ESP32_APPTRACE_POSTMORTEM_FLUSH_TRAX_THRESH`)。由于在 JTAG 上工作的性质,此选项是必选项。在该模式下,跟踪数据以 16 KB 数据块的形式曝露给主机。在后验模式中,当一个块被填充时,它会曝露给主机,而之前的块会变得不可用。换句话说,跟踪数据以 16 KB 的粒度进行覆盖。在发生 panic 的时候,当前输入块的最新数据将会被曝露给主机,主机可以读取它们以进行后续分析。如果系统发生 panic 的时候仍有少量数据还没来得及曝光给主机,那么之前收集的 16 KB 的数据将丢失,主机只能看到非常少的最新的跟踪部分,它可能不足以用来诊断问题所在。此 menuconfig 选项允许避免此类情况,它可以控制在发生 panic 时刷新数据的阈值,例如用户可以确定它需要不少于 512 字节的最新跟踪数据,所以如果在发生 panic 时待处理的数据少于 512 字节,它们不会被刷新,也不会覆盖之前的 16 KB。该选项仅在后验模式和 JTAG 工作时有意义。 +1. *Threshold for flushing last trace data to host on panic* (:ref:`CONFIG_ESP32_APPTRACE_POSTMORTEM_FLUSH_THRESH`)。由于在 JTAG 上工作的性质,此选项是必选项。在该模式下,跟踪数据以 16 KB 数据块的形式曝露给主机。在后验模式中,当一个块被填充时,它会曝露给主机,而之前的块会变得不可用。换句话说,跟踪数据以 16 KB 的粒度进行覆盖。在发生 panic 的时候,当前输入块的最新数据将会被曝露给主机,主机可以读取它们以进行后续分析。如果系统发生 panic 的时候仍有少量数据还没来得及曝光给主机,那么之前收集的 16 KB 的数据将丢失,主机只能看到非常少的最新的跟踪部分,它可能不足以用来诊断问题所在。此 menuconfig 选项允许避免此类情况,它可以控制在发生 panic 时刷新数据的阈值,例如用户可以确定它需要不少于 512 字节的最新跟踪数据,所以如果在发生 panic 时待处理的数据少于 512 字节,它们不会被刷新,也不会覆盖之前的 16 KB。该选项仅在后验模式和 JTAG 工作时有意义。 2. *Timeout for flushing last trace data to host on panic* (:ref:`CONFIG_ESP32_APPTRACE_ONPANIC_HOST_FLUSH_TMO`)。该选项仅在流模式下才起作用,它控制跟踪模块在发生 panic 时等待主机读取最新数据的最长时间。 diff --git a/examples/system/gcov/sdkconfig.defaults b/examples/system/gcov/sdkconfig.defaults index 7cf11e05e..332bb1281 100644 --- a/examples/system/gcov/sdkconfig.defaults +++ b/examples/system/gcov/sdkconfig.defaults @@ -3,5 +3,5 @@ CONFIG_ESP32_APPTRACE_DEST_TRAX=y CONFIG_ESP32_APPTRACE_ENABLE=y CONFIG_ESP32_APPTRACE_LOCK_ENABLE=y CONFIG_ESP32_APPTRACE_ONPANIC_HOST_FLUSH_TMO=-1 -CONFIG_ESP32_APPTRACE_POSTMORTEM_FLUSH_TRAX_THRESH=0 +CONFIG_ESP32_APPTRACE_POSTMORTEM_FLUSH_THRESH=0 CONFIG_ESP32_APPTRACE_PENDING_DATA_SIZE_MAX=0 From 997b29a9cac176166860d7cb9e33c2ff5c93b147 Mon Sep 17 00:00:00 2001 From: Roland Dobai Date: Thu, 9 May 2019 13:39:30 +0200 Subject: [PATCH 19/21] Rename Kconfig options (components/esptool_py) --- components/bootloader/Kconfig.projbuild | 2 +- .../bootloader_support/src/bootloader_init.c | 2 +- .../bootloader_support/src/flash_qio_mode.c | 2 +- components/esptool_py/Kconfig.projbuild | 58 +++++++++---------- components/esptool_py/Makefile.projbuild | 2 +- components/esptool_py/sdkconfig.rename | 17 ++++++ .../throughput_client/sdkconfig.defaults | 4 +- .../throughput_server/sdkconfig.defaults | 4 +- examples/wifi/iperf/sdkconfig.defaults | 2 +- examples/wifi/iperf/sdkconfig.defaults.05 | 2 +- examples/wifi/iperf/sdkconfig.defaults.06 | 2 +- examples/wifi/iperf/sdkconfig.defaults.07 | 2 +- examples/wifi/iperf/sdkconfig.defaults.99 | 2 +- tools/cmake/project_description.json.in | 2 +- tools/ldgen/samples/sdkconfig | 26 ++++----- 15 files changed, 73 insertions(+), 56 deletions(-) create mode 100644 components/esptool_py/sdkconfig.rename diff --git a/components/bootloader/Kconfig.projbuild b/components/bootloader/Kconfig.projbuild index c1242c297..c302157a5 100644 --- a/components/bootloader/Kconfig.projbuild +++ b/components/bootloader/Kconfig.projbuild @@ -32,7 +32,7 @@ menu "Bootloader config" int "SPI Flash WP Pin when customising pins via eFuse (read help)" range 0 33 default 7 - depends on FLASHMODE_QIO || FLASHMODE_QOUT + depends on ESPTOOLPY_FLASHMODE_QIO || ESPTOOLPY_FLASHMODE_QOUT help This value is ignored unless flash mode is set to QIO or QOUT *and* the SPI flash pins have been overriden by setting the eFuses SPI_PAD_CONFIG_xxx. diff --git a/components/bootloader_support/src/bootloader_init.c b/components/bootloader_support/src/bootloader_init.c index b6bca0b2e..ca0f435df 100644 --- a/components/bootloader_support/src/bootloader_init.c +++ b/components/bootloader_support/src/bootloader_init.c @@ -173,7 +173,7 @@ static esp_err_t bootloader_main() ESP_LOGI(TAG, "Enabling RNG early entropy source..."); bootloader_random_enable(); -#if CONFIG_FLASHMODE_QIO || CONFIG_FLASHMODE_QOUT +#if CONFIG_ESPTOOLPY_FLASHMODE_QIO || CONFIG_ESPTOOLPY_FLASHMODE_QOUT bootloader_enable_qio_mode(); #endif diff --git a/components/bootloader_support/src/flash_qio_mode.c b/components/bootloader_support/src/flash_qio_mode.c index 0733db584..af8c71452 100644 --- a/components/bootloader_support/src/flash_qio_mode.c +++ b/components/bootloader_support/src/flash_qio_mode.c @@ -211,7 +211,7 @@ static esp_err_t enable_qio_mode(read_status_fn_t read_status_fn, ESP_LOGD(TAG, "Enabling QIO mode..."); esp_rom_spiflash_read_mode_t mode; -#if CONFIG_FLASHMODE_QOUT +#if CONFIG_ESPTOOLPY_FLASHMODE_QOUT mode = ESP_ROM_SPIFLASH_QOUT_MODE; #else mode = ESP_ROM_SPIFLASH_QIO_MODE; diff --git a/components/esptool_py/Kconfig.projbuild b/components/esptool_py/Kconfig.projbuild index 037b800fd..95919bd00 100644 --- a/components/esptool_py/Kconfig.projbuild +++ b/components/esptool_py/Kconfig.projbuild @@ -54,20 +54,20 @@ menu "Serial flasher config" decompress it on the fly before flashing it. For most payloads, this should result in a speed increase. - choice FLASHMODE + choice ESPTOOLPY_FLASHMODE prompt "Flash SPI mode" - default FLASHMODE_DIO + default ESPTOOLPY_FLASHMODE_DIO help Mode the flash chip is flashed in, as well as the default mode for the binary to run in. - config FLASHMODE_QIO + config ESPTOOLPY_FLASHMODE_QIO bool "QIO" - config FLASHMODE_QOUT + config ESPTOOLPY_FLASHMODE_QOUT bool "QOUT" - config FLASHMODE_DIO + config ESPTOOLPY_FLASHMODE_DIO bool "DIO" - config FLASHMODE_DOUT + config ESPTOOLPY_FLASHMODE_DOUT bool "DOUT" endchoice @@ -76,10 +76,10 @@ menu "Serial flasher config" # itself to quad mode during initialisation config ESPTOOLPY_FLASHMODE string - default "dio" if FLASHMODE_QIO - default "dio" if FLASHMODE_QOUT - default "dio" if FLASHMODE_DIO - default "dout" if FLASHMODE_DOUT + default "dio" if ESPTOOLPY_FLASHMODE_QIO + default "dio" if ESPTOOLPY_FLASHMODE_QOUT + default "dio" if ESPTOOLPY_FLASHMODE_DIO + default "dout" if ESPTOOLPY_FLASHMODE_DOUT choice ESPTOOLPY_FLASHFREQ prompt "Flash SPI speed" @@ -180,44 +180,44 @@ menu "Serial flasher config" default "hard_reset" if ESPTOOLPY_AFTER_RESET default "no_reset" if ESPTOOLPY_AFTER_NORESET - choice MONITOR_BAUD + choice ESPTOOLPY_MONITOR_BAUD prompt "'make monitor' baud rate" - default MONITOR_BAUD_115200B + default ESPTOOLPY_MONITOR_BAUD_115200B help Baud rate to use when running 'make monitor' to view serial output from a running chip. Can override by setting the MONITORBAUD environment variable. - config MONITOR_BAUD_9600B + config ESPTOOLPY_MONITOR_BAUD_9600B bool "9600 bps" - config MONITOR_BAUD_57600B + config ESPTOOLPY_MONITOR_BAUD_57600B bool "57600 bps" - config MONITOR_BAUD_115200B + config ESPTOOLPY_MONITOR_BAUD_115200B bool "115200 bps" - config MONITOR_BAUD_230400B + config ESPTOOLPY_MONITOR_BAUD_230400B bool "230400 bps" - config MONITOR_BAUD_921600B + config ESPTOOLPY_MONITOR_BAUD_921600B bool "921600 bps" - config MONITOR_BAUD_2MB + config ESPTOOLPY_MONITOR_BAUD_2MB bool "2 Mbps" - config MONITOR_BAUD_OTHER + config ESPTOOLPY_MONITOR_BAUD_OTHER bool "Custom baud rate" endchoice - config MONITOR_BAUD_OTHER_VAL - int "Custom baud rate value" if MONITOR_BAUD_OTHER + config ESPTOOLPY_MONITOR_BAUD_OTHER_VAL + int "Custom baud rate value" if ESPTOOLPY_MONITOR_BAUD_OTHER default 115200 - config MONITOR_BAUD + config ESPTOOLPY_MONITOR_BAUD int - default 9600 if MONITOR_BAUD_9600B - default 57600 if MONITOR_BAUD_57600B - default 115200 if MONITOR_BAUD_115200B - default 230400 if MONITOR_BAUD_230400B - default 921600 if MONITOR_BAUD_921600B - default 2000000 if MONITOR_BAUD_2MB - default MONITOR_BAUD_OTHER_VAL if MONITOR_BAUD_OTHER + default 9600 if ESPTOOLPY_MONITOR_BAUD_9600B + default 57600 if ESPTOOLPY_MONITOR_BAUD_57600B + default 115200 if ESPTOOLPY_MONITOR_BAUD_115200B + default 230400 if ESPTOOLPY_MONITOR_BAUD_230400B + default 921600 if ESPTOOLPY_MONITOR_BAUD_921600B + default 2000000 if ESPTOOLPY_MONITOR_BAUD_2MB + default ESPTOOLPY_MONITOR_BAUD_OTHER_VAL if ESPTOOLPY_MONITOR_BAUD_OTHER endmenu diff --git a/components/esptool_py/Makefile.projbuild b/components/esptool_py/Makefile.projbuild index 9cbab0383..c8aee775e 100644 --- a/components/esptool_py/Makefile.projbuild +++ b/components/esptool_py/Makefile.projbuild @@ -81,7 +81,7 @@ erase_flash: | check_python_dependencies @echo "Erasing entire flash..." $(ESPTOOLPY_SERIAL) erase_flash -MONITORBAUD ?= $(CONFIG_MONITOR_BAUD) +MONITORBAUD ?= $(CONFIG_ESPTOOLPY_MONITOR_BAUD) MONITOR_PYTHON := $(PYTHON) diff --git a/components/esptool_py/sdkconfig.rename b/components/esptool_py/sdkconfig.rename new file mode 100644 index 000000000..caa5c32b8 --- /dev/null +++ b/components/esptool_py/sdkconfig.rename @@ -0,0 +1,17 @@ +# sdkconfig replacement configurations for deprecated options formatted as +# CONFIG_DEPRECATED_OPTION CONFIG_NEW_OPTION + +CONFIG_FLASHMODE_QIO CONFIG_ESPTOOLPY_FLASHMODE_QIO +CONFIG_FLASHMODE_QOUT CONFIG_ESPTOOLPY_FLASHMODE_QOUT +CONFIG_FLASHMODE_DIO CONFIG_ESPTOOLPY_FLASHMODE_DIO +CONFIG_FLASHMODE_DOUT CONFIG_ESPTOOLPY_FLASHMODE_DOUT + +CONFIG_MONITOR_BAUD CONFIG_ESPTOOLPY_MONITOR_BAUD +CONFIG_MONITOR_BAUD_9600B CONFIG_ESPTOOLPY_MONITOR_BAUD_9600B +CONFIG_MONITOR_BAUD_57600B CONFIG_ESPTOOLPY_MONITOR_BAUD_57600B +CONFIG_MONITOR_BAUD_115200B CONFIG_ESPTOOLPY_MONITOR_BAUD_115200B +CONFIG_MONITOR_BAUD_230400B CONFIG_ESPTOOLPY_MONITOR_BAUD_230400B +CONFIG_MONITOR_BAUD_921600B CONFIG_ESPTOOLPY_MONITOR_BAUD_921600B +CONFIG_MONITOR_BAUD_2MB CONFIG_ESPTOOLPY_MONITOR_BAUD_2MB +CONFIG_MONITOR_BAUD_OTHER CONFIG_ESPTOOLPY_MONITOR_BAUD_OTHER +CONFIG_MONITOR_BAUD_OTHER_VAL CONFIG_ESPTOOLPY_MONITOR_BAUD_OTHER_VAL diff --git a/examples/bluetooth/ble_throughput/throughput_client/sdkconfig.defaults b/examples/bluetooth/ble_throughput/throughput_client/sdkconfig.defaults index fd65ffed2..5d486b83f 100644 --- a/examples/bluetooth/ble_throughput/throughput_client/sdkconfig.defaults +++ b/examples/bluetooth/ble_throughput/throughput_client/sdkconfig.defaults @@ -12,8 +12,8 @@ CONFIG_BTDM_CTRL_PINNED_TO_CORE=1 # # Serial flasher config # -CONFIG_MONITOR_BAUD_921600B=y -CONFIG_MONITOR_BAUD=921600 +CONFIG_ESPTOOLPY_MONITOR_BAUD_921600B=y +CONFIG_ESPTOOLPY_MONITOR_BAUD=921600 # # ESP32-specific # diff --git a/examples/bluetooth/ble_throughput/throughput_server/sdkconfig.defaults b/examples/bluetooth/ble_throughput/throughput_server/sdkconfig.defaults index fd65ffed2..5d486b83f 100644 --- a/examples/bluetooth/ble_throughput/throughput_server/sdkconfig.defaults +++ b/examples/bluetooth/ble_throughput/throughput_server/sdkconfig.defaults @@ -12,8 +12,8 @@ CONFIG_BTDM_CTRL_PINNED_TO_CORE=1 # # Serial flasher config # -CONFIG_MONITOR_BAUD_921600B=y -CONFIG_MONITOR_BAUD=921600 +CONFIG_ESPTOOLPY_MONITOR_BAUD_921600B=y +CONFIG_ESPTOOLPY_MONITOR_BAUD=921600 # # ESP32-specific # diff --git a/examples/wifi/iperf/sdkconfig.defaults b/examples/wifi/iperf/sdkconfig.defaults index d6dbf5f5a..1f2ed3874 100644 --- a/examples/wifi/iperf/sdkconfig.defaults +++ b/examples/wifi/iperf/sdkconfig.defaults @@ -25,7 +25,7 @@ CONFIG_LWIP_UDP_RECVMBOX_SIZE=64 CONFIG_LWIP_TCPIP_RECVMBOX_SIZE=64 CONFIG_LWIP_ETHARP_TRUST_IP_MAC=n -CONFIG_FLASHMODE_QIO=y +CONFIG_ESPTOOLPY_FLASHMODE_QIO=y CONFIG_ESPTOOLPY_FLASHFREQ_40M=y CONFIG_LWIP_IRAM_OPTIMIZATION=y diff --git a/examples/wifi/iperf/sdkconfig.defaults.05 b/examples/wifi/iperf/sdkconfig.defaults.05 index 552d2a3ef..cb287b13d 100644 --- a/examples/wifi/iperf/sdkconfig.defaults.05 +++ b/examples/wifi/iperf/sdkconfig.defaults.05 @@ -23,7 +23,7 @@ CONFIG_LWIP_UDP_RECVMBOX_SIZE=64 CONFIG_LWIP_TCPIP_RECVMBOX_SIZE=64 CONFIG_LWIP_ETHARP_TRUST_IP_MAC= -CONFIG_FLASHMODE_QIO=y +CONFIG_ESPTOOLPY_FLASHMODE_QIO=y CONFIG_ESPTOOLPY_FLASHFREQ_80M=y CONFIG_LWIP_IRAM_OPTIMIZATION=y diff --git a/examples/wifi/iperf/sdkconfig.defaults.06 b/examples/wifi/iperf/sdkconfig.defaults.06 index 63b713075..1b35b695e 100644 --- a/examples/wifi/iperf/sdkconfig.defaults.06 +++ b/examples/wifi/iperf/sdkconfig.defaults.06 @@ -21,6 +21,6 @@ CONFIG_LWIP_UDP_RECVMBOX_SIZE=64 CONFIG_LWIP_TCPIP_RECVMBOX_SIZE=64 CONFIG_LWIP_ETHARP_TRUST_IP_MAC= -CONFIG_FLASHMODE_QIO=y +CONFIG_ESPTOOLPY_FLASHMODE_QIO=y CONFIG_ESPTOOLPY_FLASHFREQ_80M=y CONFIG_LWIP_IRAM_OPTIMIZATION=y diff --git a/examples/wifi/iperf/sdkconfig.defaults.07 b/examples/wifi/iperf/sdkconfig.defaults.07 index cc781798c..4fc230161 100644 --- a/examples/wifi/iperf/sdkconfig.defaults.07 +++ b/examples/wifi/iperf/sdkconfig.defaults.07 @@ -25,6 +25,6 @@ CONFIG_LWIP_UDP_RECVMBOX_SIZE=64 CONFIG_LWIP_TCPIP_RECVMBOX_SIZE=64 CONFIG_LWIP_ETHARP_TRUST_IP_MAC= -CONFIG_FLASHMODE_QIO=y +CONFIG_ESPTOOLPY_FLASHMODE_QIO=y CONFIG_ESPTOOLPY_FLASHFREQ_80M=y CONFIG_LWIP_IRAM_OPTIMIZATION=y diff --git a/examples/wifi/iperf/sdkconfig.defaults.99 b/examples/wifi/iperf/sdkconfig.defaults.99 index 9cced4d4e..c7e50345b 100644 --- a/examples/wifi/iperf/sdkconfig.defaults.99 +++ b/examples/wifi/iperf/sdkconfig.defaults.99 @@ -25,6 +25,6 @@ CONFIG_LWIP_UDP_RECVMBOX_SIZE=64 CONFIG_LWIP_TCPIP_RECVMBOX_SIZE=64 CONFIG_LWIP_ETHARP_TRUST_IP_MAC= -CONFIG_FLASHMODE_QIO=y +CONFIG_ESPTOOLPY_FLASHMODE_QIO=y CONFIG_ESPTOOLPY_FLASHFREQ_80M=y CONFIG_LWIP_IRAM_OPTIMIZATION=y diff --git a/tools/cmake/project_description.json.in b/tools/cmake/project_description.json.in index 3d02e1632..e0a62ee55 100644 --- a/tools/cmake/project_description.json.in +++ b/tools/cmake/project_description.json.in @@ -8,7 +8,7 @@ "app_bin": "${PROJECT_BIN}", "git_revision": "${IDF_VER}", "phy_data_partition": "${CONFIG_ESP32_PHY_INIT_DATA_IN_PARTITION}", - "monitor_baud" : "${CONFIG_MONITOR_BAUD}", + "monitor_baud" : "${CONFIG_ESPTOOLPY_MONITOR_BAUD}", "config_environment" : { "COMPONENT_KCONFIGS" : "${COMPONENT_KCONFIGS}", "COMPONENT_KCONFIGS_PROJBUILD" : "${COMPONENT_KCONFIGS_PROJBUILD}" diff --git a/tools/ldgen/samples/sdkconfig b/tools/ldgen/samples/sdkconfig index c2c1cceed..f78145b91 100644 --- a/tools/ldgen/samples/sdkconfig +++ b/tools/ldgen/samples/sdkconfig @@ -36,10 +36,10 @@ CONFIG_ESPTOOLPY_BAUD_OTHER= CONFIG_ESPTOOLPY_BAUD_OTHER_VAL=115200 CONFIG_ESPTOOLPY_BAUD=115200 CONFIG_ESPTOOLPY_COMPRESSED= -CONFIG_FLASHMODE_QIO= -CONFIG_FLASHMODE_QOUT= -CONFIG_FLASHMODE_DIO=y -CONFIG_FLASHMODE_DOUT= +CONFIG_ESPTOOLPY_FLASHMODE_QIO= +CONFIG_ESPTOOLPY_FLASHMODE_QOUT= +CONFIG_ESPTOOLPY_FLASHMODE_DIO=y +CONFIG_ESPTOOLPY_FLASHMODE_DOUT= CONFIG_ESPTOOLPY_FLASHMODE="dio" CONFIG_ESPTOOLPY_FLASHFREQ_80M= CONFIG_ESPTOOLPY_FLASHFREQ_40M=y @@ -59,15 +59,15 @@ CONFIG_ESPTOOLPY_BEFORE="default_reset" CONFIG_ESPTOOLPY_AFTER_RESET=y CONFIG_ESPTOOLPY_AFTER_NORESET= CONFIG_ESPTOOLPY_AFTER="hard_reset" -CONFIG_MONITOR_BAUD_9600B= -CONFIG_MONITOR_BAUD_57600B= -CONFIG_MONITOR_BAUD_115200B=y -CONFIG_MONITOR_BAUD_230400B= -CONFIG_MONITOR_BAUD_921600B= -CONFIG_MONITOR_BAUD_2MB= -CONFIG_MONITOR_BAUD_OTHER= -CONFIG_MONITOR_BAUD_OTHER_VAL=115200 -CONFIG_MONITOR_BAUD=115200 +CONFIG_ESPTOOLPY_MONITOR_BAUD_9600B= +CONFIG_ESPTOOLPY_MONITOR_BAUD_57600B= +CONFIG_ESPTOOLPY_MONITOR_BAUD_115200B=y +CONFIG_ESPTOOLPY_MONITOR_BAUD_230400B= +CONFIG_ESPTOOLPY_MONITOR_BAUD_921600B= +CONFIG_ESPTOOLPY_MONITOR_BAUD_2MB= +CONFIG_ESPTOOLPY_MONITOR_BAUD_OTHER= +CONFIG_ESPTOOLPY_MONITOR_BAUD_OTHER_VAL=115200 +CONFIG_ESPTOOLPY_MONITOR_BAUD=115200 # # Partition Table From 1ad2283641e45832df681e4574e25e2dd940915f Mon Sep 17 00:00:00 2001 From: Roland Dobai Date: Thu, 9 May 2019 14:10:35 +0200 Subject: [PATCH 20/21] Rename Kconfig options (components/bootloader) --- components/app_update/esp_app_desc.c | 4 +- components/app_update/esp_ota_ops.c | 14 ++-- components/app_update/test/test_switch_ota.c | 16 ++-- components/bootloader/Kconfig.projbuild | 78 +++++++++---------- components/bootloader/sdkconfig.rename | 22 ++++++ .../src/bootloader_utility.c | 28 +++---- .../src/esp32/flash_encrypt.c | 6 +- .../common/include/common/bt_trace.h | 2 +- components/efuse/include/esp_efuse.h | 2 +- components/efuse/src/esp_efuse_fields.c | 22 +++--- components/esp32/cpu_start.c | 4 +- components/esptool_py/project_include.cmake | 4 +- components/log/include/esp_log.h | 2 +- components/nvs_flash/Kconfig | 2 +- components/partition_table/CMakeLists.txt | 2 +- components/partition_table/Makefile.projbuild | 2 +- components/spi_flash/partition.c | 8 +- docs/en/api-reference/system/ota.rst | 39 +++++----- docs/en/security/secure-boot.rst | 2 +- examples/ethernet/iperf/sdkconfig.defaults | 4 +- .../i2c/i2c_tools/sdkconfig.defaults | 4 +- examples/system/console/sdkconfig.defaults | 4 +- examples/system/ota/README.md | 4 +- examples/system/ulp/sdkconfig.defaults | 4 +- examples/system/ulp_adc/sdkconfig.defaults | 4 +- .../wifi/simple_sniffer/sdkconfig.defaults | 4 +- tools/ldgen/samples/sdkconfig | 16 ++-- tools/unit-test-app/sdkconfig.defaults | 2 +- 28 files changed, 165 insertions(+), 140 deletions(-) create mode 100644 components/bootloader/sdkconfig.rename diff --git a/components/app_update/esp_app_desc.c b/components/app_update/esp_app_desc.c index 23d3b4cc7..eaa3a70b2 100644 --- a/components/app_update/esp_app_desc.c +++ b/components/app_update/esp_app_desc.c @@ -34,8 +34,8 @@ const __attribute__((section(".rodata_desc"))) esp_app_desc_t esp_app_desc = { #endif .idf_ver = IDF_VER, -#ifdef CONFIG_APP_SECURE_VERSION - .secure_version = CONFIG_APP_SECURE_VERSION, +#ifdef CONFIG_BOOTLOADER_APP_SECURE_VERSION + .secure_version = CONFIG_BOOTLOADER_APP_SECURE_VERSION, #else .secure_version = 0, #endif diff --git a/components/app_update/esp_ota_ops.c b/components/app_update/esp_ota_ops.c index e800007f8..edc70ca6f 100644 --- a/components/app_update/esp_ota_ops.c +++ b/components/app_update/esp_ota_ops.c @@ -113,7 +113,7 @@ static esp_err_t image_validate(const esp_partition_t *partition, esp_image_load static esp_ota_img_states_t set_new_state_otadata(void) { -#ifdef CONFIG_APP_ROLLBACK_ENABLE +#ifdef CONFIG_BOOTLOADER_APP_ROLLBACK_ENABLE ESP_LOGD(TAG, "Monitoring the first boot of the app is enabled."); return ESP_OTA_IMG_NEW; #else @@ -144,7 +144,7 @@ esp_err_t esp_ota_begin(const esp_partition_t *partition, size_t image_size, esp return ESP_ERR_OTA_PARTITION_CONFLICT; } -#ifdef CONFIG_APP_ROLLBACK_ENABLE +#ifdef CONFIG_BOOTLOADER_APP_ROLLBACK_ENABLE esp_ota_img_states_t ota_state_running_part; if (esp_ota_get_state_partition(running_partition, &ota_state_running_part) == ESP_OK) { if (ota_state_running_part == ESP_OTA_IMG_PENDING_VERIFY) { @@ -394,7 +394,7 @@ esp_err_t esp_ota_set_boot_partition(const esp_partition_t *partition) return ESP_ERR_NOT_FOUND; } } else { -#ifdef CONFIG_APP_ANTI_ROLLBACK +#ifdef CONFIG_BOOTLOADER_APP_ANTI_ROLLBACK esp_app_desc_t partition_app_desc; esp_err_t err = esp_ota_get_partition_description(partition, &partition_app_desc); if (err != ESP_OK) { @@ -582,7 +582,7 @@ esp_err_t esp_ota_get_partition_description(const esp_partition_t *partition, es return ESP_OK; } -#ifdef CONFIG_APP_ANTI_ROLLBACK +#ifdef CONFIG_BOOTLOADER_APP_ANTI_ROLLBACK static esp_err_t esp_ota_set_anti_rollback(void) { const esp_app_desc_t *app_desc = esp_ota_get_app_description(); return esp_efuse_update_secure_version(app_desc->secure_version); @@ -614,7 +614,7 @@ bool esp_ota_check_rollback_is_possible(void) int last_active_ota = (~active_ota)&1; const esp_partition_t *partition = NULL; -#ifndef CONFIG_APP_ANTI_ROLLBACK +#ifndef CONFIG_BOOTLOADER_APP_ANTI_ROLLBACK if (valid_otadata[last_active_ota] == false) { partition = esp_partition_find_first(ESP_PARTITION_TYPE_APP, ESP_PARTITION_SUBTYPE_APP_FACTORY, NULL); if (partition != NULL) { @@ -630,7 +630,7 @@ bool esp_ota_check_rollback_is_possible(void) partition = esp_partition_find_first(ESP_PARTITION_TYPE_APP, ESP_PARTITION_SUBTYPE_APP_OTA_MIN + slot, NULL); if (partition != NULL) { if(image_validate(partition, ESP_IMAGE_VERIFY_SILENT) == ESP_OK) { -#ifdef CONFIG_APP_ANTI_ROLLBACK +#ifdef CONFIG_BOOTLOADER_APP_ANTI_ROLLBACK esp_app_desc_t app_desc; if (esp_ota_get_partition_description(partition, &app_desc) == ESP_OK && esp_efuse_check_secure_version(app_desc.secure_version) == true) { @@ -661,7 +661,7 @@ static esp_err_t esp_ota_current_ota_is_workable(bool valid) otadata[active_otadata].ota_state = ESP_OTA_IMG_VALID; ESP_LOGD(TAG, "OTA[current] partition is marked as VALID"); esp_err_t err = rewrite_ota_seq(otadata, otadata[active_otadata].ota_seq, active_otadata, otadata_partition); -#ifdef CONFIG_APP_ANTI_ROLLBACK +#ifdef CONFIG_BOOTLOADER_APP_ANTI_ROLLBACK if (err == ESP_OK) { return esp_ota_set_anti_rollback(); } diff --git a/components/app_update/test/test_switch_ota.c b/components/app_update/test/test_switch_ota.c index 0c0b0e75e..4c753edf4 100644 --- a/components/app_update/test/test_switch_ota.c +++ b/components/app_update/test/test_switch_ota.c @@ -240,7 +240,7 @@ static void reset_output_pin(uint32_t num_pin) static void mark_app_valid(void) { -#ifdef CONFIG_APP_ROLLBACK_ENABLE +#ifdef CONFIG_BOOTLOADER_APP_ROLLBACK_ENABLE TEST_ESP_OK(esp_ota_mark_app_valid_cancel_rollback()); #endif } @@ -519,7 +519,7 @@ static void test_rollback1(void) TEST_ESP_ERR(ESP_ERR_NOT_SUPPORTED, esp_ota_get_state_partition(cur_app, &ota_state)); update_partition = app_update(); TEST_ESP_OK(esp_ota_get_state_partition(update_partition, &ota_state)); -#ifndef CONFIG_APP_ROLLBACK_ENABLE +#ifndef CONFIG_BOOTLOADER_APP_ROLLBACK_ENABLE TEST_ASSERT_EQUAL(ESP_OTA_IMG_UNDEFINED, ota_state); #else TEST_ASSERT_EQUAL(ESP_OTA_IMG_NEW, ota_state); @@ -531,7 +531,7 @@ static void test_rollback1(void) TEST_ASSERT_EQUAL(ESP_PARTITION_SUBTYPE_APP_OTA_0, cur_app->subtype); TEST_ASSERT_NULL(esp_ota_get_last_invalid_partition()); TEST_ESP_OK(esp_ota_get_state_partition(cur_app, &ota_state)); -#ifndef CONFIG_APP_ROLLBACK_ENABLE +#ifndef CONFIG_BOOTLOADER_APP_ROLLBACK_ENABLE TEST_ASSERT_EQUAL(ESP_OTA_IMG_UNDEFINED, ota_state); #else TEST_ASSERT_EQUAL(ESP_OTA_IMG_PENDING_VERIFY, ota_state); @@ -598,7 +598,7 @@ static void test_rollback2(void) TEST_ESP_ERR(ESP_ERR_NOT_SUPPORTED, esp_ota_get_state_partition(cur_app, &ota_state)); update_partition = app_update(); TEST_ESP_OK(esp_ota_get_state_partition(update_partition, &ota_state)); -#ifndef CONFIG_APP_ROLLBACK_ENABLE +#ifndef CONFIG_BOOTLOADER_APP_ROLLBACK_ENABLE TEST_ASSERT_EQUAL(ESP_OTA_IMG_UNDEFINED, ota_state); #else TEST_ASSERT_EQUAL(ESP_OTA_IMG_NEW, ota_state); @@ -610,7 +610,7 @@ static void test_rollback2(void) TEST_ASSERT_EQUAL(ESP_PARTITION_SUBTYPE_APP_OTA_0, cur_app->subtype); TEST_ASSERT_NULL(esp_ota_get_last_invalid_partition()); TEST_ESP_OK(esp_ota_get_state_partition(cur_app, &ota_state)); -#ifndef CONFIG_APP_ROLLBACK_ENABLE +#ifndef CONFIG_BOOTLOADER_APP_ROLLBACK_ENABLE TEST_ASSERT_EQUAL(ESP_OTA_IMG_UNDEFINED, ota_state); #else TEST_ASSERT_EQUAL(ESP_OTA_IMG_PENDING_VERIFY, ota_state); @@ -621,7 +621,7 @@ static void test_rollback2(void) TEST_ASSERT_EQUAL(ESP_OTA_IMG_VALID, ota_state); update_partition = app_update(); TEST_ESP_OK(esp_ota_get_state_partition(update_partition, &ota_state)); -#ifndef CONFIG_APP_ROLLBACK_ENABLE +#ifndef CONFIG_BOOTLOADER_APP_ROLLBACK_ENABLE TEST_ASSERT_EQUAL(ESP_OTA_IMG_UNDEFINED, ota_state); #else TEST_ASSERT_EQUAL(ESP_OTA_IMG_NEW, ota_state); @@ -633,7 +633,7 @@ static void test_rollback2(void) TEST_ASSERT_EQUAL(ESP_PARTITION_SUBTYPE_APP_OTA_1, cur_app->subtype); TEST_ASSERT_NULL(esp_ota_get_last_invalid_partition()); TEST_ESP_OK(esp_ota_get_state_partition(cur_app, &ota_state)); -#ifndef CONFIG_APP_ROLLBACK_ENABLE +#ifndef CONFIG_BOOTLOADER_APP_ROLLBACK_ENABLE TEST_ASSERT_EQUAL(ESP_OTA_IMG_UNDEFINED, ota_state); TEST_ESP_OK(esp_ota_mark_app_invalid_rollback_and_reboot()); #else @@ -666,7 +666,7 @@ static void test_rollback2_1(void) TEST_ESP_OK(esp_ota_get_state_partition(cur_app, &ota_state)); TEST_ASSERT_EQUAL(ESP_OTA_IMG_VALID, ota_state); TEST_ESP_OK(esp_ota_get_state_partition(invalid_partition, &ota_state)); -#ifndef CONFIG_APP_ROLLBACK_ENABLE +#ifndef CONFIG_BOOTLOADER_APP_ROLLBACK_ENABLE TEST_ASSERT_EQUAL(ESP_OTA_IMG_INVALID, ota_state); #else TEST_ASSERT_EQUAL(ESP_OTA_IMG_ABORTED, ota_state); diff --git a/components/bootloader/Kconfig.projbuild b/components/bootloader/Kconfig.projbuild index c302157a5..ba551e592 100644 --- a/components/bootloader/Kconfig.projbuild +++ b/components/bootloader/Kconfig.projbuild @@ -1,32 +1,32 @@ menu "Bootloader config" - choice LOG_BOOTLOADER_LEVEL + choice BOOTLOADER_LOG_LEVEL bool "Bootloader log verbosity" - default LOG_BOOTLOADER_LEVEL_INFO + default BOOTLOADER_LOG_LEVEL_INFO help Specify how much output to see in bootloader logs. - config LOG_BOOTLOADER_LEVEL_NONE + config BOOTLOADER_LOG_LEVEL_NONE bool "No output" - config LOG_BOOTLOADER_LEVEL_ERROR + config BOOTLOADER_LOG_LEVEL_ERROR bool "Error" - config LOG_BOOTLOADER_LEVEL_WARN + config BOOTLOADER_LOG_LEVEL_WARN bool "Warning" - config LOG_BOOTLOADER_LEVEL_INFO + config BOOTLOADER_LOG_LEVEL_INFO bool "Info" - config LOG_BOOTLOADER_LEVEL_DEBUG + config BOOTLOADER_LOG_LEVEL_DEBUG bool "Debug" - config LOG_BOOTLOADER_LEVEL_VERBOSE + config BOOTLOADER_LOG_LEVEL_VERBOSE bool "Verbose" endchoice - config LOG_BOOTLOADER_LEVEL + config BOOTLOADER_LOG_LEVEL int - default 0 if LOG_BOOTLOADER_LEVEL_NONE - default 1 if LOG_BOOTLOADER_LEVEL_ERROR - default 2 if LOG_BOOTLOADER_LEVEL_WARN - default 3 if LOG_BOOTLOADER_LEVEL_INFO - default 4 if LOG_BOOTLOADER_LEVEL_DEBUG - default 5 if LOG_BOOTLOADER_LEVEL_VERBOSE + default 0 if BOOTLOADER_LOG_LEVEL_NONE + default 1 if BOOTLOADER_LOG_LEVEL_ERROR + default 2 if BOOTLOADER_LOG_LEVEL_WARN + default 3 if BOOTLOADER_LOG_LEVEL_INFO + default 4 if BOOTLOADER_LOG_LEVEL_DEBUG + default 5 if BOOTLOADER_LOG_LEVEL_VERBOSE config BOOTLOADER_SPI_WP_PIN int "SPI Flash WP Pin when customising pins via eFuse (read help)" @@ -140,7 +140,7 @@ menu "Bootloader config" source for slow_clk - and ends calling app_main. Re-set timeout is needed due to WDT uses a SLOW_CLK clock source. After changing a frequency slow_clk a time of WDT needs to re-set for new frequency. - slow_clk depends on ESP32_RTC_CLC_SRC (INTERNAL_RC or EXTERNAL_CRYSTAL). + slow_clk depends on ESP32_RTC_CLK_SRC (INTERNAL_RC or EXTERNAL_CRYSTAL). config BOOTLOADER_WDT_DISABLE_IN_USER_CODE bool "Allows RTC watchdog disable in user code" @@ -163,7 +163,7 @@ menu "Bootloader config" - these options can increase the execution time. Note: RTC_WDT will reset while encryption operations will be performed. - config APP_ROLLBACK_ENABLE + config BOOTLOADER_APP_ROLLBACK_ENABLE bool "Enable app rollback support" default n help @@ -175,22 +175,22 @@ menu "Bootloader config" Note: If during the first boot a new app the power goes out or the WDT works, then roll back will happen. Rollback is possible only between the apps with the same security versions. - config APP_ANTI_ROLLBACK + config BOOTLOADER_APP_ANTI_ROLLBACK bool "Enable app anti-rollback support" - depends on APP_ROLLBACK_ENABLE + depends on BOOTLOADER_APP_ROLLBACK_ENABLE default n help This option prevents rollback to previous firmware/application image with lower security version. - config APP_SECURE_VERSION + config BOOTLOADER_APP_SECURE_VERSION int "eFuse secure version of app" - depends on APP_ANTI_ROLLBACK + depends on BOOTLOADER_APP_ANTI_ROLLBACK default 0 help The secure version is the sequence number stored in the header of each firmware. The security version is set in the bootloader, version is recorded in the eFuse field as the number of set ones. The allocated number of bits in the efuse field - for storing the security version is limited (see APP_SECURE_VERSION_SIZE_EFUSE_FIELD option). + for storing the security version is limited (see BOOTLOADER_APP_SEC_VER_SIZE_EFUSE_FIELD option). Bootloader: When bootloader selects an app to boot, an app is selected that has a security version greater or equal that recorded in eFuse field. @@ -201,19 +201,19 @@ menu "Bootloader config" Your partition table should has a scheme with ota_0 + ota_1 (without factory). - config APP_SECURE_VERSION_SIZE_EFUSE_FIELD + config BOOTLOADER_APP_SEC_VER_SIZE_EFUSE_FIELD int "Size of the efuse secure version field" - depends on APP_ANTI_ROLLBACK + depends on BOOTLOADER_APP_ANTI_ROLLBACK range 1 32 default 32 help The size of the efuse secure version field. Its length is limited to 32 bits. This determines how many times the security version can be increased. - config EFUSE_SECURE_VERSION_EMULATE + config BOOTLOADER_EFUSE_SECURE_VERSION_EMULATE bool "Emulate operations with efuse secure version(only test)" default n - depends on APP_ANTI_ROLLBACK + depends on BOOTLOADER_APP_ANTI_ROLLBACK help This option allow emulate read/write operations with efuse secure version. It allow to test anti-rollback implemention without permanent write eFuse bits. @@ -400,7 +400,7 @@ menu "Security features" Refer to https://docs.espressif.com/projects/esp-idf/en/latest/security/secure-boot.html before enabling. - config FLASH_ENCRYPTION_ENABLED + config SECURE_FLASH_ENC_ENABLED bool "Enable flash encryption on boot (READ DOCS FIRST)" default N help @@ -411,9 +411,9 @@ menu "Security features" Read https://docs.espressif.com/projects/esp-idf/en/latest/security/flash-encryption.html before enabling. - config FLASH_ENCRYPTION_INSECURE + config SECURE_FLASH_ENC_INSECURE bool "Allow potentially insecure options" - depends on FLASH_ENCRYPTION_ENABLED + depends on SECURE_FLASH_ENC_ENABLED default N help You can disable some of the default protections offered by flash encryption, in order to enable testing or @@ -425,17 +425,17 @@ menu "Security features" https://docs.espressif.com/projects/esp-idf/en/latest/security/flash-encryption.html for details. menu "Potentially insecure options" - visible if FLASH_ENCRYPTION_INSECURE || SECURE_BOOT_INSECURE + visible if SECURE_FLASH_ENC_INSECURE || SECURE_BOOT_INSECURE # NOTE: Options in this menu NEED to have SECURE_BOOT_INSECURE - # and/or FLASH_ENCRYPTION_INSECURE in "depends on", as the menu + # and/or SECURE_FLASH_ENC_INSECURE in "depends on", as the menu # itself doesn't enable/disable its children (if it's not set, # it's possible for the insecure menu to be disabled but the insecure option # to remain on which is very bad.) config SECURE_BOOT_ALLOW_ROM_BASIC bool "Leave ROM BASIC Interpreter available on reset" - depends on SECURE_BOOT_INSECURE || FLASH_ENCRYPTION_INSECURE + depends on SECURE_BOOT_INSECURE || SECURE_FLASH_ENC_INSECURE default N help By default, the BASIC ROM Console starts on reset if no valid bootloader is @@ -449,7 +449,7 @@ menu "Security features" config SECURE_BOOT_ALLOW_JTAG bool "Allow JTAG Debugging" - depends on SECURE_BOOT_INSECURE || FLASH_ENCRYPTION_INSECURE + depends on SECURE_BOOT_INSECURE || SECURE_FLASH_ENC_INSECURE default N help If not set (default), the bootloader will permanently disable JTAG (across entire chip) on first boot @@ -474,9 +474,9 @@ menu "Security features" image to this length. It is generally not recommended to set this option, unless you have a legacy partitioning scheme which doesn't support 64KB aligned partition lengths. - config FLASH_ENCRYPTION_UART_BOOTLOADER_ALLOW_ENCRYPT + config SECURE_FLASH_UART_BOOTLOADER_ALLOW_ENC bool "Leave UART bootloader encryption enabled" - depends on FLASH_ENCRYPTION_INSECURE + depends on SECURE_FLASH_ENC_INSECURE default N help If not set (default), the bootloader will permanently disable UART bootloader encryption access on @@ -484,9 +484,9 @@ menu "Security features" It is recommended to only set this option in testing environments. - config FLASH_ENCRYPTION_UART_BOOTLOADER_ALLOW_DECRYPT + config SECURE_FLASH_UART_BOOTLOADER_ALLOW_DEC bool "Leave UART bootloader decryption enabled" - depends on FLASH_ENCRYPTION_INSECURE + depends on SECURE_FLASH_ENC_INSECURE default N help If not set (default), the bootloader will permanently disable UART bootloader decryption access on @@ -495,9 +495,9 @@ menu "Security features" Only set this option in testing environments. Setting this option allows complete bypass of flash encryption. - config FLASH_ENCRYPTION_UART_BOOTLOADER_ALLOW_CACHE + config SECURE_FLASH_UART_BOOTLOADER_ALLOW_CACHE bool "Leave UART bootloader flash cache enabled" - depends on FLASH_ENCRYPTION_INSECURE + depends on SECURE_FLASH_ENC_INSECURE default N help If not set (default), the bootloader will permanently disable UART bootloader flash cache access on diff --git a/components/bootloader/sdkconfig.rename b/components/bootloader/sdkconfig.rename new file mode 100644 index 000000000..b28f9335d --- /dev/null +++ b/components/bootloader/sdkconfig.rename @@ -0,0 +1,22 @@ +# sdkconfig replacement configurations for deprecated options formatted as +# CONFIG_DEPRECATED_OPTION CONFIG_NEW_OPTION + +CONFIG_LOG_BOOTLOADER_LEVEL CONFIG_BOOTLOADER_LOG_LEVEL +CONFIG_LOG_BOOTLOADER_LEVEL_NONE CONFIG_BOOTLOADER_LOG_LEVEL_NONE +CONFIG_LOG_BOOTLOADER_LEVEL_ERROR CONFIG_BOOTLOADER_LOG_LEVEL_ERROR +CONFIG_LOG_BOOTLOADER_LEVEL_WARN CONFIG_BOOTLOADER_LOG_LEVEL_WARN +CONFIG_LOG_BOOTLOADER_LEVEL_INFO CONFIG_BOOTLOADER_LOG_LEVEL_INFO +CONFIG_LOG_BOOTLOADER_LEVEL_DEBUG CONFIG_BOOTLOADER_LOG_LEVEL_DEBUG +CONFIG_LOG_BOOTLOADER_LEVEL_VERBOSE CONFIG_BOOTLOADER_LOG_LEVEL_VERBOSE + +CONFIG_APP_ROLLBACK_ENABLE CONFIG_BOOTLOADER_APP_ROLLBACK_ENABLE +CONFIG_APP_ANTI_ROLLBACK CONFIG_BOOTLOADER_APP_ANTI_ROLLBACK +CONFIG_APP_SECURE_VERSION CONFIG_BOOTLOADER_APP_SECURE_VERSION +CONFIG_APP_SECURE_VERSION_SIZE_EFUSE_FIELD CONFIG_BOOTLOADER_APP_SEC_VER_SIZE_EFUSE_FIELD +CONFIG_EFUSE_SECURE_VERSION_EMULATE CONFIG_BOOTLOADER_EFUSE_SECURE_VERSION_EMULATE + +CONFIG_FLASH_ENCRYPTION_ENABLED CONFIG_SECURE_FLASH_ENC_ENABLED +CONFIG_FLASH_ENCRYPTION_INSECURE CONFIG_SECURE_FLASH_ENC_INSECURE +CONFIG_FLASH_ENCRYPTION_UART_BOOTLOADER_ALLOW_ENCRYPT CONFIG_SECURE_FLASH_UART_BOOTLOADER_ALLOW_ENC +CONFIG_FLASH_ENCRYPTION_UART_BOOTLOADER_ALLOW_DECRYPT CONFIG_SECURE_FLASH_UART_BOOTLOADER_ALLOW_DEC +CONFIG_FLASH_ENCRYPTION_UART_BOOTLOADER_ALLOW_CACHE CONFIG_SECURE_FLASH_UART_BOOTLOADER_ALLOW_CACHE diff --git a/components/bootloader_support/src/bootloader_utility.c b/components/bootloader_support/src/bootloader_utility.c index 8a5a501bf..d35553181 100644 --- a/components/bootloader_support/src/bootloader_utility.c +++ b/components/bootloader_support/src/bootloader_utility.c @@ -169,7 +169,7 @@ bool bootloader_utility_load_partition_table(bootloader_state_t* bs) break; case PART_SUBTYPE_DATA_EFUSE_EM: partition_usage = "efuse"; -#ifdef CONFIG_EFUSE_SECURE_VERSION_EMULATE +#ifdef CONFIG_BOOTLOADER_EFUSE_SECURE_VERSION_EMULATE esp_efuse_init(partition->pos.offset, partition->pos.size); #endif break; @@ -243,7 +243,7 @@ static esp_err_t write_otadata(esp_ota_select_entry_t *otadata, uint32_t offset, static bool check_anti_rollback(const esp_partition_pos_t *partition) { -#ifdef CONFIG_APP_ANTI_ROLLBACK +#ifdef CONFIG_BOOTLOADER_APP_ANTI_ROLLBACK esp_app_desc_t app_desc; esp_err_t err = bootloader_common_get_partition_description(partition, &app_desc); return err == ESP_OK && esp_efuse_check_secure_version(app_desc.secure_version) == true; @@ -252,7 +252,7 @@ static bool check_anti_rollback(const esp_partition_pos_t *partition) #endif } -#ifdef CONFIG_APP_ANTI_ROLLBACK +#ifdef CONFIG_BOOTLOADER_APP_ANTI_ROLLBACK static void update_anti_rollback(const esp_partition_pos_t *partition) { esp_app_desc_t app_desc; @@ -306,7 +306,7 @@ int bootloader_utility_get_selected_boot_partition(const bootloader_state_t *bs) ESP_LOGD(TAG, "otadata[0]: sequence values 0x%08x", otadata[0].ota_seq); ESP_LOGD(TAG, "otadata[1]: sequence values 0x%08x", otadata[1].ota_seq); -#ifdef CONFIG_APP_ROLLBACK_ENABLE +#ifdef CONFIG_BOOTLOADER_APP_ROLLBACK_ENABLE bool write_encrypted = esp_flash_encryption_enabled(); for (int i = 0; i < 2; ++i) { if (otadata[i].ota_state == ESP_OTA_IMG_PENDING_VERIFY) { @@ -317,7 +317,7 @@ int bootloader_utility_get_selected_boot_partition(const bootloader_state_t *bs) } #endif -#ifndef CONFIG_APP_ANTI_ROLLBACK +#ifndef CONFIG_BOOTLOADER_APP_ANTI_ROLLBACK if ((bootloader_common_ota_select_invalid(&otadata[0]) && bootloader_common_ota_select_invalid(&otadata[1])) || bs->app_count == 0) { @@ -341,7 +341,7 @@ int bootloader_utility_get_selected_boot_partition(const bootloader_state_t *bs) #else ESP_LOGI(TAG, "Enabled a check secure version of app for anti rollback"); ESP_LOGI(TAG, "Secure version (from eFuse) = %d", esp_efuse_read_secure_version()); - // When CONFIG_APP_ANTI_ROLLBACK is enabled factory partition should not be in partition table, only two ota_app are there. + // When CONFIG_BOOTLOADER_APP_ANTI_ROLLBACK is enabled factory partition should not be in partition table, only two ota_app are there. if ((otadata[0].ota_seq == UINT32_MAX || otadata[0].crc != bootloader_common_ota_select_crc(&otadata[0])) && (otadata[1].ota_seq == UINT32_MAX || otadata[1].crc != bootloader_common_ota_select_crc(&otadata[1]))) { ESP_LOGI(TAG, "otadata[0..1] in initial state"); @@ -356,19 +356,19 @@ int bootloader_utility_get_selected_boot_partition(const bootloader_state_t *bs) uint32_t ota_seq = otadata[active_otadata].ota_seq - 1; // Raw OTA sequence number. May be more than # of OTA slots boot_index = ota_seq % bs->app_count; // Actual OTA partition selection ESP_LOGD(TAG, "Mapping seq %d -> OTA slot %d", ota_seq, boot_index); -#ifdef CONFIG_APP_ROLLBACK_ENABLE +#ifdef CONFIG_BOOTLOADER_APP_ROLLBACK_ENABLE if (otadata[active_otadata].ota_state == ESP_OTA_IMG_NEW) { ESP_LOGD(TAG, "otadata[%d] is selected as new and marked PENDING_VERIFY state", active_otadata); otadata[active_otadata].ota_state = ESP_OTA_IMG_PENDING_VERIFY; write_otadata(&otadata[active_otadata], bs->ota_info.offset + FLASH_SECTOR_SIZE * active_otadata, write_encrypted); } -#endif // CONFIG_APP_ROLLBACK_ENABLE +#endif // CONFIG_BOOTLOADER_APP_ROLLBACK_ENABLE -#ifdef CONFIG_APP_ANTI_ROLLBACK +#ifdef CONFIG_BOOTLOADER_APP_ANTI_ROLLBACK if(otadata[active_otadata].ota_state == ESP_OTA_IMG_VALID) { update_anti_rollback(&bs->ota[boot_index]); } -#endif // CONFIG_APP_ANTI_ROLLBACK +#endif // CONFIG_BOOTLOADER_APP_ANTI_ROLLBACK } else if (bs->factory.offset != 0) { ESP_LOGE(TAG, "ota data partition invalid, falling back to factory"); @@ -414,7 +414,7 @@ static void set_actual_ota_seq(const bootloader_state_t *bs, int index) bool write_encrypted = esp_flash_encryption_enabled(); write_otadata(&otadata, bs->ota_info.offset + FLASH_SECTOR_SIZE * 0, write_encrypted); ESP_LOGI(TAG, "Set actual ota_seq=%d in otadata[0]", otadata.ota_seq); -#ifdef CONFIG_APP_ANTI_ROLLBACK +#ifdef CONFIG_BOOTLOADER_APP_ANTI_ROLLBACK update_anti_rollback(&bs->ota[index]); #endif } @@ -521,7 +521,7 @@ static void load_image(const esp_image_metadata_t* image_data) * then Step 6 enables secure boot. */ -#if defined(CONFIG_SECURE_BOOT_ENABLED) || defined(CONFIG_FLASH_ENCRYPTION_ENABLED) +#if defined(CONFIG_SECURE_BOOT_ENABLED) || defined(CONFIG_SECURE_FLASH_ENC_ENABLED) esp_err_t err; #endif @@ -537,7 +537,7 @@ static void load_image(const esp_image_metadata_t* image_data) } #endif -#ifdef CONFIG_FLASH_ENCRYPTION_ENABLED +#ifdef CONFIG_SECURE_FLASH_ENC_ENABLED /* Steps 3, 4 & 5 (see above for full description): * 3) Generate flash encryption EFUSE key * 4) Encrypt flash contents @@ -566,7 +566,7 @@ static void load_image(const esp_image_metadata_t* image_data) } #endif -#ifdef CONFIG_FLASH_ENCRYPTION_ENABLED +#ifdef CONFIG_SECURE_FLASH_ENC_ENABLED if (!flash_encryption_enabled && esp_flash_encryption_enabled()) { /* Flash encryption was just enabled for the first time, so issue a system reset to ensure flash encryption diff --git a/components/bootloader_support/src/esp32/flash_encrypt.c b/components/bootloader_support/src/esp32/flash_encrypt.c index 6ca918211..54f82327b 100644 --- a/components/bootloader_support/src/esp32/flash_encrypt.c +++ b/components/bootloader_support/src/esp32/flash_encrypt.c @@ -114,19 +114,19 @@ static esp_err_t initialise_flash_encryption(void) esp_efuse_burn_new_values(); uint32_t new_wdata6 = 0; -#ifndef CONFIG_FLASH_ENCRYPTION_UART_BOOTLOADER_ALLOW_ENCRYPT +#ifndef CONFIG_SECURE_FLASH_UART_BOOTLOADER_ALLOW_ENC ESP_LOGI(TAG, "Disable UART bootloader encryption..."); new_wdata6 |= EFUSE_DISABLE_DL_ENCRYPT; #else ESP_LOGW(TAG, "Not disabling UART bootloader encryption"); #endif -#ifndef CONFIG_FLASH_ENCRYPTION_UART_BOOTLOADER_ALLOW_DECRYPT +#ifndef CONFIG_SECURE_FLASH_UART_BOOTLOADER_ALLOW_DEC ESP_LOGI(TAG, "Disable UART bootloader decryption..."); new_wdata6 |= EFUSE_DISABLE_DL_DECRYPT; #else ESP_LOGW(TAG, "Not disabling UART bootloader decryption - SECURITY COMPROMISED"); #endif -#ifndef CONFIG_FLASH_ENCRYPTION_UART_BOOTLOADER_ALLOW_CACHE +#ifndef CONFIG_SECURE_FLASH_UART_BOOTLOADER_ALLOW_CACHE ESP_LOGI(TAG, "Disable UART bootloader MMU cache..."); new_wdata6 |= EFUSE_DISABLE_DL_CACHE; #else diff --git a/components/bt/bluedroid/common/include/common/bt_trace.h b/components/bt/bluedroid/common/include/common/bt_trace.h index 7c4f25a51..a0dbf9bc7 100644 --- a/components/bt/bluedroid/common/include/common/bt_trace.h +++ b/components/bt/bluedroid/common/include/common/bt_trace.h @@ -29,7 +29,7 @@ #ifndef BOOTLOADER_BUILD #define LOG_LOCAL_LEVEL CONFIG_LOG_DEFAULT_LEVEL #else -#define LOG_LOCAL_LEVEL CONFIG_LOG_BOOTLOADER_LEVEL +#define LOG_LOCAL_LEVEL CONFIG_BOOTLOADER_LOG_LEVEL #endif #endif diff --git a/components/efuse/include/esp_efuse.h b/components/efuse/include/esp_efuse.h index 68f8491e4..b2afdbd9a 100644 --- a/components/efuse/include/esp_efuse.h +++ b/components/efuse/include/esp_efuse.h @@ -347,7 +347,7 @@ esp_err_t esp_efuse_update_secure_version(uint32_t secure_version); /* @brief Initializes variables: offset and size to simulate the work of an eFuse. * - * Note: To simulate the work of an eFuse need to set CONFIG_EFUSE_SECURE_VERSION_EMULATE option + * Note: To simulate the work of an eFuse need to set CONFIG_BOOTLOADER_EFUSE_SECURE_VERSION_EMULATE option * and to add in the partition.csv file a line `efuse_em, data, efuse, , 0x2000,`. * * @param[in] offset The starting address of the partition where the eFuse data will be located. diff --git a/components/efuse/src/esp_efuse_fields.c b/components/efuse/src/esp_efuse_fields.c index 15b41b728..f9cb97799 100644 --- a/components/efuse/src/esp_efuse_fields.c +++ b/components/efuse/src/esp_efuse_fields.c @@ -117,7 +117,7 @@ void esp_efuse_write_random_key(uint32_t blk_wdata0_reg) bzero(raw, sizeof(raw)); } -#ifdef CONFIG_EFUSE_SECURE_VERSION_EMULATE +#ifdef CONFIG_BOOTLOADER_EFUSE_SECURE_VERSION_EMULATE #include "../include_bootloader/bootloader_flash.h" #include "esp_flash_encrypt.h" @@ -172,25 +172,25 @@ static void emulate_secure_version_write(uint32_t secure_version) uint32_t esp_efuse_read_secure_version() { -#ifdef CONFIG_APP_ANTI_ROLLBACK +#ifdef CONFIG_BOOTLOADER_APP_ANTI_ROLLBACK uint32_t secure_version; -#ifdef CONFIG_EFUSE_SECURE_VERSION_EMULATE +#ifdef CONFIG_BOOTLOADER_EFUSE_SECURE_VERSION_EMULATE secure_version = emulate_secure_version_read(); #else secure_version = REG_READ(EFUSE_BLK_RD_ANTI_ROLLBACK); -#endif // CONFIG_EFUSE_SECURE_VERSION_EMULATE +#endif // CONFIG_BOOTLOADER_EFUSE_SECURE_VERSION_EMULATE - return __builtin_popcount(secure_version & ((1ULL << CONFIG_APP_SECURE_VERSION_SIZE_EFUSE_FIELD) - 1)); + return __builtin_popcount(secure_version & ((1ULL << CONFIG_BOOTLOADER_APP_SEC_VER_SIZE_EFUSE_FIELD) - 1)); #else return 0; #endif } -#ifdef CONFIG_APP_ANTI_ROLLBACK +#ifdef CONFIG_BOOTLOADER_APP_ANTI_ROLLBACK static void write_anti_rollback(uint32_t new_bits) { -#ifdef CONFIG_EFUSE_SECURE_VERSION_EMULATE +#ifdef CONFIG_BOOTLOADER_EFUSE_SECURE_VERSION_EMULATE emulate_secure_version_write(new_bits); #else esp_efuse_reset(); @@ -208,12 +208,12 @@ bool esp_efuse_check_secure_version(uint32_t secure_version) esp_err_t esp_efuse_update_secure_version(uint32_t secure_version) { -#ifdef CONFIG_APP_ANTI_ROLLBACK - if (CONFIG_APP_SECURE_VERSION_SIZE_EFUSE_FIELD < secure_version) { - ESP_LOGE(TAG, "Max secure version is %d. Given %d version can not be written.", CONFIG_APP_SECURE_VERSION_SIZE_EFUSE_FIELD, secure_version); +#ifdef CONFIG_BOOTLOADER_APP_ANTI_ROLLBACK + if (CONFIG_BOOTLOADER_APP_SEC_VER_SIZE_EFUSE_FIELD < secure_version) { + ESP_LOGE(TAG, "Max secure version is %d. Given %d version can not be written.", CONFIG_BOOTLOADER_APP_SEC_VER_SIZE_EFUSE_FIELD, secure_version); return ESP_ERR_INVALID_ARG; } -#ifndef CONFIG_EFUSE_SECURE_VERSION_EMULATE +#ifndef CONFIG_BOOTLOADER_EFUSE_SECURE_VERSION_EMULATE uint32_t coding_scheme = REG_READ(EFUSE_BLK0_RDATA6_REG) & EFUSE_CODING_SCHEME_M; if (coding_scheme != EFUSE_CODING_SCHEME_VAL_NONE) { ESP_LOGE(TAG, "Anti rollback is not supported with a 3/4 coding scheme."); diff --git a/components/esp32/cpu_start.c b/components/esp32/cpu_start.c index b8c4d86a9..f4bac3bb2 100644 --- a/components/esp32/cpu_start.c +++ b/components/esp32/cpu_start.c @@ -185,7 +185,7 @@ void IRAM_ATTR call_start_cpu0() #ifndef CONFIG_APP_EXCLUDE_PROJECT_VER_VAR ESP_EARLY_LOGI(TAG, "App version: %s", app_desc->version); #endif -#ifdef CONFIG_APP_SECURE_VERSION +#ifdef CONFIG_BOOTLOADER_APP_SECURE_VERSION ESP_EARLY_LOGI(TAG, "Secure version: %d", app_desc->secure_version); #endif #ifdef CONFIG_APP_COMPILE_TIME_DATE @@ -520,7 +520,7 @@ static void main_task(void* args) #ifndef CONFIG_BOOTLOADER_WDT_DISABLE_IN_USER_CODE rtc_wdt_disable(); #endif -#ifdef CONFIG_EFUSE_SECURE_VERSION_EMULATE +#ifdef CONFIG_BOOTLOADER_EFUSE_SECURE_VERSION_EMULATE const esp_partition_t *efuse_partition = esp_partition_find_first(ESP_PARTITION_TYPE_DATA, ESP_PARTITION_SUBTYPE_DATA_EFUSE_EM, NULL); if (efuse_partition) { esp_efuse_init(efuse_partition->address, efuse_partition->size); diff --git a/components/esptool_py/project_include.cmake b/components/esptool_py/project_include.cmake index 12c2b84d7..d6c888f43 100644 --- a/components/esptool_py/project_include.cmake +++ b/components/esptool_py/project_include.cmake @@ -13,7 +13,7 @@ set(ESPFLASHSIZE ${CONFIG_ESPTOOLPY_FLASHSIZE}) set(ESPTOOLPY_BEFORE "${CONFIG_ESPTOOLPY_BEFORE}") set(ESPTOOLPY_AFTER "${CONFIG_ESPTOOLPY_AFTER}") -if(CONFIG_SECURE_BOOT_ENABLED OR CONFIG_FLASH_ENCRYPTION_ENABLED) +if(CONFIG_SECURE_BOOT_ENABLED OR CONFIG_SECURE_FLASH_ENC_ENABLED) # If security enabled then override post flash option set(ESPTOOLPY_AFTER "no_reset") endif() @@ -191,4 +191,4 @@ function(esptool_py_flash_project_args entry offset image) list(APPEND flash_project_args_json "\"${offset}\" : \"${image}\"") set_property(TARGET flash_project_args_target PROPERTY FLASH_PROJECT_ARGS_JSON "${flash_project_args_json}") endif() -endfunction() \ No newline at end of file +endfunction() diff --git a/components/log/include/esp_log.h b/components/log/include/esp_log.h index 82acd6e1f..21ebbdf23 100644 --- a/components/log/include/esp_log.h +++ b/components/log/include/esp_log.h @@ -114,7 +114,7 @@ void esp_log_write(esp_log_level_t level, const char* tag, const char* format, . #ifndef BOOTLOADER_BUILD #define LOG_LOCAL_LEVEL CONFIG_LOG_DEFAULT_LEVEL #else -#define LOG_LOCAL_LEVEL CONFIG_LOG_BOOTLOADER_LEVEL +#define LOG_LOCAL_LEVEL CONFIG_BOOTLOADER_LOG_LEVEL #endif #endif diff --git a/components/nvs_flash/Kconfig b/components/nvs_flash/Kconfig index 080c410cd..0ae533d4c 100644 --- a/components/nvs_flash/Kconfig +++ b/components/nvs_flash/Kconfig @@ -3,7 +3,7 @@ menu NVS config NVS_ENCRYPTION bool "Enable NVS encryption" default n - depends on FLASH_ENCRYPTION_ENABLED + depends on SECURE_FLASH_ENC_ENABLED help This option enables encryption for NVS. When enabled, AES-XTS is used to encrypt the complete NVS data, except the page headers. It requires XTS encryption keys diff --git a/components/partition_table/CMakeLists.txt b/components/partition_table/CMakeLists.txt index 6fe75a660..d94e3e162 100644 --- a/components/partition_table/CMakeLists.txt +++ b/components/partition_table/CMakeLists.txt @@ -77,7 +77,7 @@ endif() # If anti-rollback option is set then factory partition should not be in Partition Table. # In this case, should be used the partition table with two ota app without the factory. partition_table_get_partition_info(factory_offset "--partition-type app --partition-subtype factory" "offset") -if(CONFIG_APP_ANTI_ROLLBACK AND factory_offset) +if(CONFIG_BOOTLOADER_APP_ANTI_ROLLBACK AND factory_offset) fail_at_build_time(check_table_contents "ERROR: Anti-rollback option is enabled. Partition table should consist of two ota app without factory partition.") add_dependencies(bootloader check_table_contents) diff --git a/components/partition_table/Makefile.projbuild b/components/partition_table/Makefile.projbuild index 57aeca2b9..1785ad811 100644 --- a/components/partition_table/Makefile.projbuild +++ b/components/partition_table/Makefile.projbuild @@ -82,7 +82,7 @@ export OTA_DATA_SIZE # If anti-rollback option is set then factory partition should not be in Partition Table. # In this case, should be used the partition table with two ota app without the factory. check_table_contents: partition_table_get_info - @echo $(if $(CONFIG_APP_ANTI_ROLLBACK), $(if $(FACTORY_OFFSET), $(error "ERROR: Anti-rollback option is enabled. Partition table should consist of two ota app without factory partition."), ""), "") + @echo $(if $(CONFIG_BOOTLOADER_APP_ANTI_ROLLBACK), $(if $(FACTORY_OFFSET), $(error "ERROR: Anti-rollback option is enabled. Partition table should consist of two ota app without factory partition."), ""), "") PARTITION_TABLE_FLASH_CMD = $(ESPTOOLPY_SERIAL) write_flash $(PARTITION_TABLE_OFFSET) $(PARTITION_TABLE_BIN) ESPTOOL_ALL_FLASH_ARGS += $(PARTITION_TABLE_OFFSET) $(PARTITION_TABLE_BIN) diff --git a/components/spi_flash/partition.c b/components/spi_flash/partition.c index a77195bbc..5aa99a36a 100644 --- a/components/spi_flash/partition.c +++ b/components/spi_flash/partition.c @@ -243,7 +243,7 @@ esp_err_t esp_partition_read(const esp_partition_t* partition, if (!partition->encrypted) { return spi_flash_read(partition->address + src_offset, dst, size); } else { -#if CONFIG_FLASH_ENCRYPTION_ENABLED +#if CONFIG_SECURE_FLASH_ENC_ENABLED /* Encrypted partitions need to be read via a cache mapping */ const void *buf; spi_flash_mmap_handle_t handle; @@ -259,7 +259,7 @@ esp_err_t esp_partition_read(const esp_partition_t* partition, return ESP_OK; #else return ESP_ERR_NOT_SUPPORTED; -#endif // CONFIG_FLASH_ENCRYPTION_ENABLED +#endif // CONFIG_SECURE_FLASH_ENC_ENABLED } } @@ -277,11 +277,11 @@ esp_err_t esp_partition_write(const esp_partition_t* partition, if (!partition->encrypted) { return spi_flash_write(dst_offset, src, size); } else { -#if CONFIG_FLASH_ENCRYPTION_ENABLED +#if CONFIG_SECURE_FLASH_ENC_ENABLED return spi_flash_write_encrypted(dst_offset, src, size); #else return ESP_ERR_NOT_SUPPORTED; -#endif // CONFIG_FLASH_ENCRYPTION_ENABLED +#endif // CONFIG_SECURE_FLASH_ENC_ENABLED } } diff --git a/docs/en/api-reference/system/ota.rst b/docs/en/api-reference/system/ota.rst index 95b0b32a0..50938a377 100644 --- a/docs/en/api-reference/system/ota.rst +++ b/docs/en/api-reference/system/ota.rst @@ -41,7 +41,7 @@ The main purpose of the application rollback is to keep the device working after * The application works fine, :cpp:func:`esp_ota_mark_app_valid_cancel_rollback` marks the running application with the state ``ESP_OTA_IMG_VALID``. There are no restrictions on booting this application. * The application has critical errors and further work is not possible, a rollback to the previous application is required, :cpp:func:`esp_ota_mark_app_invalid_rollback_and_reboot` marks the running application with the state ``ESP_OTA_IMG_INVALID`` and reset. This application will not be selected by the bootloader for boot and will boot the previously working application. -* If the :ref:`CONFIG_APP_ROLLBACK_ENABLE` option is set, and occur a reset without calling either function then happend and is rolled back. +* If the :ref:`CONFIG_BOOTLOADER_APP_ROLLBACK_ENABLE` option is set, and occur a reset without calling either function then happend and is rolled back. Note: The state is not written to the binary image of the application it is written to the ``otadata`` partition. The partition contains a ``ota_seq`` counter which is a pointer to the slot (ota_0, ota_1, ...) from which the application will be selected for boot. @@ -61,23 +61,24 @@ States control the process of selecting a boot app: +-----------------------------+--------------------------------------------------------+ | ESP_OTA_IMG_ABORTED | Will not be selected. | +-----------------------------+--------------------------------------------------------+ -| ESP_OTA_IMG_NEW | If :ref:`CONFIG_APP_ROLLBACK_ENABLE` option is set | -| | it will be selected only once. In bootloader the state | -| | immediately changes to ``ESP_OTA_IMG_PENDING_VERIFY``. | +| ESP_OTA_IMG_NEW | If :ref:`CONFIG_BOOTLOADER_APP_ROLLBACK_ENABLE` option | +| | is set it will be selected only once. In bootloader | +| | the state immediately changes to | +| | ``ESP_OTA_IMG_PENDING_VERIFY``. | +-----------------------------+--------------------------------------------------------+ -| ESP_OTA_IMG_PENDING_VERIFY | If :ref:`CONFIG_APP_ROLLBACK_ENABLE` option is set | -| | it will not be selected and the state will change to | -| | ``ESP_OTA_IMG_ABORTED``. | +| ESP_OTA_IMG_PENDING_VERIFY | If :ref:`CONFIG_BOOTLOADER_APP_ROLLBACK_ENABLE` option | +| | is set it will not be selected and the state will | +| | change to ``ESP_OTA_IMG_ABORTED``. | +-----------------------------+--------------------------------------------------------+ -If :ref:`CONFIG_APP_ROLLBACK_ENABLE` option is not enabled (by default), then the use of the following functions :cpp:func:`esp_ota_mark_app_valid_cancel_rollback` and :cpp:func:`esp_ota_mark_app_invalid_rollback_and_reboot` are optional, and ``ESP_OTA_IMG_NEW`` and ``ESP_OTA_IMG_PENDING_VERIFY`` states are not used. +If :ref:`CONFIG_BOOTLOADER_APP_ROLLBACK_ENABLE` option is not enabled (by default), then the use of the following functions :cpp:func:`esp_ota_mark_app_valid_cancel_rollback` and :cpp:func:`esp_ota_mark_app_invalid_rollback_and_reboot` are optional, and ``ESP_OTA_IMG_NEW`` and ``ESP_OTA_IMG_PENDING_VERIFY`` states are not used. -An option in Kconfig :ref:`CONFIG_APP_ROLLBACK_ENABLE` allows you to track the first boot of a new application. In this case, the application must confirm its operability by calling :cpp:func:`esp_ota_mark_app_valid_cancel_rollback` function, otherwise the application will be rolled back upon reboot. It allows you to control the operability of the application during the boot phase. Thus, a new application has only one attempt to boot successfully. +An option in Kconfig :ref:`CONFIG_BOOTLOADER_APP_ROLLBACK_ENABLE` allows you to track the first boot of a new application. In this case, the application must confirm its operability by calling :cpp:func:`esp_ota_mark_app_valid_cancel_rollback` function, otherwise the application will be rolled back upon reboot. It allows you to control the operability of the application during the boot phase. Thus, a new application has only one attempt to boot successfully. Rollback Process ^^^^^^^^^^^^^^^^ -The description of the rollback process when :ref:`CONFIG_APP_ROLLBACK_ENABLE` option is enabled: +The description of the rollback process when :ref:`CONFIG_BOOTLOADER_APP_ROLLBACK_ENABLE` option is enabled: * The new application successfully downloaded and :cpp:func:`esp_ota_set_boot_partition` function makes this partition bootable and sets the state ``ESP_OTA_IMG_NEW``. This state means that the application is new and should be monitored for its first boot. * Reboot :cpp:func:`esp_restart`. @@ -115,11 +116,12 @@ Where the states are set A brief description of where the states are set: * ``ESP_OTA_IMG_VALID`` state is set by :cpp:func:`esp_ota_mark_app_valid_cancel_rollback` function. -* ``ESP_OTA_IMG_UNDEFINED`` state is set by :cpp:func:`esp_ota_set_boot_partition` function if :ref:`CONFIG_APP_ROLLBACK_ENABLE` option is not enabled. -* ``ESP_OTA_IMG_NEW`` state is set by :cpp:func:`esp_ota_set_boot_partition` function if :ref:`CONFIG_APP_ROLLBACK_ENABLE` option is enabled. +* ``ESP_OTA_IMG_UNDEFINED`` state is set by :cpp:func:`esp_ota_set_boot_partition` function if :ref:`CONFIG_BOOTLOADER_APP_ROLLBACK_ENABLE` option is not enabled. +* ``ESP_OTA_IMG_NEW`` state is set by :cpp:func:`esp_ota_set_boot_partition` function if + :ref:`CONFIG_BOOTLOADER_APP_ROLLBACK_ENABLE` option is enabled. * ``ESP_OTA_IMG_INVALID`` state is set by :cpp:func:`esp_ota_mark_app_invalid_rollback_and_reboot` function. -* ``ESP_OTA_IMG_ABORTED`` state is set if there was no confirmation of the application operability and occurs reboots (if :ref:`CONFIG_APP_ROLLBACK_ENABLE` option is enabled). -* ``ESP_OTA_IMG_PENDING_VERIFY`` state is set in a bootloader if :ref:`CONFIG_APP_ROLLBACK_ENABLE` option is enabled and selected app has ``ESP_OTA_IMG_NEW`` state. +* ``ESP_OTA_IMG_ABORTED`` state is set if there was no confirmation of the application operability and occurs reboots (if :ref:`CONFIG_BOOTLOADER_APP_ROLLBACK_ENABLE` option is enabled). +* ``ESP_OTA_IMG_PENDING_VERIFY`` state is set in a bootloader if :ref:`CONFIG_BOOTLOADER_APP_ROLLBACK_ENABLE` option is enabled and selected app has ``ESP_OTA_IMG_NEW`` state. .. _anti-rollback: @@ -128,10 +130,10 @@ Anti-rollback Anti-rollback prevents rollback to application with security version lower than one programmed in eFuse of chip. -This function works if set :ref:`CONFIG_APP_ANTI_ROLLBACK` option. In the bootloader, when selecting a bootable application, an additional security version check is added which is on the chip and in the application image. The version in the bootable firmware must be greater than or equal to the version in the chip. +This function works if set :ref:`CONFIG_BOOTLOADER_APP_ANTI_ROLLBACK` option. In the bootloader, when selecting a bootable application, an additional security version check is added which is on the chip and in the application image. The version in the bootable firmware must be greater than or equal to the version in the chip. -:ref:`CONFIG_APP_ANTI_ROLLBACK` and :ref:`CONFIG_APP_ROLLBACK_ENABLE` options are used together. In this case, rollback is possible only on the security version which is equal or higher than the version in the chip. +:ref:`CONFIG_BOOTLOADER_APP_ANTI_ROLLBACK` and :ref:`CONFIG_BOOTLOADER_APP_ROLLBACK_ENABLE` options are used together. In this case, rollback is possible only on the security version which is equal or higher than the version in the chip. A typical anti-rollback scheme is @@ -180,13 +182,14 @@ If you want to avoid the download/erase overhead in case of the app from the ser Restrictions: -- The number of bits in the ``secure_version`` field is limited to 32 bits. This means that only 32 times you can do an anti-rollback. You can reduce the length of this efuse field use :ref:`CONFIG_APP_SECURE_VERSION_SIZE_EFUSE_FIELD` option. +- The number of bits in the ``secure_version`` field is limited to 32 bits. This means that only 32 times you can do an anti-rollback. You can reduce the length of this efuse field use :ref:`CONFIG_BOOTLOADER_APP_SEC_VER_SIZE_EFUSE_FIELD` option. - Anti-rollback only works if the encoding scheme for efuse is set to ``NONE``. - The partition table should not have a factory partition, only two of the app. ``security_version``: -- In application image it is stored in ``esp_app_desc`` structure. The number is set :ref:`CONFIG_APP_SECURE_VERSION`. +- In application image it is stored in ``esp_app_desc`` structure. The number is set + :ref:`CONFIG_BOOTLOADER_APP_SECURE_VERSION`. - In ESP32 it is stored in efuse ``EFUSE_BLK3_RDATA4_REG``. (when a eFuse bit is programmed to 1, it can never be reverted to 0). The number of bits set in this register is the ``security_version`` from app. .. _secure-ota-updates: diff --git a/docs/en/security/secure-boot.rst b/docs/en/security/secure-boot.rst index 79baa8725..9a6f8a933 100644 --- a/docs/en/security/secure-boot.rst +++ b/docs/en/security/secure-boot.rst @@ -68,7 +68,7 @@ If the bootloader becomes too large, the ESP32 will fail to boot - errors will b Options to work around this are: -- Reduce :ref:`bootloader log level `. Setting log level to Warning, Error or None all significantly reduce the final binary size (but may make it harder to debug). +- Reduce :ref:`bootloader log level `. Setting log level to Warning, Error or None all significantly reduce the final binary size (but may make it harder to debug). - Set :ref:`partition table offset ` to a higher value than 0x8000, to place the partition table later in the flash. This increases the space available for the bootloader. If the :doc:`partition table ` CSV file contains explicit partition offsets, they will need changing so no partition has an offset lower than ``CONFIG_PARTITION_TABLE_OFFSET + 0x1000``. (This includes the default partition CSV files supplied with ESP-IDF.) .. _secure-boot-howto: diff --git a/examples/ethernet/iperf/sdkconfig.defaults b/examples/ethernet/iperf/sdkconfig.defaults index 0ffd261a0..2457a4384 100644 --- a/examples/ethernet/iperf/sdkconfig.defaults +++ b/examples/ethernet/iperf/sdkconfig.defaults @@ -1,6 +1,6 @@ # Reduce bootloader log verbosity -CONFIG_LOG_BOOTLOADER_LEVEL_WARN=y -CONFIG_LOG_BOOTLOADER_LEVEL=2 +CONFIG_BOOTLOADER_LOG_LEVEL_WARN=y +CONFIG_BOOTLOADER_LOG_LEVEL=2 # Increase main task stack size CONFIG_ESP_MAIN_TASK_STACK_SIZE=7168 diff --git a/examples/peripherals/i2c/i2c_tools/sdkconfig.defaults b/examples/peripherals/i2c/i2c_tools/sdkconfig.defaults index b77f0bbdd..2d3564c64 100644 --- a/examples/peripherals/i2c/i2c_tools/sdkconfig.defaults +++ b/examples/peripherals/i2c/i2c_tools/sdkconfig.defaults @@ -1,6 +1,6 @@ # Reduce bootloader log verbosity -CONFIG_LOG_BOOTLOADER_LEVEL_WARN=y -CONFIG_LOG_BOOTLOADER_LEVEL=2 +CONFIG_BOOTLOADER_LOG_LEVEL_WARN=y +CONFIG_BOOTLOADER_LOG_LEVEL=2 # Increase main task stack size CONFIG_ESP_MAIN_TASK_STACK_SIZE=7168 diff --git a/examples/system/console/sdkconfig.defaults b/examples/system/console/sdkconfig.defaults index d485f3ce7..5e4c72ae8 100644 --- a/examples/system/console/sdkconfig.defaults +++ b/examples/system/console/sdkconfig.defaults @@ -1,6 +1,6 @@ # Reduce bootloader log verbosity -CONFIG_LOG_BOOTLOADER_LEVEL_WARN=y -CONFIG_LOG_BOOTLOADER_LEVEL=2 +CONFIG_BOOTLOADER_LOG_LEVEL_WARN=y +CONFIG_BOOTLOADER_LOG_LEVEL=2 # Increase main task stack size CONFIG_ESP_MAIN_TASK_STACK_SIZE=7168 diff --git a/examples/system/ota/README.md b/examples/system/ota/README.md index 5d1db1a80..4f692d98f 100644 --- a/examples/system/ota/README.md +++ b/examples/system/ota/README.md @@ -117,8 +117,8 @@ When the example starts up, it will print "Starting OTA example..." then: ## Support the rollback -This feature allows you to roll back to the previous firmware if the app is not operable. Option :ref:`CONFIG_APP_ROLLBACK_ENABLE` allows you to track the first boot of the application (see the``Over The Air Updates (OTA)`` article). -For ``native_ota_example``, added a bit of code to demonstrate how a rollback works. To use it, you need enable the :ref:`CONFIG_APP_ROLLBACK_ENABLE` option in Kconfig and under the "Example Configuration" submenu to set "Number of the GPIO input for diagnostic" to manage the rollback process. +This feature allows you to roll back to the previous firmware if the app is not operable. Option :ref:`CONFIG_BOOTLOADER_APP_ROLLBACK_ENABLE` allows you to track the first boot of the application (see the``Over The Air Updates (OTA)`` article). +For ``native_ota_example``, added a bit of code to demonstrate how a rollback works. To use it, you need enable the :ref:`CONFIG_BOOTLOADER_APP_ROLLBACK_ENABLE` option in Kconfig and under the "Example Configuration" submenu to set "Number of the GPIO input for diagnostic" to manage the rollback process. To trigger a rollback, this GPIO must be pulled low while the message `Diagnostics (5 sec)...` which will be on first boot. If GPIO is not pulled low then the operable of the app will be confirmed. diff --git a/examples/system/ulp/sdkconfig.defaults b/examples/system/ulp/sdkconfig.defaults index 1ef03d0e6..a5e2b8ccd 100644 --- a/examples/system/ulp/sdkconfig.defaults +++ b/examples/system/ulp/sdkconfig.defaults @@ -2,7 +2,7 @@ CONFIG_ESP32_ULP_COPROC_ENABLED=y CONFIG_ESP32_ULP_COPROC_RESERVE_MEM=1024 # Set log level to Warning to produce clean output -CONFIG_LOG_BOOTLOADER_LEVEL_WARN=y -CONFIG_LOG_BOOTLOADER_LEVEL=2 +CONFIG_BOOTLOADER_LOG_LEVEL_WARN=y +CONFIG_BOOTLOADER_LOG_LEVEL=2 CONFIG_LOG_DEFAULT_LEVEL_WARN=y CONFIG_LOG_DEFAULT_LEVEL=2 diff --git a/examples/system/ulp_adc/sdkconfig.defaults b/examples/system/ulp_adc/sdkconfig.defaults index 1ef03d0e6..a5e2b8ccd 100644 --- a/examples/system/ulp_adc/sdkconfig.defaults +++ b/examples/system/ulp_adc/sdkconfig.defaults @@ -2,7 +2,7 @@ CONFIG_ESP32_ULP_COPROC_ENABLED=y CONFIG_ESP32_ULP_COPROC_RESERVE_MEM=1024 # Set log level to Warning to produce clean output -CONFIG_LOG_BOOTLOADER_LEVEL_WARN=y -CONFIG_LOG_BOOTLOADER_LEVEL=2 +CONFIG_BOOTLOADER_LOG_LEVEL_WARN=y +CONFIG_BOOTLOADER_LOG_LEVEL=2 CONFIG_LOG_DEFAULT_LEVEL_WARN=y CONFIG_LOG_DEFAULT_LEVEL=2 diff --git a/examples/wifi/simple_sniffer/sdkconfig.defaults b/examples/wifi/simple_sniffer/sdkconfig.defaults index a67ef4dc9..233796281 100644 --- a/examples/wifi/simple_sniffer/sdkconfig.defaults +++ b/examples/wifi/simple_sniffer/sdkconfig.defaults @@ -1,6 +1,6 @@ # Reduce bootloader log verbosity -CONFIG_LOG_BOOTLOADER_LEVEL_WARN=y -CONFIG_LOG_BOOTLOADER_LEVEL=2 +CONFIG_BOOTLOADER_LOG_LEVEL_WARN=y +CONFIG_BOOTLOADER_LOG_LEVEL=2 # Increase main task stack size CONFIG_ESP_MAIN_TASK_STACK_SIZE=7168 diff --git a/tools/ldgen/samples/sdkconfig b/tools/ldgen/samples/sdkconfig index f78145b91..fcbe55626 100644 --- a/tools/ldgen/samples/sdkconfig +++ b/tools/ldgen/samples/sdkconfig @@ -8,13 +8,13 @@ CONFIG_SDK_MAKE_WARN_UNDEFINED_VARIABLES=y # # Bootloader config # -CONFIG_LOG_BOOTLOADER_LEVEL_NONE= -CONFIG_LOG_BOOTLOADER_LEVEL_ERROR= -CONFIG_LOG_BOOTLOADER_LEVEL_WARN=y -CONFIG_LOG_BOOTLOADER_LEVEL_INFO= -CONFIG_LOG_BOOTLOADER_LEVEL_DEBUG= -CONFIG_LOG_BOOTLOADER_LEVEL_VERBOSE= -CONFIG_LOG_BOOTLOADER_LEVEL=2 +CONFIG_BOOTLOADER_LOG_LEVEL_NONE= +CONFIG_BOOTLOADER_LOG_LEVEL_ERROR= +CONFIG_BOOTLOADER_LOG_LEVEL_WARN=y +CONFIG_BOOTLOADER_LOG_LEVEL_INFO= +CONFIG_BOOTLOADER_LOG_LEVEL_DEBUG= +CONFIG_BOOTLOADER_LOG_LEVEL_VERBOSE= +CONFIG_BOOTLOADER_LOG_LEVEL=2 CONFIG_BOOTLOADER_VDDSDIO_BOOST_1_8V= CONFIG_BOOTLOADER_VDDSDIO_BOOST_1_9V=y @@ -22,7 +22,7 @@ CONFIG_BOOTLOADER_VDDSDIO_BOOST_1_9V=y # Security features # CONFIG_SECURE_BOOT_ENABLED= -CONFIG_FLASH_ENCRYPTION_ENABLED= +CONFIG_SECURE_FLASH_ENC_ENABLED= # # Serial flasher config diff --git a/tools/unit-test-app/sdkconfig.defaults b/tools/unit-test-app/sdkconfig.defaults index 002431e87..fca065641 100644 --- a/tools/unit-test-app/sdkconfig.defaults +++ b/tools/unit-test-app/sdkconfig.defaults @@ -1,4 +1,4 @@ -CONFIG_LOG_BOOTLOADER_LEVEL_WARN=y +CONFIG_BOOTLOADER_LOG_LEVEL_WARN=y CONFIG_ESPTOOLPY_BAUD_921600B=y CONFIG_ESPTOOLPY_FLASHSIZE_4MB=y CONFIG_ESPTOOLPY_FLASHSIZE_DETECT=n From 151f757912c0de4bc85ad1d2c68c8ce743914ca5 Mon Sep 17 00:00:00 2001 From: Roland Dobai Date: Thu, 9 May 2019 16:43:06 +0200 Subject: [PATCH 21/21] Rename Kconfig options (examples) --- .../a2dp_gatts_coex/main/Kconfig.projbuild | 20 +++---- .../bluetooth/a2dp_gatts_coex/main/main.c | 10 ++-- .../a2dp_sink/main/Kconfig.projbuild | 20 +++---- examples/bluetooth/a2dp_sink/main/main.c | 10 ++-- .../throughput_server/main/Kconfig | 14 ++--- .../main/example_ble_server_throughput.c | 52 ++++++++-------- .../throughput_server/sdkconfig.defaults | 2 +- .../Kconfig.projbuild | 44 +++++++------- .../protocol_examples_common/connect.c | 20 +++---- .../peripherals/adc2/main/Kconfig.projbuild | 60 +++++++++---------- .../peripherals/adc2/main/adc2_example_main.c | 4 +- .../i2c/i2c_tools/main/Kconfig.projbuild | 6 +- .../i2c_tools/main/i2ctools_example_main.c | 14 ++--- .../sdio/host/main/Kconfig.projbuild | 8 +-- .../peripherals/sdio/host/main/app_main.c | 8 +-- .../http_server/restful_server/Makefile | 2 +- .../restful_server/main/CMakeLists.txt | 2 +- .../restful_server/main/Kconfig.projbuild | 18 +++--- .../restful_server/main/esp_rest_main.c | 16 ++--- examples/protocols/mdns/README.md | 2 +- .../protocols/mdns/main/Kconfig.projbuild | 2 +- .../protocols/mdns/main/mdns_example_main.c | 2 +- examples/protocols/mdns/sdkconfig.ci | 2 +- .../mqtt/publish_test/main/Kconfig.projbuild | 18 +++--- .../mqtt/publish_test/main/publish_test.c | 16 ++--- .../protocols/mqtt/publish_test/sdkconfig.ci | 10 ++-- .../components/modem/src/esp_modem.c | 26 ++++---- .../pppos_client/main/Kconfig.projbuild | 40 ++++++------- .../pppos_client/main/pppos_client_main.c | 10 ++-- .../ble_prov/main/Kconfig.projbuild | 14 ++--- .../provisioning/ble_prov/main/app_main.c | 10 ++-- .../provisioning/ble_prov/main/app_prov.c | 2 +- .../console_prov/main/Kconfig.projbuild | 14 ++--- .../provisioning/console_prov/main/app_main.c | 10 ++-- .../provisioning/console_prov/main/app_prov.c | 2 +- .../custom_config/main/Kconfig.projbuild | 20 +++---- .../custom_config/main/app_main.c | 12 ++-- .../custom_config/main/app_prov.c | 2 +- .../softap_prov/main/Kconfig.projbuild | 22 +++---- .../provisioning/softap_prov/main/app_main.c | 16 ++--- .../provisioning/softap_prov/main/app_prov.c | 2 +- .../base_mac_address/main/Kconfig.projbuild | 6 +- .../advanced_https_ota/main/Kconfig.projbuild | 6 +- .../main/advanced_https_ota_example.c | 6 +- .../native_ota_example/main/Kconfig.projbuild | 8 +-- .../main/native_ota_example.c | 12 ++-- .../simple_ota_example/main/Kconfig.projbuild | 6 +- .../main/simple_ota_example.c | 6 +- examples/wifi/espnow/main/Kconfig.projbuild | 10 ++-- examples/wifi/espnow/main/espnow_example.h | 2 +- .../wifi/espnow/main/espnow_example_main.c | 2 +- .../softAP/main/Kconfig.projbuild | 2 +- .../softAP/main/softap_example_main.c | 2 +- .../wifi/power_save/main/Kconfig.projbuild | 16 ++--- examples/wifi/power_save/main/power_save.c | 12 ++-- examples/wifi/scan/main/Kconfig.projbuild | 40 ++++++------- examples/wifi/scan/main/scan.c | 30 +++++----- .../simple_sniffer/main/Kconfig.projbuild | 4 +- .../wifi/simple_sniffer/main/cmd_sniffer.c | 2 +- .../main/simple_sniffer_example_main.c | 10 ++-- .../wpa2_enterprise/main/Kconfig.projbuild | 12 ++-- .../main/wpa2_enterprise_main.c | 10 ++-- 62 files changed, 394 insertions(+), 394 deletions(-) diff --git a/examples/bluetooth/a2dp_gatts_coex/main/Kconfig.projbuild b/examples/bluetooth/a2dp_gatts_coex/main/Kconfig.projbuild index 2f988267a..73f6d669f 100644 --- a/examples/bluetooth/a2dp_gatts_coex/main/Kconfig.projbuild +++ b/examples/bluetooth/a2dp_gatts_coex/main/Kconfig.projbuild @@ -1,41 +1,41 @@ menu "A2DP Example Configuration" - choice A2DP_SINK_OUTPUT + choice EXAMPLE_A2DP_SINK_OUTPUT prompt "A2DP Sink Output" - default A2DP_SINK_OUTPUT_EXTERNAL_I2S + default EXAMPLE_A2DP_SINK_OUTPUT_EXTERNAL_I2S help Select to use Internal DAC or external I2S driver - config A2DP_SINK_OUTPUT_INTERNAL_DAC + config EXAMPLE_A2DP_SINK_OUTPUT_INTERNAL_DAC bool "Internal DAC" help Select this to use Internal DAC sink output - config A2DP_SINK_OUTPUT_EXTERNAL_I2S + config EXAMPLE_A2DP_SINK_OUTPUT_EXTERNAL_I2S bool "External I2S Codec" help Select this to use External I2S sink output endchoice - config I2S_LRCK_PIN + config EXAMPLE_I2S_LRCK_PIN int "I2S LRCK (WS) GPIO" default 22 - depends on A2DP_SINK_OUTPUT_EXTERNAL_I2S + depends on EXAMPLE_A2DP_SINK_OUTPUT_EXTERNAL_I2S help GPIO number to use for I2S LRCK(WS) Driver. - config I2S_BCK_PIN + config EXAMPLE_I2S_BCK_PIN int "I2S BCK GPIO" default 26 - depends on A2DP_SINK_OUTPUT_EXTERNAL_I2S + depends on EXAMPLE_A2DP_SINK_OUTPUT_EXTERNAL_I2S help GPIO number to use for I2S BCK Driver. - config I2S_DATA_PIN + config EXAMPLE_I2S_DATA_PIN int "I2S DATA GPIO" default 25 - depends on A2DP_SINK_OUTPUT_EXTERNAL_I2S + depends on EXAMPLE_A2DP_SINK_OUTPUT_EXTERNAL_I2S help GPIO number to use for I2S Data Driver. diff --git a/examples/bluetooth/a2dp_gatts_coex/main/main.c b/examples/bluetooth/a2dp_gatts_coex/main/main.c index 7076d7e48..466a2ce8d 100644 --- a/examples/bluetooth/a2dp_gatts_coex/main/main.c +++ b/examples/bluetooth/a2dp_gatts_coex/main/main.c @@ -680,7 +680,7 @@ void app_main() ESP_ERROR_CHECK(err); i2s_config_t i2s_config = { -#ifdef CONFIG_A2DP_SINK_OUTPUT_INTERNAL_DAC +#ifdef CONFIG_EXAMPLE_A2DP_SINK_OUTPUT_INTERNAL_DAC .mode = I2S_MODE_MASTER | I2S_MODE_TX | I2S_MODE_DAC_BUILT_IN, #else .mode = I2S_MODE_MASTER | I2S_MODE_TX, // Only TX @@ -697,14 +697,14 @@ void app_main() i2s_driver_install(0, &i2s_config, 0, NULL); -#ifdef CONFIG_A2DP_SINK_OUTPUT_INTERNAL_DAC +#ifdef CONFIG_EXAMPLE_A2DP_SINK_OUTPUT_INTERNAL_DAC i2s_set_dac_mode(I2S_DAC_CHANNEL_BOTH_EN); i2s_set_pin(0, NULL); #else i2s_pin_config_t pin_config = { - .bck_io_num = CONFIG_I2S_BCK_PIN, - .ws_io_num = CONFIG_I2S_LRCK_PIN, - .data_out_num = CONFIG_I2S_DATA_PIN, + .bck_io_num = CONFIG_EXAMPLE_I2S_BCK_PIN, + .ws_io_num = CONFIG_EXAMPLE_I2S_LRCK_PIN, + .data_out_num = CONFIG_EXAMPLE_I2S_DATA_PIN, .data_in_num = -1 //Not used }; diff --git a/examples/bluetooth/a2dp_sink/main/Kconfig.projbuild b/examples/bluetooth/a2dp_sink/main/Kconfig.projbuild index 2f988267a..73f6d669f 100644 --- a/examples/bluetooth/a2dp_sink/main/Kconfig.projbuild +++ b/examples/bluetooth/a2dp_sink/main/Kconfig.projbuild @@ -1,41 +1,41 @@ menu "A2DP Example Configuration" - choice A2DP_SINK_OUTPUT + choice EXAMPLE_A2DP_SINK_OUTPUT prompt "A2DP Sink Output" - default A2DP_SINK_OUTPUT_EXTERNAL_I2S + default EXAMPLE_A2DP_SINK_OUTPUT_EXTERNAL_I2S help Select to use Internal DAC or external I2S driver - config A2DP_SINK_OUTPUT_INTERNAL_DAC + config EXAMPLE_A2DP_SINK_OUTPUT_INTERNAL_DAC bool "Internal DAC" help Select this to use Internal DAC sink output - config A2DP_SINK_OUTPUT_EXTERNAL_I2S + config EXAMPLE_A2DP_SINK_OUTPUT_EXTERNAL_I2S bool "External I2S Codec" help Select this to use External I2S sink output endchoice - config I2S_LRCK_PIN + config EXAMPLE_I2S_LRCK_PIN int "I2S LRCK (WS) GPIO" default 22 - depends on A2DP_SINK_OUTPUT_EXTERNAL_I2S + depends on EXAMPLE_A2DP_SINK_OUTPUT_EXTERNAL_I2S help GPIO number to use for I2S LRCK(WS) Driver. - config I2S_BCK_PIN + config EXAMPLE_I2S_BCK_PIN int "I2S BCK GPIO" default 26 - depends on A2DP_SINK_OUTPUT_EXTERNAL_I2S + depends on EXAMPLE_A2DP_SINK_OUTPUT_EXTERNAL_I2S help GPIO number to use for I2S BCK Driver. - config I2S_DATA_PIN + config EXAMPLE_I2S_DATA_PIN int "I2S DATA GPIO" default 25 - depends on A2DP_SINK_OUTPUT_EXTERNAL_I2S + depends on EXAMPLE_A2DP_SINK_OUTPUT_EXTERNAL_I2S help GPIO number to use for I2S Data Driver. diff --git a/examples/bluetooth/a2dp_sink/main/main.c b/examples/bluetooth/a2dp_sink/main/main.c index 7e709a6e9..adaf8ff43 100644 --- a/examples/bluetooth/a2dp_sink/main/main.c +++ b/examples/bluetooth/a2dp_sink/main/main.c @@ -53,7 +53,7 @@ void app_main() ESP_ERROR_CHECK(err); i2s_config_t i2s_config = { -#ifdef CONFIG_A2DP_SINK_OUTPUT_INTERNAL_DAC +#ifdef CONFIG_EXAMPLE_A2DP_SINK_OUTPUT_INTERNAL_DAC .mode = I2S_MODE_MASTER | I2S_MODE_TX | I2S_MODE_DAC_BUILT_IN, #else .mode = I2S_MODE_MASTER | I2S_MODE_TX, // Only TX @@ -70,14 +70,14 @@ void app_main() i2s_driver_install(0, &i2s_config, 0, NULL); -#ifdef CONFIG_A2DP_SINK_OUTPUT_INTERNAL_DAC +#ifdef CONFIG_EXAMPLE_A2DP_SINK_OUTPUT_INTERNAL_DAC i2s_set_dac_mode(I2S_DAC_CHANNEL_BOTH_EN); i2s_set_pin(0, NULL); #else i2s_pin_config_t pin_config = { - .bck_io_num = CONFIG_I2S_BCK_PIN, - .ws_io_num = CONFIG_I2S_LRCK_PIN, - .data_out_num = CONFIG_I2S_DATA_PIN, + .bck_io_num = CONFIG_EXAMPLE_I2S_BCK_PIN, + .ws_io_num = CONFIG_EXAMPLE_I2S_LRCK_PIN, + .data_out_num = CONFIG_EXAMPLE_I2S_DATA_PIN, .data_in_num = -1 //Not used }; diff --git a/examples/bluetooth/ble_throughput/throughput_server/main/Kconfig b/examples/bluetooth/ble_throughput/throughput_server/main/Kconfig index b2824c6d7..a5e9a858a 100644 --- a/examples/bluetooth/ble_throughput/throughput_server/main/Kconfig +++ b/examples/bluetooth/ble_throughput/throughput_server/main/Kconfig @@ -1,6 +1,6 @@ menu "Example 'GATT SERVER THROUGHPUT' Config" - config SET_RAW_ADV_DATA + config EXAMPLE_SET_RAW_ADV_DATA bool "Use raw data for advertising packets and scan response data" help If this config item is set, raw binary data will be used to generate advertising & scan response data. @@ -11,17 +11,17 @@ menu "Example 'GATT SERVER THROUGHPUT' Config" esp_ble_adv_data_t structure. The lower layer will generate the BLE packets. This option has higher overhead at runtime. - config GATTS_NOTIFY_THROUGHPUT + config EXAMPLE_GATTS_NOTIFY_THROUGHPUT bool "test the gatts notify throughput" help - If this config item is set, then the 'GATTC_WRITE_THROUGHPUT' config should be close, it can't test both - write or notify at the same time at this demo + If this config item is set, then the 'EXAMPLE_GATTC_WRITE_THROUGHPUT' config should be close, it can't test + both write or notify at the same time at this demo - config GATTC_WRITE_THROUGHPUT + config EXAMPLE_GATTC_WRITE_THROUGHPUT bool "test the gattc write throughput" help - If this config item is set, then the 'GATTS_NOTIFY_THROUGHPUT' config should be close, it can't test both - write or notify at the same time at this demo + If this config item is set, then the 'EXAMPLE_GATTS_NOTIFY_THROUGHPUT' config should be close, it can't + test both write or notify at the same time at this demo endmenu diff --git a/examples/bluetooth/ble_throughput/throughput_server/main/example_ble_server_throughput.c b/examples/bluetooth/ble_throughput/throughput_server/main/example_ble_server_throughput.c index 59a36a01a..3467104f3 100644 --- a/examples/bluetooth/ble_throughput/throughput_server/main/example_ble_server_throughput.c +++ b/examples/bluetooth/ble_throughput/throughput_server/main/example_ble_server_throughput.c @@ -38,20 +38,20 @@ #define GATTS_TAG "GATTS_DEMO" -#if (CONFIG_GATTS_NOTIFY_THROUGHPUT) +#if (CONFIG_EXAMPLE_GATTS_NOTIFY_THROUGHPUT) #define GATTS_NOTIFY_LEN 490 static SemaphoreHandle_t gatts_semaphore; static bool can_send_notify = false; static uint8_t indicate_data[GATTS_NOTIFY_LEN] = {0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0a}; -#endif /* #if (CONFIG_GATTS_NOTIFY_THROUGHPUT) */ +#endif /* #if (CONFIG_EXAMPLE_GATTS_NOTIFY_THROUGHPUT) */ -#if (CONFIG_GATTC_WRITE_THROUGHPUT) +#if (CONFIG_EXAMPLE_GATTC_WRITE_THROUGHPUT) static bool start = false; static uint64_t write_len = 0; static uint64_t start_time = 0; static uint64_t current_time = 0; -#endif /* #if (CONFIG_GATTC_WRITE_THROUGHPUT) */ +#endif /* #if (CONFIG_EXAMPLE_GATTC_WRITE_THROUGHPUT) */ static bool is_connecet = false; ///Declare the static function @@ -88,7 +88,7 @@ static uint8_t adv_config_done = 0; #define adv_config_flag (1 << 0) #define scan_rsp_config_flag (1 << 1) -#ifdef CONFIG_SET_RAW_ADV_DATA +#ifdef CONFIG_EXAMPLE_SET_RAW_ADV_DATA static uint8_t raw_adv_data[] = { 0x02, 0x01, 0x06, 0x02, 0x0a, 0xeb, 0x03, 0x03, 0xab, 0xcd @@ -142,7 +142,7 @@ static esp_ble_adv_data_t scan_rsp_data = { .flag = (ESP_BLE_ADV_FLAG_GEN_DISC | ESP_BLE_ADV_FLAG_BREDR_NOT_SPT), }; -#endif /* CONFIG_SET_RAW_ADV_DATA */ +#endif /* CONFIG_EXAMPLE_SET_RAW_ADV_DATA */ static esp_ble_adv_params_t adv_params = { .adv_int_min = 0x20, @@ -214,7 +214,7 @@ static uint8_t check_sum(uint8_t *addr, uint16_t count) static void gap_event_handler(esp_gap_ble_cb_event_t event, esp_ble_gap_cb_param_t *param) { switch (event) { -#ifdef CONFIG_SET_RAW_ADV_DATA +#ifdef CONFIG_EXAMPLE_SET_RAW_ADV_DATA case ESP_GAP_BLE_ADV_DATA_RAW_SET_COMPLETE_EVT: adv_config_done &= (~adv_config_flag); if (adv_config_done==0){ @@ -341,7 +341,7 @@ static void gatts_profile_a_event_handler(esp_gatts_cb_event_t event, esp_gatt_i if (set_dev_name_ret){ ESP_LOGE(GATTS_TAG, "set device name failed, error code = %x", set_dev_name_ret); } -#ifdef CONFIG_SET_RAW_ADV_DATA +#ifdef CONFIG_EXAMPLE_SET_RAW_ADV_DATA esp_err_t raw_adv_ret = esp_ble_gap_config_adv_data_raw(raw_adv_data, sizeof(raw_adv_data)); if (raw_adv_ret){ ESP_LOGE(GATTS_TAG, "config raw adv data failed, error code = %x ", raw_adv_ret); @@ -384,7 +384,7 @@ static void gatts_profile_a_event_handler(esp_gatts_cb_event_t event, esp_gatt_i break; } case ESP_GATTS_WRITE_EVT: { -#if (CONFIG_GATTS_NOTIFY_THROUGHPUT) +#if (CONFIG_EXAMPLE_GATTS_NOTIFY_THROUGHPUT) ESP_LOGI(GATTS_TAG, "GATT_WRITE_EVT, conn_id %d, trans_id %d, handle %d", param->write.conn_id, param->write.trans_id, param->write.handle); if (!param->write.is_prep){ ESP_LOGI(GATTS_TAG, "GATT_WRITE_EVT, value len %d, value :", param->write.len); @@ -425,9 +425,9 @@ static void gatts_profile_a_event_handler(esp_gatts_cb_event_t event, esp_gatt_i } } -#endif /* #if (CONFIG_GATTS_NOTIFY_THROUGHPUT) */ +#endif /* #if (CONFIG_EXAMPLE_GATTS_NOTIFY_THROUGHPUT) */ example_write_event_env(gatts_if, &a_prepare_write_env, param); -#if (CONFIG_GATTC_WRITE_THROUGHPUT) +#if (CONFIG_EXAMPLE_GATTC_WRITE_THROUGHPUT) if (param->write.handle == gl_profile_tab[PROFILE_A_APP_ID].char_handle) { // The last value byte is the checksum data, should used to check the data is received corrected or not. if (param->write.value[param->write.len - 1] == @@ -441,13 +441,13 @@ static void gatts_profile_a_event_handler(esp_gatts_cb_event_t event, esp_gatt_i break; } } -#endif /* #if (CONFIG_GATTC_WRITE_THROUGHPUT) */ +#endif /* #if (CONFIG_EXAMPLE_GATTC_WRITE_THROUGHPUT) */ break; } case ESP_GATTS_EXEC_WRITE_EVT: ESP_LOGI(GATTS_TAG,"ESP_GATTS_EXEC_WRITE_EVT"); -#if (CONFIG_GATTC_WRITE_THROUGHPUT) +#if (CONFIG_EXAMPLE_GATTC_WRITE_THROUGHPUT) if (param->exec_write.exec_write_flag == ESP_GATT_PREP_WRITE_CANCEL) { if (write_len > a_prepare_write_env.prepare_len) { write_len -= a_prepare_write_env.prepare_len; @@ -455,7 +455,7 @@ static void gatts_profile_a_event_handler(esp_gatts_cb_event_t event, esp_gatt_i write_len = 0; } } -#endif /* #if (CONFIG_GATTC_WRITE_THROUGHPUT) */ +#endif /* #if (CONFIG_EXAMPLE_GATTC_WRITE_THROUGHPUT) */ esp_ble_gatts_send_response(gatts_if, param->write.conn_id, param->write.trans_id, ESP_GATT_OK, NULL); example_exec_write_event_env(&a_prepare_write_env, param); break; @@ -546,11 +546,11 @@ static void gatts_profile_a_event_handler(esp_gatts_cb_event_t event, esp_gatt_i break; case ESP_GATTS_CONF_EVT: ESP_LOGI(GATTS_TAG, "ESP_GATTS_CONF_EVT, status %d", param->conf.status); -#if (CONFIG_GATTC_WRITE_THROUGHPUT) +#if (CONFIG_EXAMPLE_GATTC_WRITE_THROUGHPUT) start_time = false; current_time = 0; write_len = 0; -#endif /* #if (CONFIG_GATTC_WRITE_THROUGHPUT) */ +#endif /* #if (CONFIG_EXAMPLE_GATTC_WRITE_THROUGHPUT) */ break; case ESP_GATTS_OPEN_EVT: case ESP_GATTS_CANCEL_OPEN_EVT: @@ -558,14 +558,14 @@ static void gatts_profile_a_event_handler(esp_gatts_cb_event_t event, esp_gatt_i case ESP_GATTS_LISTEN_EVT: break; case ESP_GATTS_CONGEST_EVT: -#if (CONFIG_GATTS_NOTIFY_THROUGHPUT) +#if (CONFIG_EXAMPLE_GATTS_NOTIFY_THROUGHPUT) if (param->congest.congested) { can_send_notify = false; } else { can_send_notify = true; xSemaphoreGive(gatts_semaphore); } -#endif /* #if (CONFIG_GATTS_NOTIFY_THROUGHPUT) */ +#endif /* #if (CONFIG_EXAMPLE_GATTS_NOTIFY_THROUGHPUT) */ break; default: break; @@ -604,14 +604,14 @@ static void gatts_event_handler(esp_gatts_cb_event_t event, esp_gatt_if_t gatts_ void throughput_server_task(void *param) { vTaskDelay(2000 / portTICK_PERIOD_MS); -#if (CONFIG_GATTS_NOTIFY_THROUGHPUT) +#if (CONFIG_EXAMPLE_GATTS_NOTIFY_THROUGHPUT) uint8_t sum = check_sum(indicate_data, sizeof(indicate_data) - 1); // Added the check sum in the last data value. indicate_data[GATTS_NOTIFY_LEN - 1] = sum; -#endif /* #if (CONFIG_GATTS_NOTIFY_THROUGHPUT) */ +#endif /* #if (CONFIG_EXAMPLE_GATTS_NOTIFY_THROUGHPUT) */ while(1) { -#if (CONFIG_GATTS_NOTIFY_THROUGHPUT) +#if (CONFIG_EXAMPLE_GATTS_NOTIFY_THROUGHPUT) if (!can_send_notify) { int res = xSemaphoreTake(gatts_semaphore, portMAX_DELAY); assert(res == pdTRUE); @@ -622,9 +622,9 @@ void throughput_server_task(void *param) sizeof(indicate_data), indicate_data, false); } } -#endif /* #if (CONFIG_GATTS_NOTIFY_THROUGHPUT) */ +#endif /* #if (CONFIG_EXAMPLE_GATTS_NOTIFY_THROUGHPUT) */ -#if (CONFIG_GATTC_WRITE_THROUGHPUT) +#if (CONFIG_EXAMPLE_GATTC_WRITE_THROUGHPUT) uint32_t bit_rate = 0; vTaskDelay(2000 / portTICK_PERIOD_MS); if (start_time) { @@ -635,7 +635,7 @@ void throughput_server_task(void *param) } else { ESP_LOGI(GATTS_TAG, "GATTC write Bit rate = 0 Btye/s, = 0 bit/s"); } -#endif /* #if (CONFIG_GATTC_WRITE_THROUGHPUT) */ +#endif /* #if (CONFIG_EXAMPLE_GATTC_WRITE_THROUGHPUT) */ } } @@ -699,12 +699,12 @@ void app_main() } xTaskCreate(&throughput_server_task, "throughput_server_task", 4048, NULL, 15, NULL); -#if (CONFIG_GATTS_NOTIFY_THROUGHPUT) +#if (CONFIG_EXAMPLE_GATTS_NOTIFY_THROUGHPUT) gatts_semaphore = xSemaphoreCreateMutex(); if (!gatts_semaphore) { ESP_LOGE(GATTS_TAG, "%s, init fail, the gatts semaphore create fail.", __func__); return; } -#endif /* #if (CONFIG_GATTS_NOTIFY_THROUGHPUT) */ +#endif /* #if (CONFIG_EXAMPLE_GATTS_NOTIFY_THROUGHPUT) */ return; } diff --git a/examples/bluetooth/ble_throughput/throughput_server/sdkconfig.defaults b/examples/bluetooth/ble_throughput/throughput_server/sdkconfig.defaults index 5d486b83f..b007cab14 100644 --- a/examples/bluetooth/ble_throughput/throughput_server/sdkconfig.defaults +++ b/examples/bluetooth/ble_throughput/throughput_server/sdkconfig.defaults @@ -5,7 +5,7 @@ CONFIG_BTDM_CTRL_MODE_BLE_ONLY=y CONFIG_BTDM_CTRL_MODE_BR_EDR_ONLY= CONFIG_BTDM_CTRL_MODE_BTDM= CONFIG_BTDM_CTRL_BLE_MAX_CONN=9 -CONFIG_GATTS_NOTIFY_THROUGHPUT=y +CONFIG_EXAMPLE_GATTS_NOTIFY_THROUGHPUT=y CONFIG_BTDM_MODEM_SLEEP=n CONFIG_BTDM_CTRL_PINNED_TO_CORE_1=y CONFIG_BTDM_CTRL_PINNED_TO_CORE=1 diff --git a/examples/common_components/protocol_examples_common/Kconfig.projbuild b/examples/common_components/protocol_examples_common/Kconfig.projbuild index fe095582b..4a370b563 100644 --- a/examples/common_components/protocol_examples_common/Kconfig.projbuild +++ b/examples/common_components/protocol_examples_common/Kconfig.projbuild @@ -31,25 +31,25 @@ menu "Example Connection Configuration" Can be left blank if the network has no security set. - choice PHY_MODEL + choice EXAMPLE_PHY_MODEL prompt "Ethernet PHY" depends on EXAMPLE_CONNECT_ETHERNET - default CONFIG_PHY_TLK110 + default EXAMPLE_PHY_TLK110 help Select the PHY driver to use for the example. - config PHY_IP101 + config EXAMPLE_PHY_IP101 bool "IP101" help IP101 is a single port 10/100 MII/RMII/TP/Fiber Fast Ethernet Transceiver. Goto http://www.icplus.com.tw/pp-IP101G.html for more information about it. - config PHY_TLK110 + config EXAMPLE_PHY_TLK110 bool "TI TLK110 PHY" help Select this to use the TI TLK110 PHY - config PHY_LAN8720 + config EXAMPLE_PHY_LAN8720 bool "Microchip LAN8720 PHY" help Select this to use the Microchip LAN8720 PHY @@ -57,7 +57,7 @@ menu "Example Connection Configuration" endchoice - config PHY_ADDRESS + config EXAMPLE_PHY_ADDRESS int "PHY Address (0-31)" depends on EXAMPLE_CONNECT_ETHERNET default 31 @@ -68,32 +68,32 @@ menu "Example Connection Configuration" LAN8720 default 1 or 0 - choice PHY_CLOCK_MODE + choice EXAMPLE_PHY_CLOCK_MODE prompt "EMAC clock mode" depends on EXAMPLE_CONNECT_ETHERNET - default PHY_CLOCK_GPIO0_IN + default EXAMPLE_PHY_CLOCK_GPIO0_IN help Select external (input on GPIO0) or internal (output on GPIO16 or GPIO17) clock - config PHY_CLOCK_GPIO0_IN + config EXAMPLE_PHY_CLOCK_GPIO0_IN bool "GPIO0 input" depends on EXAMPLE_CONNECT_ETHERNET help Input of 50MHz PHY clock on GPIO0. - config PHY_CLOCK_GPIO0_OUT + config EXAMPLE_PHY_CLOCK_GPIO0_OUT bool "GPIO0 Output" help Output the internal 50MHz RMII clock on GPIO0. - config PHY_CLOCK_GPIO16_OUT + config EXAMPLE_PHY_CLOCK_GPIO16_OUT bool "GPIO16 output" depends on EXAMPLE_CONNECT_ETHERNET help Output the internal 50MHz APLL clock on GPIO16. - config PHY_CLOCK_GPIO17_OUT + config EXAMPLE_PHY_CLOCK_GPIO17_OUT bool "GPIO17 output (inverted)" depends on EXAMPLE_CONNECT_ETHERNET help @@ -101,16 +101,16 @@ menu "Example Connection Configuration" endchoice - config PHY_CLOCK_MODE + config EXAMPLE_PHY_CLOCK_MODE int depends on EXAMPLE_CONNECT_ETHERNET - default 0 if PHY_CLOCK_GPIO0_IN - default 1 if PHY_CLOCK_GPIO0_OUT - default 2 if PHY_CLOCK_GPIO16_OUT - default 3 if PHY_CLOCK_GPIO17_OUT + default 0 if EXAMPLE_PHY_CLOCK_GPIO0_IN + default 1 if EXAMPLE_PHY_CLOCK_GPIO0_OUT + default 2 if EXAMPLE_PHY_CLOCK_GPIO16_OUT + default 3 if EXAMPLE_PHY_CLOCK_GPIO17_OUT - config PHY_USE_POWER_PIN + config EXAMPLE_PHY_USE_POWER_PIN bool "Use PHY Power (enable/disable) pin" depends on EXAMPLE_CONNECT_ETHERNET default y @@ -118,16 +118,16 @@ menu "Example Connection Configuration" Use a GPIO "power pin" to power the PHY on/off during operation. Consult the example README for more details - config PHY_POWER_PIN + config EXAMPLE_PHY_POWER_PIN int "PHY Power GPIO" depends on EXAMPLE_CONNECT_ETHERNET default 17 range 0 33 - depends on PHY_USE_POWER_PIN + depends on EXAMPLE_PHY_USE_POWER_PIN help GPIO number to use for powering on/off the PHY. - config PHY_SMI_MDC_PIN + config EXAMPLE_PHY_SMI_MDC_PIN int "SMI MDC Pin" depends on EXAMPLE_CONNECT_ETHERNET default 23 @@ -135,7 +135,7 @@ menu "Example Connection Configuration" help GPIO number to use for SMI clock output MDC to PHY. - config PHY_SMI_MDIO_PIN + config EXAMPLE_PHY_SMI_MDIO_PIN int "SMI MDIO Pin" depends on EXAMPLE_CONNECT_ETHERNET default 18 diff --git a/examples/common_components/protocol_examples_common/connect.c b/examples/common_components/protocol_examples_common/connect.c index 37d9df6db..718d498f7 100644 --- a/examples/common_components/protocol_examples_common/connect.c +++ b/examples/common_components/protocol_examples_common/connect.c @@ -160,23 +160,23 @@ static void stop() #include "driver/gpio.h" -#ifdef CONFIG_PHY_LAN8720 +#ifdef CONFIG_EXAMPLE_PHY_LAN8720 #include "eth_phy/phy_lan8720.h" #define DEFAULT_ETHERNET_PHY_CONFIG phy_lan8720_default_ethernet_config #endif -#ifdef CONFIG_PHY_TLK110 +#ifdef CONFIG_EXAMPLE_PHY_TLK110 #include "eth_phy/phy_tlk110.h" #define DEFAULT_ETHERNET_PHY_CONFIG phy_tlk110_default_ethernet_config -#elif CONFIG_PHY_IP101 +#elif CONFIG_EXAMPLE_PHY_IP101 #include "eth_phy/phy_ip101.h" #define DEFAULT_ETHERNET_PHY_CONFIG phy_ip101_default_ethernet_config #endif -#define PIN_PHY_POWER CONFIG_PHY_POWER_PIN -#define PIN_SMI_MDC CONFIG_PHY_SMI_MDC_PIN -#define PIN_SMI_MDIO CONFIG_PHY_SMI_MDIO_PIN +#define PIN_PHY_POWER CONFIG_EXAMPLE_PHY_POWER_PIN +#define PIN_SMI_MDC CONFIG_EXAMPLE_PHY_SMI_MDC_PIN +#define PIN_SMI_MDIO CONFIG_EXAMPLE_PHY_SMI_MDIO_PIN -#ifdef CONFIG_PHY_USE_POWER_PIN +#ifdef CONFIG_EXAMPLE_PHY_USE_POWER_PIN /** * @brief re-define power enable func for phy * @@ -252,12 +252,12 @@ static void on_eth_event(void* arg, esp_event_base_t event_base, static void start() { eth_config_t config = DEFAULT_ETHERNET_PHY_CONFIG; - config.phy_addr = CONFIG_PHY_ADDRESS; + config.phy_addr = CONFIG_EXAMPLE_PHY_ADDRESS; config.gpio_config = eth_gpio_config_rmii; config.tcpip_input = tcpip_adapter_eth_input; - config.clock_mode = CONFIG_PHY_CLOCK_MODE; + config.clock_mode = CONFIG_EXAMPLE_PHY_CLOCK_MODE; -#ifdef CONFIG_PHY_USE_POWER_PIN +#ifdef CONFIG_EXAMPLE_PHY_USE_POWER_PIN /* Replace the default 'power enable' function with an example-specific one that toggles a power GPIO. */ config.phy_power_enable = phy_device_power_enable_via_gpio; diff --git a/examples/peripherals/adc2/main/Kconfig.projbuild b/examples/peripherals/adc2/main/Kconfig.projbuild index d122b6f4e..35b19fff7 100644 --- a/examples/peripherals/adc2/main/Kconfig.projbuild +++ b/examples/peripherals/adc2/main/Kconfig.projbuild @@ -1,61 +1,61 @@ menu "Example Configuration" - choice ADC2_EXAMPLE_CHANNEL + choice EXAMPLE_ADC2_CHANNEL bool "ADC2 Channel Num" - default ADC2_EXAMPLE_CHANNEL_7 + default EXAMPLE_ADC2_CHANNEL_7 help The channel of ADC2 used in this example. - config ADC2_EXAMPLE_CHANNEL_0 + config EXAMPLE_ADC2_CHANNEL_0 bool "ADC2 Channel 0 (GPIO 4)" - config ADC2_EXAMPLE_CHANNEL_1 + config EXAMPLE_ADC2_CHANNEL_1 bool "ADC2 Channel 1 (GPIO 0)" - config ADC2_EXAMPLE_CHANNEL_2 + config EXAMPLE_ADC2_CHANNEL_2 bool "ADC2 Channel 2 (GPIO 2)" - config ADC2_EXAMPLE_CHANNEL_3 + config EXAMPLE_ADC2_CHANNEL_3 bool "ADC2 Channel 3 (GPIO 15)" - config ADC2_EXAMPLE_CHANNEL_4 + config EXAMPLE_ADC2_CHANNEL_4 bool "ADC2 Channel 4 (GPIO 13)" - config ADC2_EXAMPLE_CHANNEL_5 + config EXAMPLE_ADC2_CHANNEL_5 bool "ADC2 Channel 5 (GPIO 12)" - config ADC2_EXAMPLE_CHANNEL_6 + config EXAMPLE_ADC2_CHANNEL_6 bool "ADC2 Channel 6 (GPIO 14)" - config ADC2_EXAMPLE_CHANNEL_7 + config EXAMPLE_ADC2_CHANNEL_7 bool "ADC2 Channel 7 (GPIO 27)" - config ADC2_EXAMPLE_CHANNEL_8 + config EXAMPLE_ADC2_CHANNEL_8 bool "ADC2 Channel 8 (GPIO 25)" - config ADC2_EXAMPLE_CHANNEL_9 + config EXAMPLE_ADC2_CHANNEL_9 bool "ADC2 Channel 9 (GPIO 26)" endchoice - config ADC2_EXAMPLE_CHANNEL + config EXAMPLE_ADC2_CHANNEL int - default 0 if ADC2_EXAMPLE_CHANNEL_0 - default 1 if ADC2_EXAMPLE_CHANNEL_1 - default 2 if ADC2_EXAMPLE_CHANNEL_2 - default 3 if ADC2_EXAMPLE_CHANNEL_3 - default 4 if ADC2_EXAMPLE_CHANNEL_4 - default 5 if ADC2_EXAMPLE_CHANNEL_5 - default 6 if ADC2_EXAMPLE_CHANNEL_6 - default 7 if ADC2_EXAMPLE_CHANNEL_7 - default 8 if ADC2_EXAMPLE_CHANNEL_8 - default 9 if ADC2_EXAMPLE_CHANNEL_9 + default 0 if EXAMPLE_ADC2_CHANNEL_0 + default 1 if EXAMPLE_ADC2_CHANNEL_1 + default 2 if EXAMPLE_ADC2_CHANNEL_2 + default 3 if EXAMPLE_ADC2_CHANNEL_3 + default 4 if EXAMPLE_ADC2_CHANNEL_4 + default 5 if EXAMPLE_ADC2_CHANNEL_5 + default 6 if EXAMPLE_ADC2_CHANNEL_6 + default 7 if EXAMPLE_ADC2_CHANNEL_7 + default 8 if EXAMPLE_ADC2_CHANNEL_8 + default 9 if EXAMPLE_ADC2_CHANNEL_9 - choice DAC_EXAMPLE_CHANNEL + choice EXAMPLE_DAC_CHANNEL bool "DAC Channel Num" - default DAC_EXAMPLE_CHANNEL_1 + default EXAMPLE_DAC_CHANNEL_1 help The channel of DAC used in this example. - config DAC_EXAMPLE_CHANNEL_1 + config EXAMPLE_DAC_CHANNEL_1 bool "DAC Channel 1 (GPIO25)" - config DAC_EXAMPLE_CHANNEL_2 + config EXAMPLE_DAC_CHANNEL_2 bool "DAC Channel 2 (GPIO26)" endchoice - config DAC_EXAMPLE_CHANNEL + config EXAMPLE_DAC_CHANNEL int - default 1 if DAC_EXAMPLE_CHANNEL_1 - default 2 if DAC_EXAMPLE_CHANNEL_2 + default 1 if EXAMPLE_DAC_CHANNEL_1 + default 2 if EXAMPLE_DAC_CHANNEL_2 endmenu diff --git a/examples/peripherals/adc2/main/adc2_example_main.c b/examples/peripherals/adc2/main/adc2_example_main.c index 3542dad8d..ccf32b3d5 100644 --- a/examples/peripherals/adc2/main/adc2_example_main.c +++ b/examples/peripherals/adc2/main/adc2_example_main.c @@ -17,8 +17,8 @@ #include "esp_system.h" #include "esp_adc_cal.h" -#define DAC_EXAMPLE_CHANNEL CONFIG_DAC_EXAMPLE_CHANNEL -#define ADC2_EXAMPLE_CHANNEL CONFIG_ADC2_EXAMPLE_CHANNEL +#define DAC_EXAMPLE_CHANNEL CONFIG_EXAMPLE_DAC_CHANNEL +#define ADC2_EXAMPLE_CHANNEL CONFIG_EXAMPLE_ADC2_CHANNEL void app_main(void) { diff --git a/examples/peripherals/i2c/i2c_tools/main/Kconfig.projbuild b/examples/peripherals/i2c/i2c_tools/main/Kconfig.projbuild index 52a6926f9..fab9d89fc 100644 --- a/examples/peripherals/i2c/i2c_tools/main/Kconfig.projbuild +++ b/examples/peripherals/i2c/i2c_tools/main/Kconfig.projbuild @@ -1,6 +1,6 @@ menu "Example Configuration" - config STORE_HISTORY + config EXAMPLE_STORE_HISTORY bool "Store command history in flash" default y help @@ -8,14 +8,14 @@ menu "Example Configuration" command history. If this option is enabled, initalizes a FAT filesystem and uses it to store command history. - config MAX_CMD_ARGUMENTS + config EXAMPLE_MAX_CMD_ARGUMENTS int "Maximum number of command line arguments" default 16 range 8 256 help maximum number of command line arguments to parse - config MAX_CMD_LENGTH + config EXAMPLE_MAX_CMD_LENGTH int "Command line buffer length" default 256 range 256 512 diff --git a/examples/peripherals/i2c/i2c_tools/main/i2ctools_example_main.c b/examples/peripherals/i2c/i2c_tools/main/i2ctools_example_main.c index c91803cd8..ea79a854d 100644 --- a/examples/peripherals/i2c/i2c_tools/main/i2ctools_example_main.c +++ b/examples/peripherals/i2c/i2c_tools/main/i2ctools_example_main.c @@ -24,7 +24,7 @@ static const char *TAG = "i2c-tools"; -#if CONFIG_STORE_HISTORY +#if CONFIG_EXAMPLE_STORE_HISTORY #define MOUNT_PATH "/data" #define HISTORY_PATH MOUNT_PATH "/history.txt" @@ -42,7 +42,7 @@ static void initialize_filesystem() return; } } -#endif // CONFIG_STORE_HISTORY +#endif // CONFIG_EXAMPLE_STORE_HISTORY static void initialize_nvs() { @@ -85,8 +85,8 @@ static void initialize_console() /* Initialize the console */ esp_console_config_t console_config = { - .max_cmdline_args = CONFIG_MAX_CMD_ARGUMENTS, - .max_cmdline_length = CONFIG_MAX_CMD_LENGTH, + .max_cmdline_args = CONFIG_EXAMPLE_MAX_CMD_ARGUMENTS, + .max_cmdline_length = CONFIG_EXAMPLE_MAX_CMD_LENGTH, #if CONFIG_LOG_COLORS .hint_color = atoi(LOG_COLOR_CYAN) #endif @@ -103,7 +103,7 @@ static void initialize_console() /* Set command history size */ linenoiseHistorySetMaxLen(100); -#if CONFIG_STORE_HISTORY +#if CONFIG_EXAMPLE_STORE_HISTORY /* Load command history from filesystem */ linenoiseHistoryLoad(HISTORY_PATH); #endif @@ -113,7 +113,7 @@ void app_main() { initialize_nvs(); -#if CONFIG_STORE_HISTORY +#if CONFIG_EXAMPLE_STORE_HISTORY initialize_filesystem(); #endif @@ -170,7 +170,7 @@ void app_main() } /* Add the command to the history */ linenoiseHistoryAdd(line); -#if CONFIG_STORE_HISTORY +#if CONFIG_EXAMPLE_STORE_HISTORY /* Save command history to filesystem */ linenoiseHistorySave(HISTORY_PATH); #endif diff --git a/examples/peripherals/sdio/host/main/Kconfig.projbuild b/examples/peripherals/sdio/host/main/Kconfig.projbuild index 586117ff1..7fb21ebd1 100644 --- a/examples/peripherals/sdio/host/main/Kconfig.projbuild +++ b/examples/peripherals/sdio/host/main/Kconfig.projbuild @@ -1,16 +1,16 @@ menu "Example Configuration" - config SDIO_EXAMPLE_OVER_SPI + config EXAMPLE_SDIO_OVER_SPI bool "Host use SPI bus to communicate with slave" default n help If this is set, the host tries using SPI bus to communicate with slave. Otherwise, the standarad SD bus is used. - config SDIO_EXAMPLE_4BIT + config EXAMPLE_SDIO_4BIT bool "Host tries using 4-bit mode to communicate with slave" default n - depends on !SDIO_EXAMPLE_OVER_SPI + depends on !EXAMPLE_SDIO_OVER_SPI help If this is set, the host tries using 4-bit mode to communicate with slave. If failed, the communication falls back to 1-bit mode. @@ -21,7 +21,7 @@ menu "Example Configuration" Note that 4-bit mode is not compatible (by default) if the slave is using 3.3V flash which requires a pull-down on the MTDI pin. - config SDIO_EXAMPLE_HIGHSPEED + config EXAMPLE_SDIO_HIGHSPEED bool "Host tries using HS mode to communicate with slave" default y help diff --git a/examples/peripherals/sdio/host/main/app_main.c b/examples/peripherals/sdio/host/main/app_main.c index cc4b1dcd9..23245a3fc 100644 --- a/examples/peripherals/sdio/host/main/app_main.c +++ b/examples/peripherals/sdio/host/main/app_main.c @@ -121,7 +121,7 @@ esp_err_t slave_reset(esp_slave_context_t *context) return ret; } -#ifdef CONFIG_SDIO_EXAMPLE_OVER_SPI +#ifdef CONFIG_EXAMPLE_SDIO_OVER_SPI static void gpio_d2_set_high() { gpio_config_t d2_config = { @@ -139,9 +139,9 @@ esp_err_t slave_init(esp_slave_context_t *context) { esp_err_t err; /* Probe */ -#ifndef CONFIG_SDIO_EXAMPLE_OVER_SPI +#ifndef CONFIG_EXAMPLE_SDIO_OVER_SPI sdmmc_host_t config = SDMMC_HOST_DEFAULT(); -#ifdef CONFIG_SDIO_EXAMPLE_4BIT +#ifdef CONFIG_EXAMPLE_SDIO_4BIT ESP_LOGI(TAG, "Probe using SD 4-bit...\n"); config.flags = SDMMC_HOST_FLAG_4BIT; #else @@ -149,7 +149,7 @@ esp_err_t slave_init(esp_slave_context_t *context) config.flags = SDMMC_HOST_FLAG_1BIT; #endif -#ifdef CONFIG_SDIO_EXAMPLE_HIGHSPEED +#ifdef CONFIG_EXAMPLE_SDIO_HIGHSPEED config.max_freq_khz = SDMMC_FREQ_HIGHSPEED; #else config.max_freq_khz = SDMMC_FREQ_DEFAULT; diff --git a/examples/protocols/http_server/restful_server/Makefile b/examples/protocols/http_server/restful_server/Makefile index 6870cd55f..c07edffd2 100644 --- a/examples/protocols/http_server/restful_server/Makefile +++ b/examples/protocols/http_server/restful_server/Makefile @@ -4,7 +4,7 @@ EXTRA_COMPONENT_DIRS = $(IDF_PATH)/examples/common_components/protocol_examples_ include $(IDF_PATH)/make/project.mk -ifdef CONFIG_WEB_DEPLOY_SF +ifdef CONFIG_EXAMPLE_WEB_DEPLOY_SF WEB_SRC_DIR = $(shell pwd)/front/web-demo ifneq ($(wildcard $(WEB_SRC_DIR)/dist/.*),) $(eval $(call spiffs_create_partition_image,www,$(WEB_SRC_DIR)/dist,FLASH_IN_PROJECT)) diff --git a/examples/protocols/http_server/restful_server/main/CMakeLists.txt b/examples/protocols/http_server/restful_server/main/CMakeLists.txt index e0a89216f..6df9c7c4d 100644 --- a/examples/protocols/http_server/restful_server/main/CMakeLists.txt +++ b/examples/protocols/http_server/restful_server/main/CMakeLists.txt @@ -3,7 +3,7 @@ set(COMPONENT_ADD_INCLUDEDIRS ".") register_component() -if(CONFIG_WEB_DEPLOY_SF) +if(CONFIG_EXAMPLE_WEB_DEPLOY_SF) set(WEB_SRC_DIR "${CMAKE_CURRENT_SOURCE_DIR}/../front/web-demo") if(EXISTS ${WEB_SRC_DIR}/dist) spiffs_create_partition_image(www ${WEB_SRC_DIR}/dist FLASH_IN_PROJECT) diff --git a/examples/protocols/http_server/restful_server/main/Kconfig.projbuild b/examples/protocols/http_server/restful_server/main/Kconfig.projbuild index 5ae5a36e6..ae0827734 100644 --- a/examples/protocols/http_server/restful_server/main/Kconfig.projbuild +++ b/examples/protocols/http_server/restful_server/main/Kconfig.projbuild @@ -1,39 +1,39 @@ menu "Example Configuration" - config MDNS_HOST_NAME + config EXAMPLE_MDNS_HOST_NAME string "mDNS Host Name" default "esp-home" help Specify the domain name used in the mDNS service. Note that webpage also take it as a part of URL where it will send GET/POST requests to. - choice WEB_DEPLOY_MODE + choice EXAMPLE_WEB_DEPLOY_MODE prompt "Website deploy mode" - default WEB_DEPLOY_SEMIHOST + default EXAMPLE_WEB_DEPLOY_SEMIHOST help Select website deploy mode. You can deploy website to host, and ESP32 will retrieve them in a semihost way (JTAG is needed). You can deploy website to SD card or SPI flash, and ESP32 will retrieve them via SDIO/SPI interface. Detailed operation steps are listed in the example README file. - config WEB_DEPLOY_SEMIHOST + config EXAMPLE_WEB_DEPLOY_SEMIHOST bool "Deploy website to host (JTAG is needed)" help Deploy website to host. It is recommended to choose this mode during developing. - config WEB_DEPLOY_SD + config EXAMPLE_WEB_DEPLOY_SD bool "Deploy website to SD card" help Deploy website to SD card. Choose this production mode if the size of website is too large (bigger than 2MB). - config WEB_DEPLOY_SF + config EXAMPLE_WEB_DEPLOY_SF bool "Deploy website to SPI Nor Flash" help Deploy website to SPI Nor Flash. Choose this production mode if the size of website is small (less than 2MB). endchoice - if WEB_DEPLOY_SEMIHOST - config HOST_PATH_TO_MOUNT + if EXAMPLE_WEB_DEPLOY_SEMIHOST + config EXAMPLE_HOST_PATH_TO_MOUNT string "Host path to mount (e.g. absolute path to web dist directory)" default "PATH-TO-WEB-DIST_DIR" help @@ -41,7 +41,7 @@ menu "Example Configuration" Note that only absolute path is acceptable. endif - config WEB_MOUNT_POINT + config EXAMPLE_WEB_MOUNT_POINT string "Website mount point in VFS" default "/www" help diff --git a/examples/protocols/http_server/restful_server/main/esp_rest_main.c b/examples/protocols/http_server/restful_server/main/esp_rest_main.c index 7785a0a41..dc885fa5b 100644 --- a/examples/protocols/http_server/restful_server/main/esp_rest_main.c +++ b/examples/protocols/http_server/restful_server/main/esp_rest_main.c @@ -30,7 +30,7 @@ esp_err_t start_rest_server(const char *base_path); static void initialise_mdns(void) { mdns_init(); - mdns_hostname_set(CONFIG_MDNS_HOST_NAME); + mdns_hostname_set(CONFIG_EXAMPLE_MDNS_HOST_NAME); mdns_instance_name_set(MDNS_INSTANCE); mdns_txt_item_t serviceTxtData[] = { @@ -42,10 +42,10 @@ static void initialise_mdns(void) sizeof(serviceTxtData) / sizeof(serviceTxtData[0]))); } -#if CONFIG_WEB_DEPLOY_SEMIHOST +#if CONFIG_EXAMPLE_WEB_DEPLOY_SEMIHOST esp_err_t init_fs(void) { - esp_err_t ret = esp_vfs_semihost_register(CONFIG_WEB_MOUNT_POINT, CONFIG_HOST_PATH_TO_MOUNT); + esp_err_t ret = esp_vfs_semihost_register(CONFIG_EXAMPLE_WEB_MOUNT_POINT, CONFIG_EXAMPLE_HOST_PATH_TO_MOUNT); if (ret != ESP_OK) { ESP_LOGE(TAG, "Failed to register semihost driver (%s)!", esp_err_to_name(ret)); return ESP_FAIL; @@ -54,7 +54,7 @@ esp_err_t init_fs(void) } #endif -#if CONFIG_WEB_DEPLOY_SD +#if CONFIG_EXAMPLE_WEB_DEPLOY_SD esp_err_t init_fs(void) { sdmmc_host_t host = SDMMC_HOST_DEFAULT(); @@ -73,7 +73,7 @@ esp_err_t init_fs(void) }; sdmmc_card_t *card; - esp_err_t ret = esp_vfs_fat_sdmmc_mount(CONFIG_WEB_MOUNT_POINT, &host, &slot_config, &mount_config, &card); + esp_err_t ret = esp_vfs_fat_sdmmc_mount(CONFIG_EXAMPLE_WEB_MOUNT_POINT, &host, &slot_config, &mount_config, &card); if (ret != ESP_OK) { if (ret == ESP_FAIL) { ESP_LOGE(TAG, "Failed to mount filesystem."); @@ -88,11 +88,11 @@ esp_err_t init_fs(void) } #endif -#if CONFIG_WEB_DEPLOY_SF +#if CONFIG_EXAMPLE_WEB_DEPLOY_SF esp_err_t init_fs(void) { esp_vfs_spiffs_conf_t conf = { - .base_path = CONFIG_WEB_MOUNT_POINT, + .base_path = CONFIG_EXAMPLE_WEB_MOUNT_POINT, .partition_label = NULL, .max_files = 5, .format_if_mount_failed = false @@ -130,5 +130,5 @@ void app_main() ESP_ERROR_CHECK(example_connect()); ESP_ERROR_CHECK(init_fs()); - ESP_ERROR_CHECK(start_rest_server(CONFIG_WEB_MOUNT_POINT)); + ESP_ERROR_CHECK(start_rest_server(CONFIG_EXAMPLE_WEB_MOUNT_POINT)); } diff --git a/examples/protocols/mdns/README.md b/examples/protocols/mdns/README.md index 182434e58..2c3516764 100644 --- a/examples/protocols/mdns/README.md +++ b/examples/protocols/mdns/README.md @@ -31,7 +31,7 @@ make -j4 flash monitor - You can now ping the device at `[board-hostname].local`, where `[board-hostname]` is preconfigured hostname, `esp32-mdns` by default. - You can also browse for `_http._tcp` on the same network to find the advertised service - Pressing the BOOT button will start querying the local network for the predefined in `check_button` hosts and services -- Note that for purpose of CI tests, configuration options of `RESOLVE_TEST_SERVICES` and `MDNS_ADD_MAC_TO_HOSTNAME` are available, but disabled by default. If enabled, then the hostname suffix of last 3 bytes from device MAC address is added, e.g. `esp32-mdns-80FFFF`, and a query for test service is issued. +- Note that for purpose of CI tests, configuration options of `MDNS_RESOLVE_TEST_SERVICES` and `MDNS_ADD_MAC_TO_HOSTNAME` are available, but disabled by default. If enabled, then the hostname suffix of last 3 bytes from device MAC address is added, e.g. `esp32-mdns-80FFFF`, and a query for test service is issued. (To exit the serial monitor, type ``Ctrl-]``.) diff --git a/examples/protocols/mdns/main/Kconfig.projbuild b/examples/protocols/mdns/main/Kconfig.projbuild index 7e7b22640..c4ae7e13b 100644 --- a/examples/protocols/mdns/main/Kconfig.projbuild +++ b/examples/protocols/mdns/main/Kconfig.projbuild @@ -12,7 +12,7 @@ menu "Example Configuration" help mDNS Instance Name for example to use - config RESOLVE_TEST_SERVICES + config MDNS_RESOLVE_TEST_SERVICES bool "Resolve test services" default n help diff --git a/examples/protocols/mdns/main/mdns_example_main.c b/examples/protocols/mdns/main/mdns_example_main.c index 1004475f3..11bee313b 100644 --- a/examples/protocols/mdns/main/mdns_example_main.c +++ b/examples/protocols/mdns/main/mdns_example_main.c @@ -165,7 +165,7 @@ static void check_button(void) static void mdns_example_task(void *pvParameters) { -#if CONFIG_RESOLVE_TEST_SERVICES == 1 +#if CONFIG_MDNS_RESOLVE_TEST_SERVICES == 1 /* Send initial queries that are started by CI tester */ query_mdns_host("tinytester"); #endif diff --git a/examples/protocols/mdns/sdkconfig.ci b/examples/protocols/mdns/sdkconfig.ci index 8d9206d0e..13b56273e 100644 --- a/examples/protocols/mdns/sdkconfig.ci +++ b/examples/protocols/mdns/sdkconfig.ci @@ -1,2 +1,2 @@ -CONFIG_RESOLVE_TEST_SERVICES=y +CONFIG_MDNS_RESOLVE_TEST_SERVICES=y CONFIG_MDNS_ADD_MAC_TO_HOSTNAME=y diff --git a/examples/protocols/mqtt/publish_test/main/Kconfig.projbuild b/examples/protocols/mqtt/publish_test/main/Kconfig.projbuild index 66d3cb09e..8360e573d 100644 --- a/examples/protocols/mqtt/publish_test/main/Kconfig.projbuild +++ b/examples/protocols/mqtt/publish_test/main/Kconfig.projbuild @@ -1,50 +1,50 @@ menu "Example Configuration" - config BROKER_SSL_URI + config EXAMPLE_BROKER_SSL_URI string "Broker SSL URL" default "mqtts://iot.eclipse.org:8883" help URL of an mqtt broker for ssl transport - config BROKER_TCP_URI + config EXAMPLE_BROKER_TCP_URI string "Broker TCP URL" default "mqtt://iot.eclipse.org:1883" help URL of an mqtt broker for tcp transport - config BROKER_WS_URI + config EXAMPLE_BROKER_WS_URI string "Broker WS URL" default "ws://iot.eclipse.org:80/ws" help URL of an mqtt broker for ws transport - config BROKER_WSS_URI + config EXAMPLE_BROKER_WSS_URI string "Broker WSS URL" default "wss://iot.eclipse.org:443/ws" help URL of an mqtt broker for wss transport - config PUBLISH_TOPIC + config EXAMPLE_PUBLISH_TOPIC string "publish topic" default "/topic/publish/esp2py" help topic to which esp32 client publishes - config SUBSCIBE_TOPIC + config EXAMPLE_SUBSCIBE_TOPIC string "subscribe topic" default "/topic/subscribe/py2esp" help topic to which esp32 client subsribes (and expects data) - config BROKER_CERTIFICATE_OVERRIDE + config EXAMPLE_BROKER_CERTIFICATE_OVERRIDE string "Broker certificate override" default "" help Please leave empty if broker certificate included from a textfile; otherwise fill in a base64 part of PEM format certificate - config BROKER_CERTIFICATE_OVERRIDDEN + config EXAMPLE_BROKER_CERTIFICATE_OVERRIDDEN bool - default y if BROKER_CERTIFICATE_OVERRIDE != "" + default y if EXAMPLE_BROKER_CERTIFICATE_OVERRIDE != "" endmenu diff --git a/examples/protocols/mqtt/publish_test/main/publish_test.c b/examples/protocols/mqtt/publish_test/main/publish_test.c index 99ef19d74..15cd2b09b 100644 --- a/examples/protocols/mqtt/publish_test/main/publish_test.c +++ b/examples/protocols/mqtt/publish_test/main/publish_test.c @@ -45,8 +45,8 @@ static size_t actual_published = 0; static int qos_test = 0; -#if CONFIG_BROKER_CERTIFICATE_OVERRIDDEN == 1 -static const uint8_t iot_eclipse_org_pem_start[] = "-----BEGIN CERTIFICATE-----\n" CONFIG_BROKER_CERTIFICATE_OVERRIDE "\n-----END CERTIFICATE-----"; +#if CONFIG_EXAMPLE_BROKER_CERTIFICATE_OVERRIDDEN == 1 +static const uint8_t iot_eclipse_org_pem_start[] = "-----BEGIN CERTIFICATE-----\n" CONFIG_EXAMPLE_BROKER_CERTIFICATE_OVERRIDE "\n-----END CERTIFICATE-----"; #else extern const uint8_t iot_eclipse_org_pem_start[] asm("_binary_iot_eclipse_org_pem_start"); #endif @@ -62,7 +62,7 @@ static esp_err_t mqtt_event_handler(esp_mqtt_event_handle_t event) case MQTT_EVENT_CONNECTED: ESP_LOGI(TAG, "MQTT_EVENT_CONNECTED"); xEventGroupSetBits(mqtt_event_group, CONNECTED_BIT); - msg_id = esp_mqtt_client_subscribe(client, CONFIG_SUBSCIBE_TOPIC, qos_test); + msg_id = esp_mqtt_client_subscribe(client, CONFIG_EXAMPLE_SUBSCIBE_TOPIC, qos_test); ESP_LOGI(TAG, "sent subscribe successful, msg_id=%d", msg_id); break; @@ -199,16 +199,16 @@ void app_main() if (0 == strcmp(transport, "tcp")) { ESP_LOGI(TAG, "[TCP transport] Startup.."); - esp_mqtt_client_set_uri(mqtt_client, CONFIG_BROKER_TCP_URI); + esp_mqtt_client_set_uri(mqtt_client, CONFIG_EXAMPLE_BROKER_TCP_URI); } else if (0 == strcmp(transport, "ssl")) { ESP_LOGI(TAG, "[SSL transport] Startup.."); - esp_mqtt_client_set_uri(mqtt_client, CONFIG_BROKER_SSL_URI); + esp_mqtt_client_set_uri(mqtt_client, CONFIG_EXAMPLE_BROKER_SSL_URI); } else if (0 == strcmp(transport, "ws")) { ESP_LOGI(TAG, "[WS transport] Startup.."); - esp_mqtt_client_set_uri(mqtt_client, CONFIG_BROKER_WS_URI); + esp_mqtt_client_set_uri(mqtt_client, CONFIG_EXAMPLE_BROKER_WS_URI); } else if (0 == strcmp(transport, "wss")) { ESP_LOGI(TAG, "[WSS transport] Startup.."); - esp_mqtt_client_set_uri(mqtt_client, CONFIG_BROKER_WSS_URI); + esp_mqtt_client_set_uri(mqtt_client, CONFIG_EXAMPLE_BROKER_WSS_URI); } else { ESP_LOGE(TAG, "Unexpected transport"); abort(); @@ -219,7 +219,7 @@ void app_main() xEventGroupWaitBits(mqtt_event_group, CONNECTED_BIT, false, true, portMAX_DELAY); for (int i = 0; i < expected_published; i++) { - int msg_id = esp_mqtt_client_publish(mqtt_client, CONFIG_PUBLISH_TOPIC, expected_data, expected_size, qos_test, 0); + int msg_id = esp_mqtt_client_publish(mqtt_client, CONFIG_EXAMPLE_PUBLISH_TOPIC, expected_data, expected_size, qos_test, 0); ESP_LOGI(TAG, "[%d] Publishing...", msg_id); } } diff --git a/examples/protocols/mqtt/publish_test/sdkconfig.ci b/examples/protocols/mqtt/publish_test/sdkconfig.ci index 00db776d7..4ff3a8dc6 100644 --- a/examples/protocols/mqtt/publish_test/sdkconfig.ci +++ b/examples/protocols/mqtt/publish_test/sdkconfig.ci @@ -1,5 +1,5 @@ -CONFIG_BROKER_SSL_URI="mqtts://${EXAMPLE_MQTT_BROKER_SSL}" -CONFIG_BROKER_TCP_URI="mqtt://${EXAMPLE_MQTT_BROKER_TCP}" -CONFIG_BROKER_WS_URI="ws://${EXAMPLE_MQTT_BROKER_WS}/ws" -CONFIG_BROKER_WSS_URI="wss://${EXAMPLE_MQTT_BROKER_WSS}/ws" -CONFIG_BROKER_CERTIFICATE_OVERRIDE="${EXAMPLE_MQTT_BROKER_CERTIFICATE}" +CONFIG_EXAMPLE_BROKER_SSL_URI="mqtts://${EXAMPLE_MQTT_BROKER_SSL}" +CONFIG_EXAMPLE_BROKER_TCP_URI="mqtt://${EXAMPLE_MQTT_BROKER_TCP}" +CONFIG_EXAMPLE_BROKER_WS_URI="ws://${EXAMPLE_MQTT_BROKER_WS}/ws" +CONFIG_EXAMPLE_BROKER_WSS_URI="wss://${EXAMPLE_MQTT_BROKER_WSS}/ws" +CONFIG_EXAMPLE_BROKER_CERTIFICATE_OVERRIDE="${EXAMPLE_MQTT_BROKER_CERTIFICATE}" diff --git a/examples/protocols/pppos_client/components/modem/src/esp_modem.c b/examples/protocols/pppos_client/components/modem/src/esp_modem.c index 9a6fc8ad3..148d67473 100644 --- a/examples/protocols/pppos_client/components/modem/src/esp_modem.c +++ b/examples/protocols/pppos_client/components/modem/src/esp_modem.c @@ -25,7 +25,7 @@ #include "esp_log.h" #include "sdkconfig.h" -#define ESP_MODEM_LINE_BUFFER_SIZE (CONFIG_UART_RX_BUFFER_SIZE / 2) +#define ESP_MODEM_LINE_BUFFER_SIZE (CONFIG_EXAMPLE_UART_RX_BUFFER_SIZE / 2) #define ESP_MODEM_EVENT_QUEUE_SIZE (16) #define MIN_PATTERN_INTERVAL (10000) @@ -299,7 +299,7 @@ static esp_err_t esp_modem_dte_change_mode(modem_dte_t *dte, modem_mode_t new_mo uart_disable_rx_intr(esp_dte->uart_port); uart_flush(esp_dte->uart_port); uart_enable_pattern_det_intr(esp_dte->uart_port, '\n', 1, MIN_PATTERN_INTERVAL, MIN_POST_IDLE, MIN_PRE_IDLE); - uart_pattern_queue_reset(esp_dte->uart_port, CONFIG_UART_PATTERN_QUEUE_SIZE); + uart_pattern_queue_reset(esp_dte->uart_port, CONFIG_EXAMPLE_UART_PATTERN_QUEUE_SIZE); MODEM_CHECK(dce->set_working_mode(dce, new_mode) == ESP_OK, "set new working mode:%d failed", err, new_mode); break; default: @@ -373,10 +373,10 @@ modem_dte_t *esp_modem_dte_init(const esp_modem_dte_config_t *config) }; MODEM_CHECK(uart_param_config(esp_dte->uart_port, &uart_config) == ESP_OK, "config uart parameter failed", err_uart_config); if (config->flow_control == MODEM_FLOW_CONTROL_HW) { - res = uart_set_pin(esp_dte->uart_port, CONFIG_MODEM_TX_PIN, CONFIG_MODEM_RX_PIN, - CONFIG_MODEM_RTS_PIN, CONFIG_MODEM_CTS_PIN); + res = uart_set_pin(esp_dte->uart_port, CONFIG_EXAMPLE_UART_MODEM_TX_PIN, CONFIG_EXAMPLE_UART_MODEM_RX_PIN, + CONFIG_EXAMPLE_UART_MODEM_RTS_PIN, CONFIG_EXAMPLE_UART_MODEM_CTS_PIN); } else { - res = uart_set_pin(esp_dte->uart_port, CONFIG_MODEM_TX_PIN, CONFIG_MODEM_RX_PIN, + res = uart_set_pin(esp_dte->uart_port, CONFIG_EXAMPLE_UART_MODEM_TX_PIN, CONFIG_EXAMPLE_UART_MODEM_RX_PIN, UART_PIN_NO_CHANGE, UART_PIN_NO_CHANGE); } MODEM_CHECK(res == ESP_OK, "config uart gpio failed", err_uart_config); @@ -388,13 +388,13 @@ modem_dte_t *esp_modem_dte_init(const esp_modem_dte_config_t *config) } MODEM_CHECK(res == ESP_OK, "config uart flow control failed", err_uart_config); /* Install UART driver and get event queue used inside driver */ - res = uart_driver_install(esp_dte->uart_port, CONFIG_UART_RX_BUFFER_SIZE, CONFIG_UART_TX_BUFFER_SIZE, - CONFIG_UART_EVENT_QUEUE_SIZE, &(esp_dte->event_queue), 0); + res = uart_driver_install(esp_dte->uart_port, CONFIG_EXAMPLE_UART_RX_BUFFER_SIZE, CONFIG_EXAMPLE_UART_TX_BUFFER_SIZE, + CONFIG_EXAMPLE_UART_EVENT_QUEUE_SIZE, &(esp_dte->event_queue), 0); MODEM_CHECK(res == ESP_OK, "install uart driver failed", err_uart_config); /* Set pattern interrupt, used to detect the end of a line. */ res = uart_enable_pattern_det_intr(esp_dte->uart_port, '\n', 1, MIN_PATTERN_INTERVAL, MIN_POST_IDLE, MIN_PRE_IDLE); /* Set pattern queue size */ - res |= uart_pattern_queue_reset(esp_dte->uart_port, CONFIG_UART_PATTERN_QUEUE_SIZE); + res |= uart_pattern_queue_reset(esp_dte->uart_port, CONFIG_EXAMPLE_UART_PATTERN_QUEUE_SIZE); MODEM_CHECK(res == ESP_OK, "config uart pattern failed", err_uart_pattern); /* Create Event loop */ esp_event_loop_args_t loop_args = { @@ -408,9 +408,9 @@ modem_dte_t *esp_modem_dte_init(const esp_modem_dte_config_t *config) /* Create UART Event task */ BaseType_t ret = xTaskCreate(uart_event_task_entry, //Task Entry "uart_event", //Task Name - CONFIG_UART_EVENT_TASK_STACK_SIZE, //Task Stack Size(Bytes) + CONFIG_EXAMPLE_UART_EVENT_TASK_STACK_SIZE, //Task Stack Size(Bytes) esp_dte, //Task Parameter - CONFIG_UART_EVENT_TASK_PRIORITY, //Task Priority + CONFIG_EXAMPLE_UART_EVENT_TASK_PRIORITY, //Task Priority & (esp_dte->uart_event_task_hdl) //Task Handler ); MODEM_CHECK(ret == pdTRUE, "create uart event task failed", err_tsk_create); @@ -573,7 +573,7 @@ esp_err_t esp_modem_setup_ppp(modem_dte_t *dte) MODEM_CHECK(dce, "DTE has not yet bind with DCE", err); esp_modem_dte_t *esp_dte = __containerof(dte, esp_modem_dte_t, parent); /* Set PDP Context */ - MODEM_CHECK(dce->define_pdp_context(dce, 1, "IP", CONFIG_ESP_MODEM_APN) == ESP_OK, "set MODEM APN failed", err); + MODEM_CHECK(dce->define_pdp_context(dce, 1, "IP", CONFIG_EXAMPLE_MODEM_APN) == ESP_OK, "set MODEM APN failed", err); /* Enter PPP mode */ MODEM_CHECK(dte->change_mode(dte, MODEM_PPP_MODE) == ESP_OK, "enter ppp mode failed", err); /* Create PPPoS interface */ @@ -589,9 +589,9 @@ esp_err_t esp_modem_setup_ppp(modem_dte_t *dte) ppp_set_usepeerdns(esp_dte->ppp, 1); /* Auth configuration */ #if PAP_SUPPORT - pppapi_set_auth(esp_dte->ppp, PPPAUTHTYPE_PAP, CONFIG_ESP_MODEM_PPP_AUTH_USERNAME, CONFIG_ESP_MODEM_PPP_AUTH_PASSWORD); + pppapi_set_auth(esp_dte->ppp, PPPAUTHTYPE_PAP, CONFIG_EXAMPLE_MODEM_PPP_AUTH_USERNAME, CONFIG_EXAMPLE_MODEM_PPP_AUTH_PASSWORD); #elif CHAP_SUPPORT - pppapi_set_auth(esp_dte->ppp, PPPAUTHTYPE_CHAP, CONFIG_ESP_MODEM_PPP_AUTH_USERNAME, CONFIG_ESP_MODEM_PPP_AUTH_PASSWORD); + pppapi_set_auth(esp_dte->ppp, PPPAUTHTYPE_CHAP, CONFIG_EXAMPLE_MODEM_PPP_AUTH_USERNAME, CONFIG_EXAMPLE_MODEM_PPP_AUTH_PASSWORD); #else #error "Unsupported AUTH Negotiation" #endif diff --git a/examples/protocols/pppos_client/main/Kconfig.projbuild b/examples/protocols/pppos_client/main/Kconfig.projbuild index 69cca758a..7d8446564 100644 --- a/examples/protocols/pppos_client/main/Kconfig.projbuild +++ b/examples/protocols/pppos_client/main/Kconfig.projbuild @@ -1,47 +1,47 @@ menu "Example Configuration" - choice ESP_MODEM_DEVICE + choice EXAMPLE_MODEM_DEVICE prompt "Choose supported modem device (DCE)" - default ESP_MODEM_DEVICE_BG96 + default EXAMPLE_MODEM_DEVICE_BG96 help Select modem device connected to the ESP DTE. - config ESP_MODEM_DEVICE_SIM800 + config EXAMPLE_MODEM_DEVICE_SIM800 bool "SIM800" help SIMCom SIM800L is a GSM/GPRS module. It supports Quad-band 850/900/1800/1900MHz. - config ESP_MODEM_DEVICE_BG96 + config EXAMPLE_MODEM_DEVICE_BG96 bool "BG96" help Quectel BG96 is a series of LTE Cat M1/Cat NB1/EGPRS module. endchoice - config ESP_MODEM_APN + config EXAMPLE_MODEM_APN string "Set Access Point Name (APN)" default "CMNET" help Logical name which is used to select the GGSN or the external packet data network. - config ESP_MODEM_PPP_AUTH_USERNAME + config EXAMPLE_MODEM_PPP_AUTH_USERNAME string "Set username for authentication" default "espressif" help Set username for PPP Authentication. - config ESP_MODEM_PPP_AUTH_PASSWORD + config EXAMPLE_MODEM_PPP_AUTH_PASSWORD string "Set password for authentication" default "esp32" help Set password for PPP Authentication. - config SEND_MSG + config EXAMPLE_SEND_MSG bool "Short message (SMS)" default n help Select this, the modem will send a short message before power off. - if SEND_MSG - config SEND_MSG_PEER_PHONE_NUMBER + if EXAMPLE_SEND_MSG + config EXAMPLE_SEND_MSG_PEER_PHONE_NUMBER string "Peer Phone Number (with area code)" default "+8610086" help @@ -49,70 +49,70 @@ menu "Example Configuration" endif menu "UART Configuration" - config MODEM_TX_PIN + config EXAMPLE_UART_MODEM_TX_PIN int "TXD Pin Number" default 25 range 0 31 help Pin number of UART TX. - config MODEM_RX_PIN + config EXAMPLE_UART_MODEM_RX_PIN int "RXD Pin Number" default 26 range 0 31 help Pin number of UART RX. - config MODEM_RTS_PIN + config EXAMPLE_UART_MODEM_RTS_PIN int "RTS Pin Number" default 27 range 0 31 help Pin number of UART RTS. - config MODEM_CTS_PIN + config EXAMPLE_UART_MODEM_CTS_PIN int "CTS Pin Number" default 23 range 0 31 help Pin number of UART CTS. - config UART_EVENT_TASK_STACK_SIZE + config EXAMPLE_UART_EVENT_TASK_STACK_SIZE int "UART Event Task Stack Size" range 2000 6000 default 2048 help Stack size of UART event task. - config UART_EVENT_TASK_PRIORITY + config EXAMPLE_UART_EVENT_TASK_PRIORITY int "UART Event Task Priority" range 3 22 default 5 help Priority of UART event task. - config UART_EVENT_QUEUE_SIZE + config EXAMPLE_UART_EVENT_QUEUE_SIZE int "UART Event Queue Size" range 10 40 default 30 help Length of UART event queue. - config UART_PATTERN_QUEUE_SIZE + config EXAMPLE_UART_PATTERN_QUEUE_SIZE int "UART Pattern Queue Size" range 10 40 default 20 help Length of UART pattern queue. - config UART_TX_BUFFER_SIZE + config EXAMPLE_UART_TX_BUFFER_SIZE int "UART TX Buffer Size" range 256 2048 default 512 help Buffer size of UART TX buffer. - config UART_RX_BUFFER_SIZE + config EXAMPLE_UART_RX_BUFFER_SIZE int "UART RX Buffer Size" range 256 2048 default 1024 diff --git a/examples/protocols/pppos_client/main/pppos_client_main.c b/examples/protocols/pppos_client/main/pppos_client_main.c index 1ef9d2c1f..bd706f6fd 100644 --- a/examples/protocols/pppos_client/main/pppos_client_main.c +++ b/examples/protocols/pppos_client/main/pppos_client_main.c @@ -24,7 +24,7 @@ static const int CONNECT_BIT = BIT0; static const int STOP_BIT = BIT1; static const int GOT_DATA_BIT = BIT2; -#if CONFIG_SEND_MSG +#if CONFIG_EXAMPLE_SEND_MSG /** * @brief This example will also show how to send short message using the infrastructure provided by esp modem library. * @note Not all modem support SMG. @@ -189,9 +189,9 @@ void app_main() /* Register event handler */ ESP_ERROR_CHECK(esp_modem_add_event_handler(dte, modem_event_handler, NULL)); /* create dce object */ -#if CONFIG_ESP_MODEM_DEVICE_SIM800 +#if CONFIG_EXAMPLE_MODEM_DEVICE_SIM800 modem_dce_t *dce = sim800_init(dte); -#elif CONFIG_ESP_MODEM_DEVICE_BG96 +#elif CONFIG_EXAMPLE_MODEM_DEVICE_BG96 modem_dce_t *dce = bg96_init(dte); #else #error "Unsupported DCE" @@ -227,9 +227,9 @@ void app_main() /* Exit PPP mode */ ESP_ERROR_CHECK(esp_modem_exit_ppp(dte)); xEventGroupWaitBits(event_group, STOP_BIT, pdTRUE, pdTRUE, portMAX_DELAY); -#if CONFIG_SEND_MSG +#if CONFIG_EXAMPLE_SEND_MSG const char *message = "Welcome to ESP32!"; - ESP_ERROR_CHECK(example_send_message_text(dce, CONFIG_SEND_MSG_PEER_PHONE_NUMBER, message)); + ESP_ERROR_CHECK(example_send_message_text(dce, CONFIG_EXAMPLE_SEND_MSG_PEER_PHONE_NUMBER, message)); ESP_LOGI(TAG, "Send send message [%s] ok", message); #endif /* Power down module */ diff --git a/examples/provisioning/ble_prov/main/Kconfig.projbuild b/examples/provisioning/ble_prov/main/Kconfig.projbuild index b236d0551..b1578f84b 100644 --- a/examples/provisioning/ble_prov/main/Kconfig.projbuild +++ b/examples/provisioning/ble_prov/main/Kconfig.projbuild @@ -1,6 +1,6 @@ menu "Example Configuration" - config USE_SEC_1 + config EXAMPLE_USE_SEC_1 bool default y prompt "Use Security Version 1" @@ -8,9 +8,9 @@ menu "Example Configuration" Security version 1 used Curve25519 key exchange for establishing secure session between device and client during provisioning - config USE_POP + config EXAMPLE_USE_POP bool - depends on USE_SEC_1 + depends on EXAMPLE_USE_SEC_1 default y prompt "Use proof-of-possession" help @@ -18,12 +18,12 @@ menu "Example Configuration" in possession of the user who is provisioning the device. This proof-of-possession is internally used to generate the shared secret through key exchange. - config POP + config EXAMPLE_POP string "Proof-of-possession" default "abcd1234" - depends on USE_POP + depends on EXAMPLE_USE_POP - config RESET_PROVISIONED + config EXAMPLE_RESET_PROVISIONED bool default n prompt "Reset provisioned status of the device" @@ -31,7 +31,7 @@ menu "Example Configuration" This erases the NVS to reset provisioned status of the device on every reboot. Provisioned status is determined by the Wi-Fi STA configuration, saved on the NVS. - config AP_RECONN_ATTEMPTS + config EXAMPLE_AP_RECONN_ATTEMPTS int "Maximum AP connection attempts" default 5 help diff --git a/examples/provisioning/ble_prov/main/app_main.c b/examples/provisioning/ble_prov/main/app_main.c index 6341c9fe3..6ce1184c2 100644 --- a/examples/provisioning/ble_prov/main/app_main.c +++ b/examples/provisioning/ble_prov/main/app_main.c @@ -21,7 +21,7 @@ #include "app_prov.h" -#define EXAMPLE_AP_RECONN_ATTEMPTS CONFIG_AP_RECONN_ATTEMPTS +#define EXAMPLE_AP_RECONN_ATTEMPTS CONFIG_EXAMPLE_AP_RECONN_ATTEMPTS static const char *TAG = "app"; @@ -94,15 +94,15 @@ static void start_ble_provisioning() /* Proof of possession */ const protocomm_security_pop_t *pop = NULL; -#ifdef CONFIG_USE_SEC_1 +#ifdef CONFIG_EXAMPLE_USE_SEC_1 security = 1; #endif /* Having proof of possession is optional */ -#ifdef CONFIG_USE_POP +#ifdef CONFIG_EXAMPLE_USE_POP const static protocomm_security_pop_t app_pop = { - .data = (uint8_t *) CONFIG_POP, - .len = (sizeof(CONFIG_POP)-1) + .data = (uint8_t *) CONFIG_EXAMPLE_POP, + .len = (sizeof(CONFIG_EXAMPLE_POP)-1) }; pop = &app_pop; #endif diff --git a/examples/provisioning/ble_prov/main/app_prov.c b/examples/provisioning/ble_prov/main/app_prov.c index be9b0d2f8..58a9d44e6 100644 --- a/examples/provisioning/ble_prov/main/app_prov.c +++ b/examples/provisioning/ble_prov/main/app_prov.c @@ -253,7 +253,7 @@ esp_err_t app_prov_is_provisioned(bool *provisioned) { *provisioned = false; -#ifdef CONFIG_RESET_PROVISIONED +#ifdef CONFIG_EXAMPLE_RESET_PROVISIONED nvs_flash_erase(); #endif diff --git a/examples/provisioning/console_prov/main/Kconfig.projbuild b/examples/provisioning/console_prov/main/Kconfig.projbuild index b236d0551..b1578f84b 100644 --- a/examples/provisioning/console_prov/main/Kconfig.projbuild +++ b/examples/provisioning/console_prov/main/Kconfig.projbuild @@ -1,6 +1,6 @@ menu "Example Configuration" - config USE_SEC_1 + config EXAMPLE_USE_SEC_1 bool default y prompt "Use Security Version 1" @@ -8,9 +8,9 @@ menu "Example Configuration" Security version 1 used Curve25519 key exchange for establishing secure session between device and client during provisioning - config USE_POP + config EXAMPLE_USE_POP bool - depends on USE_SEC_1 + depends on EXAMPLE_USE_SEC_1 default y prompt "Use proof-of-possession" help @@ -18,12 +18,12 @@ menu "Example Configuration" in possession of the user who is provisioning the device. This proof-of-possession is internally used to generate the shared secret through key exchange. - config POP + config EXAMPLE_POP string "Proof-of-possession" default "abcd1234" - depends on USE_POP + depends on EXAMPLE_USE_POP - config RESET_PROVISIONED + config EXAMPLE_RESET_PROVISIONED bool default n prompt "Reset provisioned status of the device" @@ -31,7 +31,7 @@ menu "Example Configuration" This erases the NVS to reset provisioned status of the device on every reboot. Provisioned status is determined by the Wi-Fi STA configuration, saved on the NVS. - config AP_RECONN_ATTEMPTS + config EXAMPLE_AP_RECONN_ATTEMPTS int "Maximum AP connection attempts" default 5 help diff --git a/examples/provisioning/console_prov/main/app_main.c b/examples/provisioning/console_prov/main/app_main.c index b149e5cee..35b3d575e 100644 --- a/examples/provisioning/console_prov/main/app_main.c +++ b/examples/provisioning/console_prov/main/app_main.c @@ -21,7 +21,7 @@ #include "app_prov.h" -#define EXAMPLE_AP_RECONN_ATTEMPTS CONFIG_AP_RECONN_ATTEMPTS +#define EXAMPLE_AP_RECONN_ATTEMPTS CONFIG_EXAMPLE_AP_RECONN_ATTEMPTS static const char *TAG = "app"; @@ -65,15 +65,15 @@ static void start_console_provisioning() /* Proof of possession */ const protocomm_security_pop_t *pop = NULL; -#ifdef CONFIG_USE_SEC_1 +#ifdef CONFIG_EXAMPLE_USE_SEC_1 security = 1; #endif /* Having proof of possession is optional */ -#ifdef CONFIG_USE_POP +#ifdef CONFIG_EXAMPLE_USE_POP const static protocomm_security_pop_t app_pop = { - .data = (uint8_t *) CONFIG_POP, - .len = (sizeof(CONFIG_POP)-1) + .data = (uint8_t *) CONFIG_EXAMPLE_POP, + .len = (sizeof(CONFIG_EXAMPLE_POP)-1) }; pop = &app_pop; #endif diff --git a/examples/provisioning/console_prov/main/app_prov.c b/examples/provisioning/console_prov/main/app_prov.c index ce3e52043..b260db5f4 100644 --- a/examples/provisioning/console_prov/main/app_prov.c +++ b/examples/provisioning/console_prov/main/app_prov.c @@ -219,7 +219,7 @@ esp_err_t app_prov_is_provisioned(bool *provisioned) { *provisioned = false; -#ifdef CONFIG_RESET_PROVISIONED +#ifdef CONFIG_EXAMPLE_RESET_PROVISIONED nvs_flash_erase(); #endif diff --git a/examples/provisioning/custom_config/main/Kconfig.projbuild b/examples/provisioning/custom_config/main/Kconfig.projbuild index 2718e834c..0d353fdbb 100644 --- a/examples/provisioning/custom_config/main/Kconfig.projbuild +++ b/examples/provisioning/custom_config/main/Kconfig.projbuild @@ -1,18 +1,18 @@ menu "Example Configuration" - config SOFTAP_SSID + config EXAMPLE_SSID string "Wi-Fi SSID" default "myssid" help SSID (network name) for the example to connect to. - config SOFTAP_PASS + config EXAMPLE_PASS string "Wi-Fi Password" default "mypassword" help Wi-Fi password (WPA or WPA2) for the example to use. - config USE_SEC_1 + config EXAMPLE_USE_SEC_1 bool default n prompt "Use Security Version 1" @@ -20,9 +20,9 @@ menu "Example Configuration" Security version 1 used Curve25519 key exchange for establishing secure session between device and client during provisioning - config USE_POP + config EXAMPLE_USE_POP bool - depends on USE_SEC_1 + depends on EXAMPLE_USE_SEC_1 default n prompt "Use proof-of-possession" help @@ -30,18 +30,18 @@ menu "Example Configuration" in possession of the user who is provisioning the device. This proof-of-possession is internally used to generate the shared secret through key exchange. - config POP + config EXAMPLE_POP string "Proof-of-possession" default "abcd1234" - depends on USE_POP + depends on EXAMPLE_USE_POP - config PROTOCOMM_HTTPD_PORT + config EXAMPLE_PROTOCOMM_HTTPD_PORT int "Protocomm HTTP Port" default 80 help Port on which to run Protocomm HTTP based provisioning service - config RESET_PROVISIONED + config EXAMPLE_RESET_PROVISIONED bool default n prompt "Reset provisioned status of the device" @@ -49,7 +49,7 @@ menu "Example Configuration" This erases the NVS to reset provisioned status of the device on every reboot. Provisioned status is determined by the Wi-Fi STA configuration, saved on the NVS. - config AP_RECONN_ATTEMPTS + config EXAMPLE_AP_RECONN_ATTEMPTS int "Maximum AP connection attempts" default 5 help diff --git a/examples/provisioning/custom_config/main/app_main.c b/examples/provisioning/custom_config/main/app_main.c index 583894e76..7b23c883c 100644 --- a/examples/provisioning/custom_config/main/app_main.c +++ b/examples/provisioning/custom_config/main/app_main.c @@ -21,7 +21,7 @@ #include "app_prov.h" -#define EXAMPLE_AP_RECONN_ATTEMPTS CONFIG_AP_RECONN_ATTEMPTS +#define EXAMPLE_AP_RECONN_ATTEMPTS CONFIG_EXAMPLE_AP_RECONN_ATTEMPTS static const char *TAG = "app"; @@ -65,21 +65,21 @@ static void start_softap_provisioning() /* Proof of possession */ const protocomm_security_pop_t *pop = NULL; -#ifdef CONFIG_USE_SEC_1 +#ifdef CONFIG_EXAMPLE_USE_SEC_1 security = 1; #endif /* Having proof of possession is optional */ -#ifdef CONFIG_USE_POP +#ifdef CONFIG_EXAMPLE_USE_POP const static protocomm_security_pop_t app_pop = { - .data = (uint8_t *) CONFIG_POP, - .len = (sizeof(CONFIG_POP)-1) + .data = (uint8_t *) CONFIG_EXAMPLE_POP, + .len = (sizeof(CONFIG_EXAMPLE_POP)-1) }; pop = &app_pop; #endif ESP_ERROR_CHECK(app_prov_start_softap_provisioning( - CONFIG_SOFTAP_SSID, CONFIG_SOFTAP_PASS, security, pop)); + CONFIG_EXAMPLE_SSID, CONFIG_EXAMPLE_PASS, security, pop)); } void app_main() diff --git a/examples/provisioning/custom_config/main/app_prov.c b/examples/provisioning/custom_config/main/app_prov.c index e7bb4086c..4c30ac218 100644 --- a/examples/provisioning/custom_config/main/app_prov.c +++ b/examples/provisioning/custom_config/main/app_prov.c @@ -244,7 +244,7 @@ esp_err_t app_prov_is_provisioned(bool *provisioned) { *provisioned = false; -#ifdef CONFIG_RESET_PROVISIONED +#ifdef CONFIG_EXAMPLE_RESET_PROVISIONED nvs_flash_erase(); #endif diff --git a/examples/provisioning/softap_prov/main/Kconfig.projbuild b/examples/provisioning/softap_prov/main/Kconfig.projbuild index 8f7da88ae..d0fa30966 100644 --- a/examples/provisioning/softap_prov/main/Kconfig.projbuild +++ b/examples/provisioning/softap_prov/main/Kconfig.projbuild @@ -1,25 +1,25 @@ menu "Example Configuration" - config SOFTAP_SSID_SET_MAC + config EXAMPLE_SSID_SET_MAC bool "Use MAC as SSID" default y help Set SoftAP SSID as PROV_. - config SOFTAP_SSID + config EXAMPLE_SSID string "Wi-Fi SSID" default "PROV_SSID" - depends on !SOFTAP_SSID_SET_MAC + depends on !EXAMPLE_SSID_SET_MAC help SSID (network name) for the example to connect to. - config SOFTAP_PASS + config EXAMPLE_PASS string "Wi-Fi Password" default "PROV_PASS" help Wi-Fi password (WPA or WPA2) for the example to use. - config USE_SEC_1 + config EXAMPLE_USE_SEC_1 bool default y prompt "Use Security Version 1" @@ -27,9 +27,9 @@ menu "Example Configuration" Security version 1 used Curve25519 key exchange for establishing secure session between device and client during provisioning - config USE_POP + config EXAMPLE_USE_POP bool - depends on USE_SEC_1 + depends on EXAMPLE_USE_SEC_1 default y prompt "Use proof-of-possession" help @@ -37,12 +37,12 @@ menu "Example Configuration" in possession of the user who is provisioning the device. This proof-of-possession is internally used to generate the shared secret through key exchange. - config POP + config EXAMPLE_POP string "Proof-of-possession" default "abcd1234" - depends on USE_POP + depends on EXAMPLE_USE_POP - config RESET_PROVISIONED + config EXAMPLE_RESET_PROVISIONED bool default n prompt "Reset provisioned status of the device" @@ -50,7 +50,7 @@ menu "Example Configuration" This erases the NVS to reset provisioned status of the device on every reboot. Provisioned status is determined by the Wi-Fi STA configuration, saved on the NVS. - config AP_RECONN_ATTEMPTS + config EXAMPLE_AP_RECONN_ATTEMPTS int "Maximum AP connection attempts" default 5 help diff --git a/examples/provisioning/softap_prov/main/app_main.c b/examples/provisioning/softap_prov/main/app_main.c index 4037f5091..a775f7a2f 100644 --- a/examples/provisioning/softap_prov/main/app_main.c +++ b/examples/provisioning/softap_prov/main/app_main.c @@ -21,7 +21,7 @@ #include "app_prov.h" -#define EXAMPLE_AP_RECONN_ATTEMPTS CONFIG_AP_RECONN_ATTEMPTS +#define EXAMPLE_AP_RECONN_ATTEMPTS CONFIG_EXAMPLE_AP_RECONN_ATTEMPTS static const char *TAG = "app"; @@ -65,23 +65,23 @@ static void start_softap_provisioning() /* Proof of possession */ const protocomm_security_pop_t *pop = NULL; -#ifdef CONFIG_USE_SEC_1 +#ifdef CONFIG_EXAMPLE_USE_SEC_1 security = 1; #endif /* Having proof of possession is optional */ -#ifdef CONFIG_USE_POP +#ifdef CONFIG_EXAMPLE_USE_POP const static protocomm_security_pop_t app_pop = { - .data = (uint8_t *) CONFIG_POP, - .len = (sizeof(CONFIG_POP)-1) + .data = (uint8_t *) CONFIG_EXAMPLE_POP, + .len = (sizeof(CONFIG_EXAMPLE_POP)-1) }; pop = &app_pop; #endif const char *ssid = NULL; -#ifdef CONFIG_SOFTAP_SSID - ssid = CONFIG_SOFTAP_SSID; +#ifdef CONFIG_EXAMPLE_SSID + ssid = CONFIG_EXAMPLE_SSID; #else uint8_t eth_mac[6]; esp_wifi_get_mac(WIFI_IF_STA, eth_mac); @@ -94,7 +94,7 @@ static void start_softap_provisioning() #endif ESP_ERROR_CHECK(app_prov_start_softap_provisioning( - ssid, CONFIG_SOFTAP_PASS, security, pop)); + ssid, CONFIG_EXAMPLE_PASS, security, pop)); } void app_main() diff --git a/examples/provisioning/softap_prov/main/app_prov.c b/examples/provisioning/softap_prov/main/app_prov.c index 2d625edce..35ad3edf8 100644 --- a/examples/provisioning/softap_prov/main/app_prov.c +++ b/examples/provisioning/softap_prov/main/app_prov.c @@ -230,7 +230,7 @@ esp_err_t app_prov_is_provisioned(bool *provisioned) { *provisioned = false; -#ifdef CONFIG_RESET_PROVISIONED +#ifdef CONFIG_EXAMPLE_RESET_PROVISIONED nvs_flash_erase(); #endif diff --git a/examples/system/base_mac_address/main/Kconfig.projbuild b/examples/system/base_mac_address/main/Kconfig.projbuild index ce2b2c35c..f64f01bf2 100644 --- a/examples/system/base_mac_address/main/Kconfig.projbuild +++ b/examples/system/base_mac_address/main/Kconfig.projbuild @@ -23,10 +23,10 @@ menu "Example Configuration" bool "Other external storage" endchoice - choice BASE_MAC_STORED_EFUSE_BLK3_ERROR_BEHAVIOR + choice BASE_MAC_STORED_EFUSE_BLK3_ERROR_BEHAV prompt "Read base MAC address from BLK3 of eFuse error behavior" depends on BASE_MAC_STORED_EFUSE_BLK3 - default BASE_MAC_STORED_EFUSE_BLK3_ERROR_USE_DEFAULT + default BASE_MAC_STORED_EFUSE_BLK3_ERROR_DEFAULT help Select behavior when reading base MAC address from BLK3 of eFuse error. If "Abort" is selected, esp32 will abort. @@ -35,7 +35,7 @@ menu "Example Configuration" config BASE_MAC_STORED_EFUSE_BLK3_ERROR_ABORT bool "Abort" - config BASE_MAC_STORED_EFUSE_BLK3_ERROR_USE_DEFAULT + config BASE_MAC_STORED_EFUSE_BLK3_ERROR_DEFAULT bool "Use base MAC address from BLK3 of eFuse" endchoice diff --git a/examples/system/ota/advanced_https_ota/main/Kconfig.projbuild b/examples/system/ota/advanced_https_ota/main/Kconfig.projbuild index f3f71e3a8..3bfb01794 100644 --- a/examples/system/ota/advanced_https_ota/main/Kconfig.projbuild +++ b/examples/system/ota/advanced_https_ota/main/Kconfig.projbuild @@ -1,18 +1,18 @@ menu "Example Configuration" - config WIFI_SSID + config EXAMPLE_WIFI_SSID string "WiFi SSID" default "myssid" help SSID (network name) for the example to connect to. - config WIFI_PASSWORD + config EXAMPLE_WIFI_PASSWORD string "WiFi Password" default "mypassword" help WiFi password (WPA or WPA2) for the example to use. - config FIRMWARE_UPGRADE_URL + config EXAMPLE_FIRMWARE_UPGRADE_URL string "firmware upgrade url endpoint" default "https://192.168.0.3:8070/hello-world.bin" help diff --git a/examples/system/ota/advanced_https_ota/main/advanced_https_ota_example.c b/examples/system/ota/advanced_https_ota/main/advanced_https_ota_example.c index 43fd16243..e2cd48e42 100644 --- a/examples/system/ota/advanced_https_ota/main/advanced_https_ota_example.c +++ b/examples/system/ota/advanced_https_ota/main/advanced_https_ota_example.c @@ -65,8 +65,8 @@ static void initialise_wifi(void) ESP_ERROR_CHECK( esp_wifi_set_storage(WIFI_STORAGE_RAM) ); wifi_config_t wifi_config = { .sta = { - .ssid = CONFIG_WIFI_SSID, - .password = CONFIG_WIFI_PASSWORD, + .ssid = CONFIG_EXAMPLE_WIFI_SSID, + .password = CONFIG_EXAMPLE_WIFI_PASSWORD, }, }; ESP_LOGI(TAG, "Setting WiFi configuration SSID %s", wifi_config.sta.ssid); @@ -104,7 +104,7 @@ void advanced_ota_example_task(void * pvParameter) esp_err_t ota_finish_err = ESP_OK; esp_http_client_config_t config = { - .url = CONFIG_FIRMWARE_UPGRADE_URL, + .url = CONFIG_EXAMPLE_FIRMWARE_UPGRADE_URL, .cert_pem = (char *)server_cert_pem_start, }; diff --git a/examples/system/ota/native_ota_example/main/Kconfig.projbuild b/examples/system/ota/native_ota_example/main/Kconfig.projbuild index ebb999572..fb50b5a1e 100644 --- a/examples/system/ota/native_ota_example/main/Kconfig.projbuild +++ b/examples/system/ota/native_ota_example/main/Kconfig.projbuild @@ -1,12 +1,12 @@ menu "Example Configuration" - config WIFI_SSID + config EXAMPLE_WIFI_SSID string "WiFi SSID" default "myssid" help SSID (network name) for the example to connect to. - config WIFI_PASSWORD + config EXAMPLE_WIFI_PASSWORD string "WiFi Password" default "mypassword" help @@ -14,7 +14,7 @@ menu "Example Configuration" Can be left blank if the network has no security set. - config FIRMWARE_UPG_URL + config EXAMPLE_FIRMWARE_UPG_URL string "HTTP Server URL" default "https://192.168.0.3:8070/hello-world.bin" help @@ -22,7 +22,7 @@ menu "Example Configuration" See example README.md for details. - config GPIO_DIAGNOSTIC + config EXAMPLE_GPIO_DIAGNOSTIC int "Number of the GPIO input for diagnostic" range 0 39 default 4 diff --git a/examples/system/ota/native_ota_example/main/native_ota_example.c b/examples/system/ota/native_ota_example/main/native_ota_example.c index 854e77fac..4b5f15881 100644 --- a/examples/system/ota/native_ota_example/main/native_ota_example.c +++ b/examples/system/ota/native_ota_example/main/native_ota_example.c @@ -24,9 +24,9 @@ #include "nvs_flash.h" #include "driver/gpio.h" -#define EXAMPLE_WIFI_SSID CONFIG_WIFI_SSID -#define EXAMPLE_WIFI_PASS CONFIG_WIFI_PASSWORD -#define EXAMPLE_SERVER_URL CONFIG_FIRMWARE_UPG_URL +#define EXAMPLE_WIFI_SSID CONFIG_EXAMPLE_WIFI_SSID +#define EXAMPLE_WIFI_PASS CONFIG_EXAMPLE_WIFI_PASSWORD +#define EXAMPLE_SERVER_URL CONFIG_EXAMPLE_FIRMWARE_UPG_URL #define BUFFSIZE 1024 #define HASH_LEN 32 /* SHA-256 digest length */ @@ -266,7 +266,7 @@ static bool diagnostic(void) gpio_config_t io_conf; io_conf.intr_type = GPIO_PIN_INTR_DISABLE; io_conf.mode = GPIO_MODE_INPUT; - io_conf.pin_bit_mask = (1ULL << CONFIG_GPIO_DIAGNOSTIC); + io_conf.pin_bit_mask = (1ULL << CONFIG_EXAMPLE_GPIO_DIAGNOSTIC); io_conf.pull_down_en = GPIO_PULLDOWN_DISABLE; io_conf.pull_up_en = GPIO_PULLUP_ENABLE; gpio_config(&io_conf); @@ -274,9 +274,9 @@ static bool diagnostic(void) ESP_LOGI(TAG, "Diagnostics (5 sec)..."); vTaskDelay(5000 / portTICK_PERIOD_MS); - bool diagnostic_is_ok = gpio_get_level(CONFIG_GPIO_DIAGNOSTIC); + bool diagnostic_is_ok = gpio_get_level(CONFIG_EXAMPLE_GPIO_DIAGNOSTIC); - gpio_reset_pin(CONFIG_GPIO_DIAGNOSTIC); + gpio_reset_pin(CONFIG_EXAMPLE_GPIO_DIAGNOSTIC); return diagnostic_is_ok; } diff --git a/examples/system/ota/simple_ota_example/main/Kconfig.projbuild b/examples/system/ota/simple_ota_example/main/Kconfig.projbuild index f3f71e3a8..3bfb01794 100644 --- a/examples/system/ota/simple_ota_example/main/Kconfig.projbuild +++ b/examples/system/ota/simple_ota_example/main/Kconfig.projbuild @@ -1,18 +1,18 @@ menu "Example Configuration" - config WIFI_SSID + config EXAMPLE_WIFI_SSID string "WiFi SSID" default "myssid" help SSID (network name) for the example to connect to. - config WIFI_PASSWORD + config EXAMPLE_WIFI_PASSWORD string "WiFi Password" default "mypassword" help WiFi password (WPA or WPA2) for the example to use. - config FIRMWARE_UPGRADE_URL + config EXAMPLE_FIRMWARE_UPGRADE_URL string "firmware upgrade url endpoint" default "https://192.168.0.3:8070/hello-world.bin" help diff --git a/examples/system/ota/simple_ota_example/main/simple_ota_example.c b/examples/system/ota/simple_ota_example/main/simple_ota_example.c index e03c12496..026f86032 100644 --- a/examples/system/ota/simple_ota_example/main/simple_ota_example.c +++ b/examples/system/ota/simple_ota_example/main/simple_ota_example.c @@ -92,8 +92,8 @@ static void initialise_wifi(void) ESP_ERROR_CHECK( esp_wifi_set_storage(WIFI_STORAGE_RAM) ); wifi_config_t wifi_config = { .sta = { - .ssid = CONFIG_WIFI_SSID, - .password = CONFIG_WIFI_PASSWORD, + .ssid = CONFIG_EXAMPLE_WIFI_SSID, + .password = CONFIG_EXAMPLE_WIFI_PASSWORD, }, }; ESP_LOGI(TAG, "Setting WiFi configuration SSID %s", wifi_config.sta.ssid); @@ -114,7 +114,7 @@ void simple_ota_example_task(void * pvParameter) ESP_LOGI(TAG, "Connected to WiFi network! Attempting to connect to server..."); esp_http_client_config_t config = { - .url = CONFIG_FIRMWARE_UPGRADE_URL, + .url = CONFIG_EXAMPLE_FIRMWARE_UPGRADE_URL, .cert_pem = (char *)server_cert_pem_start, .event_handler = _http_event_handler, }; diff --git a/examples/wifi/espnow/main/Kconfig.projbuild b/examples/wifi/espnow/main/Kconfig.projbuild index 5f597e67b..62b75f803 100644 --- a/examples/wifi/espnow/main/Kconfig.projbuild +++ b/examples/wifi/espnow/main/Kconfig.projbuild @@ -1,14 +1,14 @@ menu "Example Configuration" - choice WIFI_MODE + choice ESPNOW_WIFI_MODE prompt "WiFi mode" - default STATION_MODE + default ESPNOW_WIFI_MODE_STATION help WiFi mode(station or softap). - config STATION_MODE + config ESPNOW_WIFI_MODE_STATION bool "Station" - config SOFTAP_MODE + config ESPNOW_WIFI_MODE_STATION_SOFTAP bool "Softap" endchoice @@ -52,7 +52,7 @@ menu "Example Configuration" help Length of ESPNOW data to be sent, unit: byte. - config ENABLE_LONG_RANGE + config ESPNOW_ENABLE_LONG_RANGE bool "Enable Long Range" default "n" help diff --git a/examples/wifi/espnow/main/espnow_example.h b/examples/wifi/espnow/main/espnow_example.h index c1881886c..2de4f4a00 100644 --- a/examples/wifi/espnow/main/espnow_example.h +++ b/examples/wifi/espnow/main/espnow_example.h @@ -11,7 +11,7 @@ #define ESPNOW_EXAMPLE_H /* ESPNOW can work in both station and softap mode. It is configured in menuconfig. */ -#if CONFIG_STATION_MODE +#if CONFIG_ESPNOW_WIFI_MODE_STATION #define ESPNOW_WIFI_MODE WIFI_MODE_STA #define ESPNOW_WIFI_IF ESP_IF_WIFI_STA #else diff --git a/examples/wifi/espnow/main/espnow_example_main.c b/examples/wifi/espnow/main/espnow_example_main.c index 9f2d9980d..4d76a5bea 100644 --- a/examples/wifi/espnow/main/espnow_example_main.c +++ b/examples/wifi/espnow/main/espnow_example_main.c @@ -56,7 +56,7 @@ static void example_wifi_init(void) */ ESP_ERROR_CHECK( esp_wifi_set_channel(CONFIG_ESPNOW_CHANNEL, 0) ); -#if CONFIG_ENABLE_LONG_RANGE +#if CONFIG_ESPNOW_ENABLE_LONG_RANGE ESP_ERROR_CHECK( esp_wifi_set_protocol(ESPNOW_WIFI_IF, WIFI_PROTOCOL_11B|WIFI_PROTOCOL_11G|WIFI_PROTOCOL_11N|WIFI_PROTOCOL_LR) ); #endif } diff --git a/examples/wifi/getting_started/softAP/main/Kconfig.projbuild b/examples/wifi/getting_started/softAP/main/Kconfig.projbuild index bc4c17f26..378290502 100644 --- a/examples/wifi/getting_started/softAP/main/Kconfig.projbuild +++ b/examples/wifi/getting_started/softAP/main/Kconfig.projbuild @@ -12,7 +12,7 @@ menu "Example Configuration" help WiFi password (WPA or WPA2) for the example to use. - config MAX_STA_CONN + config ESP_MAX_STA_CONN int "Maximal STA connections" default 4 help diff --git a/examples/wifi/getting_started/softAP/main/softap_example_main.c b/examples/wifi/getting_started/softAP/main/softap_example_main.c index 8402241f0..014c43963 100644 --- a/examples/wifi/getting_started/softAP/main/softap_example_main.c +++ b/examples/wifi/getting_started/softAP/main/softap_example_main.c @@ -26,7 +26,7 @@ */ #define EXAMPLE_ESP_WIFI_SSID CONFIG_ESP_WIFI_SSID #define EXAMPLE_ESP_WIFI_PASS CONFIG_ESP_WIFI_PASSWORD -#define EXAMPLE_MAX_STA_CONN CONFIG_MAX_STA_CONN +#define EXAMPLE_MAX_STA_CONN CONFIG_ESP_MAX_STA_CONN /* FreeRTOS event group to signal when we are connected*/ static EventGroupHandle_t s_wifi_event_group; diff --git a/examples/wifi/power_save/main/Kconfig.projbuild b/examples/wifi/power_save/main/Kconfig.projbuild index 24d928408..27ee75660 100644 --- a/examples/wifi/power_save/main/Kconfig.projbuild +++ b/examples/wifi/power_save/main/Kconfig.projbuild @@ -1,18 +1,18 @@ menu "Example Configuration" - config WIFI_SSID + config EXAMPLE_WIFI_SSID string "WiFi SSID" default "myssid" help SSID (network name) for the example to connect to. - config WIFI_PASSWORD + config EXAMPLE_WIFI_PASSWORD string "WiFi Password" default "mypassword" help WiFi password (WPA or WPA2) for the example to use. - config WIFI_LISTEN_INTERVAL + config EXAMPLE_WIFI_LISTEN_INTERVAL int "WiFi listen interval" default 3 help @@ -20,9 +20,9 @@ menu "Example Configuration" For example, if beacon interval is 100 ms and listen interval is 3, the interval for station to listen to beacon is 300 ms. - choice POWER_SAVE_MODE + choice EXAMPLE_POWER_SAVE_MODE prompt "power save mode" - default POWER_SAVE_MIN_MODEM + default EXAMPLE_POWER_SAVE_MIN_MODEM help Power save mode for the esp32 to use. Modem sleep mode includes minimum and maximum power save modes. In minimum power save mode, station wakes up every DTIM to receive beacon. Broadcast data will not be @@ -32,11 +32,11 @@ menu "Example Configuration" may be lost because station may be in sleep state at DTIM time. If listen interval is longer, more power is saved but broadcast data is more easy to lose. - config POWER_SAVE_NONE + config EXAMPLE_POWER_SAVE_NONE bool "none" - config POWER_SAVE_MIN_MODEM + config EXAMPLE_POWER_SAVE_MIN_MODEM bool "minimum modem" - config POWER_SAVE_MAX_MODEM + config EXAMPLE_POWER_SAVE_MAX_MODEM bool "maximum modem" endchoice diff --git a/examples/wifi/power_save/main/power_save.c b/examples/wifi/power_save/main/power_save.c index 417b4c9d8..04f60cb66 100644 --- a/examples/wifi/power_save/main/power_save.c +++ b/examples/wifi/power_save/main/power_save.c @@ -21,16 +21,16 @@ #include "nvs_flash.h" /*set the ssid and password via "make menuconfig"*/ -#define DEFAULT_SSID CONFIG_WIFI_SSID -#define DEFAULT_PWD CONFIG_WIFI_PASSWORD +#define DEFAULT_SSID CONFIG_EXAMPLE_WIFI_SSID +#define DEFAULT_PWD CONFIG_EXAMPLE_WIFI_PASSWORD -#define DEFAULT_LISTEN_INTERVAL CONFIG_WIFI_LISTEN_INTERVAL +#define DEFAULT_LISTEN_INTERVAL CONFIG_EXAMPLE_WIFI_LISTEN_INTERVAL -#if CONFIG_POWER_SAVE_MIN_MODEM +#if CONFIG_EXAMPLE_POWER_SAVE_MIN_MODEM #define DEFAULT_PS_MODE WIFI_PS_MIN_MODEM -#elif CONFIG_POWER_SAVE_MAX_MODEM +#elif CONFIG_EXAMPLE_POWER_SAVE_MAX_MODEM #define DEFAULT_PS_MODE WIFI_PS_MAX_MODEM -#elif CONFIG_POWER_SAVE_NONE +#elif CONFIG_EXAMPLE_POWER_SAVE_NONE #define DEFAULT_PS_MODE WIFI_PS_NONE #else #define DEFAULT_PS_MODE WIFI_PS_NONE diff --git a/examples/wifi/scan/main/Kconfig.projbuild b/examples/wifi/scan/main/Kconfig.projbuild index b3fc5d73b..95f738919 100644 --- a/examples/wifi/scan/main/Kconfig.projbuild +++ b/examples/wifi/scan/main/Kconfig.projbuild @@ -1,67 +1,67 @@ menu "Example Configuration" - config WIFI_SSID + config EXAMPLE_WIFI_SSID string "WiFi SSID" default "myssid" help SSID (network name) for the example to connect to. - config WIFI_PASSWORD + config EXAMPLE_WIFI_PASSWORD string "WiFi Password" default "mypassword" help WiFi password (WPA or WPA2) for the example to use. - choice SCAN_METHOD + choice EXAMPLE_SCAN_METHOD prompt "scan method" - default WIFI_FAST_SCAN + default EXAMPLE_WIFI_FAST_SCAN help scan method for the esp32 to use - config WIFI_FAST_SCAN + config EXAMPLE_WIFI_FAST_SCAN bool "fast" - config WIFI_ALL_CHANNEL_SCAN + config EXAMPLE_WIFI_ALL_CHANNEL_SCAN bool "all" endchoice - choice SORT_METHOD + choice EXAMPLE_SORT_METHOD prompt "sort method" - default WIFI_CONNECT_AP_BY_SIGNAL + default EXAMPLE_WIFI_CONNECT_AP_BY_SIGNAL help sort method for the esp32 to use - config WIFI_CONNECT_AP_BY_SIGNAL + config EXAMPLE_WIFI_CONNECT_AP_BY_SIGNAL bool "rssi" - config WIFI_CONNECT_AP_BY_SECURITY + config EXAMPLE_WIFI_CONNECT_AP_BY_SECURITY bool "authmode" endchoice - config FAST_SCAN_THRESHOLD + config EXAMPLE_FAST_SCAN_THRESHOLD bool "fast scan threshold" default y help wifi fast scan threshold - config FAST_SCAN_MINIMUM_SIGNAL + config EXAMPLE_FAST_SCAN_MINIMUM_SIGNAL int "fast scan minimum rssi" - depends on FAST_SCAN_THRESHOLD + depends on EXAMPLE_FAST_SCAN_THRESHOLD range -127 0 default -127 help rssi is use to measure the signal - choice FAST_SCAN_WEAKEST_AUTHMODE + choice EXAMPLE_FAST_SCAN_WEAKEST_AUTHMODE prompt "fast scan weakest authmode" - depends on FAST_SCAN_THRESHOLD - default EXAMPLE_OPEN + depends on EXAMPLE_FAST_SCAN_THRESHOLD + default EXAMPLE_FAST_SCAN_WEAKEST_AUTHMODE_OPEN - config EXAMPLE_OPEN + config EXAMPLE_FAST_SCAN_WEAKEST_AUTHMODE_OPEN bool "open" - config EXAMPLE_WEP + config EXAMPLE_FAST_SCAN_WEAKEST_AUTHMODE_WEP bool "wep" - config EXAMPLE_WPA + config EXAMPLE_FAST_SCAN_WEAKEST_AUTHMODE_WPA bool "wpa" - config EXAMPLE_WPA2 + config EXAMPLE_FAST_SCAN_WEAKEST_AUTHMODE_WPA2 bool "wpa2" endchoice diff --git a/examples/wifi/scan/main/scan.c b/examples/wifi/scan/main/scan.c index 15235b20c..9607d6114 100644 --- a/examples/wifi/scan/main/scan.c +++ b/examples/wifi/scan/main/scan.c @@ -29,34 +29,34 @@ #include "nvs_flash.h" /*Set the SSID and Password via "make menuconfig"*/ -#define DEFAULT_SSID CONFIG_WIFI_SSID -#define DEFAULT_PWD CONFIG_WIFI_PASSWORD +#define DEFAULT_SSID CONFIG_EXAMPLE_WIFI_SSID +#define DEFAULT_PWD CONFIG_EXAMPLE_WIFI_PASSWORD -#if CONFIG_WIFI_ALL_CHANNEL_SCAN +#if CONFIG_EXAMPLE_WIFI_ALL_CHANNEL_SCAN #define DEFAULT_SCAN_METHOD WIFI_ALL_CHANNEL_SCAN -#elif CONFIG_WIFI_FAST_SCAN +#elif CONFIG_EXAMPLE_WIFI_FAST_SCAN #define DEFAULT_SCAN_METHOD WIFI_FAST_SCAN #else #define DEFAULT_SCAN_METHOD WIFI_FAST_SCAN -#endif /*CONFIG_SCAN_METHOD*/ +#endif /*CONFIG_EXAMPLE_SCAN_METHOD*/ -#if CONFIG_WIFI_CONNECT_AP_BY_SIGNAL +#if CONFIG_EXAMPLE_WIFI_CONNECT_AP_BY_SIGNAL #define DEFAULT_SORT_METHOD WIFI_CONNECT_AP_BY_SIGNAL -#elif CONFIG_WIFI_CONNECT_AP_BY_SECURITY +#elif CONFIG_EXAMPLE_WIFI_CONNECT_AP_BY_SECURITY #define DEFAULT_SORT_METHOD WIFI_CONNECT_AP_BY_SECURITY #else #define DEFAULT_SORT_METHOD WIFI_CONNECT_AP_BY_SIGNAL -#endif /*CONFIG_SORT_METHOD*/ +#endif /*CONFIG_EXAMPLE_SORT_METHOD*/ -#if CONFIG_FAST_SCAN_THRESHOLD -#define DEFAULT_RSSI CONFIG_FAST_SCAN_MINIMUM_SIGNAL -#if CONFIG_EXAMPLE_OPEN +#if CONFIG_EXAMPLE_FAST_SCAN_THRESHOLD +#define DEFAULT_RSSI CONFIG_EXAMPLE_FAST_SCAN_MINIMUM_SIGNAL +#if CONFIG_EXAMPLE_FAST_SCAN_WEAKEST_AUTHMODE_OPEN #define DEFAULT_AUTHMODE WIFI_AUTH_OPEN -#elif CONFIG_EXAMPLE_WEP +#elif CONFIG_EXAMPLE_FAST_SCAN_WEAKEST_AUTHMODE_WEP #define DEFAULT_AUTHMODE WIFI_AUTH_WEP -#elif CONFIG_EXAMPLE_WPA +#elif CONFIG_EXAMPLE_FAST_SCAN_WEAKEST_AUTHMODE_WPA #define DEFAULT_AUTHMODE WIFI_AUTH_WPA_PSK -#elif CONFIG_EXAMPLE_WPA2 +#elif CONFIG_EXAMPLE_FAST_SCAN_WEAKEST_AUTHMODE_WPA2 #define DEFAULT_AUTHMODE WIFI_AUTH_WPA2_PSK #else #define DEFAULT_AUTHMODE WIFI_AUTH_OPEN @@ -64,7 +64,7 @@ #else #define DEFAULT_RSSI -127 #define DEFAULT_AUTHMODE WIFI_AUTH_OPEN -#endif /*CONFIG_FAST_SCAN_THRESHOLD*/ +#endif /*CONFIG_EXAMPLE_FAST_SCAN_THRESHOLD*/ static const char *TAG = "scan"; diff --git a/examples/wifi/simple_sniffer/main/Kconfig.projbuild b/examples/wifi/simple_sniffer/main/Kconfig.projbuild index 096af2c66..c85abc650 100644 --- a/examples/wifi/simple_sniffer/main/Kconfig.projbuild +++ b/examples/wifi/simple_sniffer/main/Kconfig.projbuild @@ -1,6 +1,6 @@ menu "Example Configuration" - config STORE_HISTORY + config SNIFFER_STORE_HISTORY bool "Store command history into flash" default y help @@ -30,7 +30,7 @@ menu "Example Configuration" help Specify the mount point in the VFS (Virtual File System) for SD card. - config PCAP_FILE_NAME_MAX_LEN + config SNIFFER_PCAP_FILE_NAME_MAX_LEN int "Max name length of pcap file" default 32 help diff --git a/examples/wifi/simple_sniffer/main/cmd_sniffer.c b/examples/wifi/simple_sniffer/main/cmd_sniffer.c index a756eba43..e41f9941f 100644 --- a/examples/wifi/simple_sniffer/main/cmd_sniffer.c +++ b/examples/wifi/simple_sniffer/main/cmd_sniffer.c @@ -22,7 +22,7 @@ #include "sdkconfig.h" #define SNIFFER_DEFAULT_FILE_NAME "esp-sniffer" -#define SNIFFER_FILE_NAME_MAX_LEN CONFIG_PCAP_FILE_NAME_MAX_LEN +#define SNIFFER_FILE_NAME_MAX_LEN CONFIG_SNIFFER_PCAP_FILE_NAME_MAX_LEN #define SNIFFER_DEFAULT_CHANNEL (1) #define SNIFFER_PAYLOAD_FCS_LEN (4) #define SNIFFER_PROCESS_PACKET_TIMEOUT_MS (100) diff --git a/examples/wifi/simple_sniffer/main/simple_sniffer_example_main.c b/examples/wifi/simple_sniffer/main/simple_sniffer_example_main.c index 013ed6d10..1b664b039 100644 --- a/examples/wifi/simple_sniffer/main/simple_sniffer_example_main.c +++ b/examples/wifi/simple_sniffer/main/simple_sniffer_example_main.c @@ -27,14 +27,14 @@ #include "cmd_decl.h" #include "sdkconfig.h" -#if CONFIG_STORE_HISTORY +#if CONFIG_SNIFFER_STORE_HISTORY #define HISTORY_MOUNT_POINT "/data" #define HISTORY_FILE_PATH HISTORY_MOUNT_POINT "/history.txt" #endif static const char *TAG = "example"; -#if CONFIG_STORE_HISTORY +#if CONFIG_SNIFFER_STORE_HISTORY /* Initialize filesystem for command history store */ static void initialize_filesystem() { @@ -113,7 +113,7 @@ static void initialize_console() /* Set command history size */ linenoiseHistorySetMaxLen(100); -#if CONFIG_STORE_HISTORY +#if CONFIG_SNIFFER_STORE_HISTORY /* Load command history from filesystem */ linenoiseHistoryLoad(HISTORY_FILE_PATH); #endif @@ -223,7 +223,7 @@ void app_main(void) { initialize_nvs(); -#if CONFIG_STORE_HISTORY +#if CONFIG_SNIFFER_STORE_HISTORY initialize_filesystem(); #endif @@ -286,7 +286,7 @@ void app_main(void) /* Add the command to the history */ linenoiseHistoryAdd(line); -#if CONFIG_STORE_HISTORY +#if CONFIG_SNIFFER_STORE_HISTORY /* Save command history to filesystem */ linenoiseHistorySave(HISTORY_FILE_PATH); #endif diff --git a/examples/wifi/wpa2_enterprise/main/Kconfig.projbuild b/examples/wifi/wpa2_enterprise/main/Kconfig.projbuild index 7cf61fbcc..68f650473 100644 --- a/examples/wifi/wpa2_enterprise/main/Kconfig.projbuild +++ b/examples/wifi/wpa2_enterprise/main/Kconfig.projbuild @@ -1,34 +1,34 @@ menu "Example Configuration" - config WIFI_SSID + config EXAMPLE_WIFI_SSID string "WiFi SSID" default "wpa2_test" help SSID (network name) for the example to connect to. - config EAP_METHOD + config EXAMPLE_EAP_METHOD int "EAP METHOD" default 1 help EAP method (TLS, PEAP or TTLS) for the example to use. TLS: 0, PEAP: 1, TTLS: 2 - config EAP_ID + config EXAMPLE_EAP_ID string "EAP ID" default "example@espressif.com" help Identity in phase 1 of EAP procedure. - config EAP_USERNAME + config EXAMPLE_EAP_USERNAME string "EAP USERNAME" default "espressif" help Username for EAP method (PEAP and TTLS). - config EAP_PASSWORD + config EXAMPLE_EAP_PASSWORD string "EAP PASSWORD" default "test11" help Password for EAP method (PEAP and TTLS). -endmenu \ No newline at end of file +endmenu diff --git a/examples/wifi/wpa2_enterprise/main/wpa2_enterprise_main.c b/examples/wifi/wpa2_enterprise/main/wpa2_enterprise_main.c index 64e8b40de..1917c1eb5 100644 --- a/examples/wifi/wpa2_enterprise/main/wpa2_enterprise_main.c +++ b/examples/wifi/wpa2_enterprise/main/wpa2_enterprise_main.c @@ -38,12 +38,12 @@ You can choose EAP method via 'make menuconfig' according to the configuration of AP. */ -#define EXAMPLE_WIFI_SSID CONFIG_WIFI_SSID -#define EXAMPLE_EAP_METHOD CONFIG_EAP_METHOD +#define EXAMPLE_WIFI_SSID CONFIG_EXAMPLE_WIFI_SSID +#define EXAMPLE_EAP_METHOD CONFIG_EXAMPLE_EAP_METHOD -#define EXAMPLE_EAP_ID CONFIG_EAP_ID -#define EXAMPLE_EAP_USERNAME CONFIG_EAP_USERNAME -#define EXAMPLE_EAP_PASSWORD CONFIG_EAP_PASSWORD +#define EXAMPLE_EAP_ID CONFIG_EXAMPLE_EAP_ID +#define EXAMPLE_EAP_USERNAME CONFIG_EXAMPLE_EAP_USERNAME +#define EXAMPLE_EAP_PASSWORD CONFIG_EXAMPLE_EAP_PASSWORD /* FreeRTOS event group to signal when we are connected & ready to make a request */ static EventGroupHandle_t wifi_event_group;