From 66f9ed9badc1134710086764b7ad1e91764dbf5a Mon Sep 17 00:00:00 2001 From: Joachim Date: Wed, 25 Mar 2020 22:49:32 +0100 Subject: [PATCH] testing and benchmarking functions of opencv - Benchmark measurement tool added - Tested a bunch of function - TODO: See why some function don't give stack memory back! --- .../esp_opencv_tests/main/CMakeLists.txt | 11 +- .../esp_opencv_tests/main/hello_opencv.cpp | 157 ------------ esp32/examples/esp_opencv_tests/main/main.cpp | 230 ++++++++++++++++++ .../esp_opencv_tests/main/measure.hpp | 102 ++++++++ .../examples/esp_opencv_tests/main/system.cpp | 58 +++++ .../examples/esp_opencv_tests/main/system.hpp | 20 ++ .../examples/esp_opencv_tests/partitions.csv | 2 +- esp32/examples/esp_opencv_tests/sdkconfig | 20 +- esp32/examples/esp_opencv_tests/sdkconfig.old | 171 ++++++++++++- 9 files changed, 584 insertions(+), 187 deletions(-) delete mode 100644 esp32/examples/esp_opencv_tests/main/hello_opencv.cpp create mode 100644 esp32/examples/esp_opencv_tests/main/main.cpp create mode 100644 esp32/examples/esp_opencv_tests/main/measure.hpp create mode 100644 esp32/examples/esp_opencv_tests/main/system.cpp create mode 100644 esp32/examples/esp_opencv_tests/main/system.hpp diff --git a/esp32/examples/esp_opencv_tests/main/CMakeLists.txt b/esp32/examples/esp_opencv_tests/main/CMakeLists.txt index a85ff8b..4453a79 100644 --- a/esp32/examples/esp_opencv_tests/main/CMakeLists.txt +++ b/esp32/examples/esp_opencv_tests/main/CMakeLists.txt @@ -1,5 +1,12 @@ -set(COMPONENT_SRCS "hello_opencv.cpp") -set(COMPONENT_ADD_INCLUDEDIRS "." "./opencv/") +set(COMPONENT_SRCS + main.cpp + system.cpp +) + +set(COMPONENT_ADD_INCLUDEDIRS + . + ./opencv/ +) register_component() # Be aware that the order of the librairies is important diff --git a/esp32/examples/esp_opencv_tests/main/hello_opencv.cpp b/esp32/examples/esp_opencv_tests/main/hello_opencv.cpp deleted file mode 100644 index 9ff865b..0000000 --- a/esp32/examples/esp_opencv_tests/main/hello_opencv.cpp +++ /dev/null @@ -1,157 +0,0 @@ -#include "opencv2/core.hpp" -#include "opencv2/imgproc.hpp" -#include "opencv2/imgcodecs.hpp" - -#include -#include -#include "sdkconfig.h" -#include -#include -#include -#include -#include - -using namespace cv; -using namespace std; - - -static char tag[]="opencv_tests"; - -extern "C" { -void app_main(void); -} - - -esp_err_t init_spiffs() { - ESP_LOGI("spiffs_init", "Initializing SPIFFS"); - - esp_vfs_spiffs_conf_t conf = { - .base_path = "/spiffs", - .partition_label = NULL, - .max_files = 10, - .format_if_mount_failed = false - }; - - // Use settings defined above to initialize and mount SPIFFS filesystem. - // Note: esp_vfs_spiffs_register is an all-in-one convenience function. - esp_err_t ret = esp_vfs_spiffs_register(&conf); - - if (ret != ESP_OK) { - if (ret == ESP_FAIL) { - ESP_LOGE("spiffs_init", "Failed to mount or format filesystem"); - } else if (ret == ESP_ERR_NOT_FOUND) { - ESP_LOGE("spiffs_init", "Failed to find SPIFFS partition"); - } else { - ESP_LOGE("spiffs_init", "Failed to initialize SPIFFS (%s)", esp_err_to_name(ret)); - } - return ret; - } - - size_t total = 0, used = 0; - ret = esp_spiffs_info(NULL, &total, &used); - if (ret != ESP_OK) { - ESP_LOGE("spiffs_init", "Failed to get SPIFFS partition information (%s)", esp_err_to_name(ret)); - } else { - ESP_LOGI("spiffs_init", "Partition size: total: %d, used: %d", total, used); - } - return ESP_OK; -} - - -void test_basics() -{ - -} - -void test_spiffs() -{ - -} - - -void app_main(void) -{ - ESP_LOGI(tag, "Starting main"); - - /* SPIFFS init */ - init_spiffs(); - - /* Matrices initialization tests */ - Mat M1(2,2, CV_8UC3, Scalar(0,0,255)); - cout << "M1 = " << endl << " " << M1 << endl << endl; - - Mat M2(2,2, CV_8UC3, Scalar(0,0,111)); - cout << "M2 = " << endl << " " << M2 << endl << endl; - - Mat eye = Mat::eye(10, 10, CV_32F) * 0.1; - cout << "eye = " << endl << " " << eye << endl << endl; - - Mat ones = Mat::ones(15, 4, CV_8U)*3; - cout << "ones = " << endl << " " << ones << endl << endl; - - vector v; - v.push_back((float)CV_PI); - v.push_back(2); - v.push_back(3.01f); - cout << "floats vector = " << endl << " " << Mat(v) << endl << endl; - - /* Matrices imgproc operations tests */ - uint8_t data[15] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15}; - Mat M3 = Mat(3, 5, CV_8UC1, data); - cout << "Gray matrix = " << endl << " " << M3 << endl << endl; - - Mat M4; - threshold(M3, M4, 7, 255, THRESH_BINARY); - cout << "Thresholded matrix = " << endl << " " << M4 << endl << endl; - - Mat M5; - resize(M3, M5, Size(), 0.75, 0.75); - cout << "Resized matrix = " << endl << " " << M5 << endl << endl; - - /* SPIFFS file reading test */ - FILE* f = fopen("/spiffs/hello.txt", "r"); - if (f == NULL) { - ESP_LOGE(tag, "Failed to open file for reading"); - return; - } - char line[64]; - fgets(line, sizeof(line), f); - fclose(f); - - ESP_LOGI(tag, "Read from file: '%s'", line); - - /* Images reading/writing tests */ - struct stat st; - if (stat("/spiffs/jack.png", &st) == 0) { - ESP_LOGI(tag, "jack exists!"); - } - - Mat src, src_gray, src_bin; - string imageName = "/spiffs/jack.png"; - src = imread(imageName, IMREAD_COLOR); - if(src.empty()) { - ESP_LOGW(tag, "cannot read the image: %s", imageName.c_str()); - return; - } - cvtColor(src, src_gray, COLOR_BGR2GRAY); - threshold(src_gray, src_bin, 128, 255, THRESH_BINARY); - imwrite("/spiffs/jack_bin.png", src_bin); - ESP_LOGI(tag, "Binary image written!"); - - /* some more complex image operations test */ - Mat detected_edges; - - // Reduce noise with a kernel 3x3 - blur(src_gray, detected_edges, Size(3,3)); - - /** Apply the canny edges detector with: - * - low threshold = 5 - * - high threshold = 3x low - * - sobel kernel size = 3x3 - */ - int lowThresh = 8; - int kernSize = 3; - Canny(detected_edges, detected_edges, lowThresh, 3*lowThresh, kernSize); - imwrite("/spiffs/jack_canny.png", detected_edges); - ESP_LOGI(tag, "Canny image written!"); -} \ No newline at end of file diff --git a/esp32/examples/esp_opencv_tests/main/main.cpp b/esp32/examples/esp_opencv_tests/main/main.cpp new file mode 100644 index 0000000..90993fe --- /dev/null +++ b/esp32/examples/esp_opencv_tests/main/main.cpp @@ -0,0 +1,230 @@ +#include "opencv2/core.hpp" +#include "opencv2/imgproc.hpp" +#include "opencv2/imgcodecs.hpp" + +#include +#include +#include +#include + +#include +#include +#include +#include + + + +#include "system.hpp" +#include "measure.hpp" + +using namespace cv; +using namespace std; + + +char* TAG="opencv_tests"; +const String imageFileName = "/spiffs/jack.png"; +const int REPEAT = 3; // number of times to repeat the function call for the average + +extern "C" { +void app_main(void); +} + + +/** + * Function that tests the basics of OpenCV: + * - Matrices creation + * - Arithmetic operations + * - + */ +void test_basics() +{ + ESP_LOGI(TAG, "Doing basic matrices test"); + + /* Matrices initialization tests */ + Mat M1(2,2, CV_8UC3, Scalar(0,0,255)); + cout << "M1 = " << endl << " " << M1 << endl << endl; + + Mat M2(2,2, CV_8UC3, Scalar(0,0,111)); + cout << "M2 = " << endl << " " << M2 << endl << endl; + + Mat eye = Mat::eye(10, 10, CV_32F) * 0.1; + cout << "eye = " << endl << " " << eye << endl << endl; + + Mat ones = Mat::ones(15, 4, CV_8U)*3; + cout << "ones = " << endl << " " << ones << endl << endl; + + vector v; + v.push_back((float)CV_PI); + v.push_back(2); + v.push_back(3.01f); + cout << "floats vector = " << endl << " " << Mat(v) << endl << endl; + + uint8_t data[15] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15}; + Mat M3 = Mat(3, 5, CV_8UC1, data); + cout << "Gray matrix = " << endl << " " << M3 << endl << endl; +} + +/** + * Function that reads and write on the SPI Flash File System + */ +void test_spiffs() +{ + ESP_LOGI(TAG, "Doing SPIFFS read/write tests"); + + /* SPIFFS file reading test */ + FILE* f = fopen("/spiffs/hello.txt", "r"); + if (f == NULL) { + ESP_LOGE(TAG, "Failed to open file for reading"); + return; + } + char line[64]; + fgets(line, sizeof(line), f); + fclose(f); + + printf("Read from file: '%s'", line); + + /* Images reading/writing tests */ + Mat src; + src = imread(imageFileName, IMREAD_COLOR); + if(src.empty()) { + ESP_LOGW(TAG, "cannot read the image: %s", imageFileName.c_str()); + return; + } + + imwrite("/spiffs/dst.png", src); + ESP_LOGI(TAG, "Image written!"); +} + +void test_thresholds(const Mat &src) +{ + ESP_LOGI(TAG, "==================== Thresholding tests ===================="); + + Mat gray, dst; + + // convert to grayscale + cvtColor(src, gray, COLOR_BGR2GRAY); + + // apply thresholds + BENCHMARK_MS("Binary threshold", REPEAT, threshold, gray, dst, 128, 255, THRESH_BINARY); + BENCHMARK_MS("Triangle threshold", REPEAT, threshold, gray, dst, 0, 255, THRESH_BINARY | THRESH_TRIANGLE); + BENCHMARK_MS("OTSU threshold", REPEAT, threshold, gray, dst, 0, 255, THRESH_BINARY | THRESH_OTSU); + BENCHMARK_MS("To zero threshold", REPEAT, threshold, gray, dst, 128, 255, THRESH_TOZERO); +} + +void test_blurring(const Mat &src) +{ + ESP_LOGI(TAG, "==================== Blurring tests ===================="); + + Mat dst; + + // apply blurs + BENCHMARK_MS("GaussianBlur", REPEAT, GaussianBlur, src, dst, Size(9, 9), 0, 0, BORDER_DEFAULT); + BENCHMARK_MS("medianBlur", REPEAT, medianBlur, src, dst, 9); + BENCHMARK_MS("bilateralFilter", REPEAT, bilateralFilter, src, dst, 9, 18, 5, BORDER_DEFAULT); +} + +void test_morphology_transform(const Mat &src) +{ + ESP_LOGI(TAG, "=========== Morphology transformations tests ==========="); + + Mat dst; + + // create a kernel for the transformation + Mat element = getStructuringElement(MORPH_RECT, Size(9, 9), Point(4, 4)); + + // apply transformations + BENCHMARK_MS("erode", REPEAT, erode, src, dst, element, Point(-1,-1), 1, BORDER_CONSTANT, morphologyDefaultBorderValue()); + BENCHMARK_MS("dilate", REPEAT, dilate, src, dst, element, Point(-1,-1), 1, BORDER_CONSTANT, morphologyDefaultBorderValue()); + BENCHMARK_MS("open", REPEAT, morphologyEx, src, dst, MORPH_OPEN, element, Point(-1,-1), 1, BORDER_CONSTANT, morphologyDefaultBorderValue()); +} + +void test_resize(const Mat &src) +{ + ESP_LOGI(TAG, "==================== Resizing tests ===================="); + + Mat dst; + + BENCHMARK_MS("linear resize", REPEAT, resize, src, dst, Size(), 0.75, 0.75, INTER_LINEAR); + BENCHMARK_MS("cubic resize", REPEAT, resize, src, dst, Size(), 0.75, 0.75, INTER_CUBIC); + BENCHMARK_MS("pyrUp", REPEAT, pyrUp, src, dst, Size(), BORDER_DEFAULT); + BENCHMARK_MS("pyrDown", REPEAT, pyrDown, src, dst, Size(), BORDER_DEFAULT); +} + +void test_edge_detect(const Mat &src) +{ + ESP_LOGI(TAG, "================= Edge detection tests ================="); + + Mat dst, gray; + + // convert to grayscale + cvtColor(src, gray, COLOR_BGR2GRAY); + + BENCHMARK_MS("Sobel", REPEAT, Sobel, gray, dst, 2, 2, 1, 3, 1, 0, BORDER_DEFAULT); + //BENCHMARK_MS("Canny", REPEAT, Canny, gray, dst, 8, 24, 3, false); // FIXME: can't deduce template parameter 'F' + auto start = chrono::system_clock::now(); + Canny(gray, dst, 8, 24, 3, false); + auto duration = chrono::duration_cast(chrono::system_clock::now() - start); + std::cout << "Time taken by " << "Canny" << ": " << duration.count() << " [" << "ms" << "]" << std::endl; +} + +void test_hough(const Mat &src) +{ + ESP_LOGI(TAG, "================= Hough transform tests ================="); + + Mat dst, gray; + + // convert to grayscale + cvtColor(src, gray, COLOR_BGR2GRAY); + + +} + +void app_main(void) +{ + ESP_LOGI(TAG, "Starting main"); + disp_mem_infos(); + + /* SPIFFS init */ + init_spiffs(); + + /* Basics Matrices tests */ + test_basics(); + + /* Test the spiffs read/write */ + test_spiffs(); + disp_mem_infos(); + + /* Read an image for the next tests */ + Mat src = imread(imageFileName, IMREAD_COLOR); + if(src.empty()) { + ESP_LOGW(TAG, "cannot read the image: %s", imageFileName.c_str()); + return; + } + ESP_LOGI(TAG, "Image read of %dx%dx%d, with %d pixel depth", src.rows, src.cols, src.channels(), src.depth()); + + /* Conversions and thresholds tests */ + //test_thresholds(src); + disp_mem_infos(); + + /* Blurring tests */ + test_blurring(src); + disp_mem_infos(); + + /* Morphology transformations */ + test_morphology_transform(src); + disp_mem_infos(); + + /* Image resizing */ + test_resize(src); + disp_mem_infos(); + + /* Edge detection */ + test_edge_detect(src); + disp_mem_infos(); + + /* Hough transform */ + test_hough(src); + disp_mem_infos(); + + ESP_LOGI(TAG, "End of main"); +} \ No newline at end of file diff --git a/esp32/examples/esp_opencv_tests/main/measure.hpp b/esp32/examples/esp_opencv_tests/main/measure.hpp new file mode 100644 index 0000000..b83d2d5 --- /dev/null +++ b/esp32/examples/esp_opencv_tests/main/measure.hpp @@ -0,0 +1,102 @@ +// +// Helper to measure time taken by functions +// +// Code taken from https://github.com/picanumber/bureaucrat/blob/master/time_lapse.h +// + +#ifndef MEASURE_HPP +#define MEASURE_HPP + +#include +#include +#include + +/* + * @brief Macro to simplify the benchmark() function usage. + * - more concise + * - already fill the unit type + * + * @param name (String) representing the name of the function (for the log) + * @param repeat (Int) number of times to call the function for the time average + * @param fct (F type) function to call + * @param ... (Args type) arguments of the function to call + * + * Usage examples: + * - without macro: + * measure::benchmark("ms", "medianBlur", repeat, medianBlur, src, dst, 9); + * - with macro: + * BENCHMARK_MS("medianBlur", repeat, medianBlur, src, dst, 9); + */ +#define BENCHMARK_NS(name, repeat, fct, ...) measure::benchmark("ns", name, repeat, fct, __VA_ARGS__) +#define BENCHMARK_US(name, repeat, fct, ...) measure::benchmark("us", name, repeat, fct, __VA_ARGS__) +#define BENCHMARK_MS(name, repeat, fct, ...) measure::benchmark("ms", name, repeat, fct, __VA_ARGS__) +#define BENCHMARK_S(name, repeat, fct, ...) measure::benchmark("s", name, repeat, fct, __VA_ARGS__) + +#define fw(what) std::forward(what) + +/** + * @ class measure + * @ brief Class to measure the execution time of a callable + */ +template < + typename TimeT = std::chrono::milliseconds, class ClockT = std::chrono::system_clock +> +struct measure +{ + /** + * @ fn execution + * @ brief Returns the quantity (count) of the elapsed time as TimeT units + */ + template + static typename TimeT::rep execution(F&& func, Args&&... args) + { + auto start = ClockT::now(); + + fw(func)(std::forward(args)...); + + auto duration = std::chrono::duration_cast(ClockT::now() - start); + + return duration.count(); + } + + /** + * Function that executes the function 'repeat' times, measure the average time taken and logs on the console + * the time. + * @tparam F + * @tparam Args + * @param unit String representing the time unit (for the log). Can be either 's', 'ms', 'us' or 'ns' + * @param repeat Number of times to do the measure + * @param func Function to benchmark + * @param args Arguments of the function 'func' + */ + template + static void benchmark(const std::string &unit, const std::string &name, int repeat, F&& func, Args&&... args) + { + auto avg = duration(func, (args)...); + + for(int i = 0; i < repeat-1; i++) { + avg += duration(func, (args)...); + } + + std::cout << "Time taken by " << name << ": " << (avg / repeat).count() << " [" << unit << "]" << std::endl; + } + + /** + * @ fn duration + * @ brief Returns the duration (in chrono's type system) of the elapsed time + */ + template + static TimeT duration(F&& func, Args&&... args) + { + auto start = ClockT::now(); + + fw(func)(std::forward(args)...); + + return std::chrono::duration_cast(ClockT::now() - start); + } +}; + +#undef fw + + +#endif // MEASURE_HPP diff --git a/esp32/examples/esp_opencv_tests/main/system.cpp b/esp32/examples/esp_opencv_tests/main/system.cpp new file mode 100644 index 0000000..926b6e5 --- /dev/null +++ b/esp32/examples/esp_opencv_tests/main/system.cpp @@ -0,0 +1,58 @@ +#include +#include +#include +#include + +#include "system.hpp" + + +#define TAG "SYSTEM" + + +esp_err_t init_spiffs() { + ESP_LOGI("spiffs_init", "Initializing SPIFFS"); + + esp_vfs_spiffs_conf_t conf = { + .base_path = "/spiffs", + .partition_label = NULL, + .max_files = 10, + .format_if_mount_failed = false + }; + + // Use settings defined above to initialize and mount SPIFFS filesystem. + // Note: esp_vfs_spiffs_register is an all-in-one convenience function. + esp_err_t ret = esp_vfs_spiffs_register(&conf); + + if (ret != ESP_OK) { + if (ret == ESP_FAIL) { + ESP_LOGE("spiffs_init", "Failed to mount or format filesystem"); + } else if (ret == ESP_ERR_NOT_FOUND) { + ESP_LOGE("spiffs_init", "Failed to find SPIFFS partition"); + } else { + ESP_LOGE("spiffs_init", "Failed to initialize SPIFFS (%s)", esp_err_to_name(ret)); + } + return ret; + } + + size_t total = 0, used = 0; + ret = esp_spiffs_info(NULL, &total, &used); + if (ret != ESP_OK) { + ESP_LOGE("spiffs_init", "Failed to get SPIFFS partition information (%s)", esp_err_to_name(ret)); + } else { + ESP_LOGI("spiffs_init", "Partition size: total: %d, used: %d", total, used); + } + return ESP_OK; +} + +void wait_msec(uint16_t v) { + vTaskDelay(v / portTICK_PERIOD_MS); +} + +void wait_sec(uint16_t v) { + vTaskDelay(v * 1000 / portTICK_PERIOD_MS); +} + +void disp_mem_infos() { + ESP_LOGI(TAG, "task stack left: %d Bytes", uxTaskGetStackHighWaterMark(NULL)); + ESP_LOGI(TAG, "heap left: %d Bytes", esp_get_free_heap_size()); +} \ No newline at end of file diff --git a/esp32/examples/esp_opencv_tests/main/system.hpp b/esp32/examples/esp_opencv_tests/main/system.hpp new file mode 100644 index 0000000..95f0d15 --- /dev/null +++ b/esp32/examples/esp_opencv_tests/main/system.hpp @@ -0,0 +1,20 @@ +// +// Created by joachim on 24.03.20. +// + +#ifndef SYSTEM_HPP +#define SYSTEM_HPP + +// Initialize the SPIFFS +esp_err_t init_spiffs(); + +// Display cpu and memory info +void disp_mem_infos(); + +// Holds the task for a given amount of msec +void wait_msec(uint16_t v); + +// Holds the task for a full second +void wait_sec(uint16_t v); + +#endif //SYSTEM_HPP diff --git a/esp32/examples/esp_opencv_tests/partitions.csv b/esp32/examples/esp_opencv_tests/partitions.csv index 3efcc09..91b461a 100644 --- a/esp32/examples/esp_opencv_tests/partitions.csv +++ b/esp32/examples/esp_opencv_tests/partitions.csv @@ -3,4 +3,4 @@ nvs, data, nvs, 0x9000, 0x6000, phy_init, data, phy, 0xf000, 0x1000, factory, app, factory, 0x10000, 2M, -storage, data, spiffs, , 600K, \ No newline at end of file +storage, data, spiffs, , 1M, \ No newline at end of file diff --git a/esp32/examples/esp_opencv_tests/sdkconfig b/esp32/examples/esp_opencv_tests/sdkconfig index 57f0579..1a03844 100644 --- a/esp32/examples/esp_opencv_tests/sdkconfig +++ b/esp32/examples/esp_opencv_tests/sdkconfig @@ -298,8 +298,8 @@ CONFIG_ESP32_UNIVERSAL_MAC_ADDRESSES_FOUR=y CONFIG_ESP32_UNIVERSAL_MAC_ADDRESSES=4 # CONFIG_ESP32_ULP_COPROC_ENABLED is not set CONFIG_ESP32_ULP_COPROC_RESERVE_MEM=0 -# CONFIG_ESP32_PANIC_PRINT_HALT is not set -CONFIG_ESP32_PANIC_PRINT_REBOOT=y +CONFIG_ESP32_PANIC_PRINT_HALT=y +# CONFIG_ESP32_PANIC_PRINT_REBOOT is not set # CONFIG_ESP32_PANIC_SILENT_REBOOT is not set # CONFIG_ESP32_PANIC_GDBSTUB is not set CONFIG_ESP32_DEBUG_OCDAWARE=y @@ -355,7 +355,7 @@ CONFIG_ADC_CAL_LUT_ENABLE=y CONFIG_ESP_ERR_TO_NAME_LOOKUP=y CONFIG_ESP_SYSTEM_EVENT_QUEUE_SIZE=32 CONFIG_ESP_SYSTEM_EVENT_TASK_STACK_SIZE=2304 -CONFIG_ESP_MAIN_TASK_STACK_SIZE=16384 +CONFIG_ESP_MAIN_TASK_STACK_SIZE=32768 CONFIG_ESP_IPC_TASK_STACK_SIZE=1024 CONFIG_ESP_IPC_USES_CALLERS_PRIORITY=y CONFIG_ESP_MINIMAL_SHARED_STACK_SIZE=2048 @@ -369,11 +369,7 @@ CONFIG_ESP_CONSOLE_UART_BAUDRATE=115200 CONFIG_ESP_INT_WDT=y CONFIG_ESP_INT_WDT_TIMEOUT_MS=300 CONFIG_ESP_INT_WDT_CHECK_CPU1=y -CONFIG_ESP_TASK_WDT=y -# CONFIG_ESP_TASK_WDT_PANIC is not set -CONFIG_ESP_TASK_WDT_TIMEOUT_S=5 -CONFIG_ESP_TASK_WDT_CHECK_IDLE_TASK_CPU0=y -CONFIG_ESP_TASK_WDT_CHECK_IDLE_TASK_CPU1=y +# CONFIG_ESP_TASK_WDT is not set # CONFIG_ESP_PANIC_HANDLER_IRAM is not set CONFIG_ESP_MAC_ADDR_UNIVERSE_WIFI_STA=y CONFIG_ESP_MAC_ADDR_UNIVERSE_WIFI_AP=y @@ -1092,7 +1088,7 @@ CONFIG_ESP32_RTC_CLOCK_SOURCE_INTERNAL_RC=y # CONFIG_COMPATIBLE_PRE_V2_1_BOOTLOADERS is not set CONFIG_SYSTEM_EVENT_QUEUE_SIZE=32 CONFIG_SYSTEM_EVENT_TASK_STACK_SIZE=2304 -CONFIG_MAIN_TASK_STACK_SIZE=16384 +CONFIG_MAIN_TASK_STACK_SIZE=32768 CONFIG_IPC_TASK_STACK_SIZE=1024 CONFIG_CONSOLE_UART_DEFAULT=y # CONFIG_CONSOLE_UART_CUSTOM is not set @@ -1104,11 +1100,7 @@ CONFIG_CONSOLE_UART_BAUDRATE=115200 CONFIG_INT_WDT=y CONFIG_INT_WDT_TIMEOUT_MS=300 CONFIG_INT_WDT_CHECK_CPU1=y -CONFIG_TASK_WDT=y -# CONFIG_TASK_WDT_PANIC is not set -CONFIG_TASK_WDT_TIMEOUT_S=5 -CONFIG_TASK_WDT_CHECK_IDLE_TASK_CPU0=y -CONFIG_TASK_WDT_CHECK_IDLE_TASK_CPU1=y +# CONFIG_TASK_WDT is not set # CONFIG_EVENT_LOOP_PROFILING is not set CONFIG_POST_EVENTS_FROM_ISR=y CONFIG_POST_EVENTS_FROM_IRAM_ISR=y diff --git a/esp32/examples/esp_opencv_tests/sdkconfig.old b/esp32/examples/esp_opencv_tests/sdkconfig.old index 3fdf64c..b36025b 100644 --- a/esp32/examples/esp_opencv_tests/sdkconfig.old +++ b/esp32/examples/esp_opencv_tests/sdkconfig.old @@ -120,9 +120,9 @@ CONFIG_PARTITION_TABLE_MD5=y # # Compiler options # -CONFIG_COMPILER_OPTIMIZATION_DEFAULT=y +# CONFIG_COMPILER_OPTIMIZATION_DEFAULT is not set # CONFIG_COMPILER_OPTIMIZATION_SIZE is not set -# CONFIG_COMPILER_OPTIMIZATION_PERF is not set +CONFIG_COMPILER_OPTIMIZATION_PERF=y # CONFIG_COMPILER_OPTIMIZATION_NONE is not set CONFIG_COMPILER_OPTIMIZATION_ASSERTIONS_ENABLE=y # CONFIG_COMPILER_OPTIMIZATION_ASSERTIONS_SILENT is not set @@ -130,10 +130,11 @@ CONFIG_COMPILER_OPTIMIZATION_ASSERTIONS_ENABLE=y CONFIG_COMPILER_CXX_EXCEPTIONS=y CONFIG_COMPILER_CXX_EXCEPTIONS_EMG_POOL_SIZE=0 # CONFIG_COMPILER_CXX_RTTI is not set -CONFIG_COMPILER_STACK_CHECK_MODE_NONE=y -# CONFIG_COMPILER_STACK_CHECK_MODE_NORM is not set +# CONFIG_COMPILER_STACK_CHECK_MODE_NONE is not set +CONFIG_COMPILER_STACK_CHECK_MODE_NORM=y # CONFIG_COMPILER_STACK_CHECK_MODE_STRONG is not set # CONFIG_COMPILER_STACK_CHECK_MODE_ALL is not set +CONFIG_COMPILER_STACK_CHECK=y # CONFIG_COMPILER_WARN_WRITE_STRINGS is not set # CONFIG_COMPILER_DISABLE_GCC8_WARNINGS is not set # end of Compiler options @@ -297,8 +298,8 @@ CONFIG_ESP32_UNIVERSAL_MAC_ADDRESSES_FOUR=y CONFIG_ESP32_UNIVERSAL_MAC_ADDRESSES=4 # CONFIG_ESP32_ULP_COPROC_ENABLED is not set CONFIG_ESP32_ULP_COPROC_RESERVE_MEM=0 -# CONFIG_ESP32_PANIC_PRINT_HALT is not set -CONFIG_ESP32_PANIC_PRINT_REBOOT=y +CONFIG_ESP32_PANIC_PRINT_HALT=y +# CONFIG_ESP32_PANIC_PRINT_REBOOT is not set # CONFIG_ESP32_PANIC_SILENT_REBOOT is not set # CONFIG_ESP32_PANIC_GDBSTUB is not set CONFIG_ESP32_DEBUG_OCDAWARE=y @@ -354,7 +355,7 @@ CONFIG_ADC_CAL_LUT_ENABLE=y CONFIG_ESP_ERR_TO_NAME_LOOKUP=y CONFIG_ESP_SYSTEM_EVENT_QUEUE_SIZE=32 CONFIG_ESP_SYSTEM_EVENT_TASK_STACK_SIZE=2304 -CONFIG_ESP_MAIN_TASK_STACK_SIZE=8584 +CONFIG_ESP_MAIN_TASK_STACK_SIZE=16384 CONFIG_ESP_IPC_TASK_STACK_SIZE=1024 CONFIG_ESP_IPC_USES_CALLERS_PRIORITY=y CONFIG_ESP_MINIMAL_SHARED_STACK_SIZE=2048 @@ -368,11 +369,7 @@ CONFIG_ESP_CONSOLE_UART_BAUDRATE=115200 CONFIG_ESP_INT_WDT=y CONFIG_ESP_INT_WDT_TIMEOUT_MS=300 CONFIG_ESP_INT_WDT_CHECK_CPU1=y -CONFIG_ESP_TASK_WDT=y -# CONFIG_ESP_TASK_WDT_PANIC is not set -CONFIG_ESP_TASK_WDT_TIMEOUT_S=5 -CONFIG_ESP_TASK_WDT_CHECK_IDLE_TASK_CPU0=y -CONFIG_ESP_TASK_WDT_CHECK_IDLE_TASK_CPU1=y +# CONFIG_ESP_TASK_WDT is not set # CONFIG_ESP_PANIC_HANDLER_IRAM is not set CONFIG_ESP_MAC_ADDR_UNIVERSE_WIFI_STA=y CONFIG_ESP_MAC_ADDR_UNIVERSE_WIFI_AP=y @@ -588,7 +585,6 @@ CONFIG_FREERTOS_TIMER_QUEUE_LENGTH=10 CONFIG_FREERTOS_QUEUE_REGISTRY_SIZE=0 # CONFIG_FREERTOS_USE_TRACE_FACILITY is not set # CONFIG_FREERTOS_GENERATE_RUN_TIME_STATS is not set -CONFIG_FREERTOS_TASK_FUNCTION_WRAPPER=y CONFIG_FREERTOS_CHECK_MUTEX_GIVEN_BY_OWNER=y # CONFIG_FREERTOS_CHECK_PORT_CRITICAL_COMPLIANCE is not set CONFIG_FREERTOS_DEBUG_OCDAWARE=y @@ -1017,3 +1013,152 @@ CONFIG_WPA_MBEDTLS_CRYPTO=y # # CONFIG_LEGACY_INCLUDE_COMMON_HEADERS is not set # end of Compatibility options + +# Deprecated options for backward compatibility +CONFIG_TOOLPREFIX="xtensa-esp32-elf-" +# CONFIG_LOG_BOOTLOADER_LEVEL_NONE is not set +# CONFIG_LOG_BOOTLOADER_LEVEL_ERROR is not set +# CONFIG_LOG_BOOTLOADER_LEVEL_WARN is not set +CONFIG_LOG_BOOTLOADER_LEVEL_INFO=y +# CONFIG_LOG_BOOTLOADER_LEVEL_DEBUG is not set +# CONFIG_LOG_BOOTLOADER_LEVEL_VERBOSE is not set +CONFIG_LOG_BOOTLOADER_LEVEL=3 +# CONFIG_APP_ROLLBACK_ENABLE is not set +# CONFIG_FLASH_ENCRYPTION_ENABLED is not set +# CONFIG_FLASHMODE_QIO is not set +# CONFIG_FLASHMODE_QOUT is not set +CONFIG_FLASHMODE_DIO=y +# CONFIG_FLASHMODE_DOUT is not set +# CONFIG_MONITOR_BAUD_9600B is not set +# CONFIG_MONITOR_BAUD_57600B is not set +CONFIG_MONITOR_BAUD_115200B=y +# CONFIG_MONITOR_BAUD_230400B is not set +# CONFIG_MONITOR_BAUD_921600B is not set +# CONFIG_MONITOR_BAUD_2MB is not set +# CONFIG_MONITOR_BAUD_OTHER is not set +CONFIG_MONITOR_BAUD_OTHER_VAL=115200 +CONFIG_MONITOR_BAUD=115200 +# CONFIG_COMPILER_OPTIMIZATION_LEVEL_DEBUG is not set +# CONFIG_COMPILER_OPTIMIZATION_LEVEL_RELEASE is not set +CONFIG_OPTIMIZATION_ASSERTIONS_ENABLED=y +# CONFIG_OPTIMIZATION_ASSERTIONS_SILENT is not set +# CONFIG_OPTIMIZATION_ASSERTIONS_DISABLED is not set +CONFIG_CXX_EXCEPTIONS=y +CONFIG_CXX_EXCEPTIONS_EMG_POOL_SIZE=0 +# CONFIG_STACK_CHECK_NONE is not set +CONFIG_STACK_CHECK_NORM=y +# CONFIG_STACK_CHECK_STRONG is not set +# CONFIG_STACK_CHECK_ALL is not set +CONFIG_STACK_CHECK=y +# CONFIG_WARN_WRITE_STRINGS is not set +# CONFIG_DISABLE_GCC8_WARNINGS is not set +# CONFIG_ESP32_APPTRACE_DEST_TRAX is not set +CONFIG_ESP32_APPTRACE_DEST_NONE=y +CONFIG_ESP32_APPTRACE_LOCK_ENABLE=y +CONFIG_BTDM_CONTROLLER_BLE_MAX_CONN_EFF=0 +CONFIG_BTDM_CONTROLLER_BR_EDR_MAX_ACL_CONN_EFF=0 +CONFIG_BTDM_CONTROLLER_BR_EDR_MAX_SYNC_CONN_EFF=0 +CONFIG_BTDM_CONTROLLER_PINNED_TO_CORE=0 +CONFIG_ADC2_DISABLE_DAC=y +CONFIG_SPIRAM_SUPPORT=y +# CONFIG_WIFI_LWIP_ALLOCATION_FROM_SPIRAM_FIRST is not set +CONFIG_TRACEMEM_RESERVE_DRAM=0x0 +# CONFIG_TWO_UNIVERSAL_MAC_ADDRESS is not set +CONFIG_FOUR_UNIVERSAL_MAC_ADDRESS=y +CONFIG_NUMBER_OF_UNIVERSAL_MAC_ADDRESS=4 +# CONFIG_ULP_COPROC_ENABLED is not set +CONFIG_ULP_COPROC_RESERVE_MEM=0 +CONFIG_BROWNOUT_DET=y +CONFIG_BROWNOUT_DET_LVL_SEL_0=y +# CONFIG_BROWNOUT_DET_LVL_SEL_1 is not set +# CONFIG_BROWNOUT_DET_LVL_SEL_2 is not set +# CONFIG_BROWNOUT_DET_LVL_SEL_3 is not set +# CONFIG_BROWNOUT_DET_LVL_SEL_4 is not set +# CONFIG_BROWNOUT_DET_LVL_SEL_5 is not set +# CONFIG_BROWNOUT_DET_LVL_SEL_6 is not set +# CONFIG_BROWNOUT_DET_LVL_SEL_7 is not set +CONFIG_BROWNOUT_DET_LVL=0 +CONFIG_REDUCE_PHY_TX_POWER=y +CONFIG_ESP32_RTC_CLOCK_SOURCE_INTERNAL_RC=y +# CONFIG_ESP32_RTC_CLOCK_SOURCE_EXTERNAL_CRYSTAL is not set +# CONFIG_ESP32_RTC_CLOCK_SOURCE_EXTERNAL_OSC is not set +# CONFIG_ESP32_RTC_CLOCK_SOURCE_INTERNAL_8MD256 is not set +# CONFIG_DISABLE_BASIC_ROM_CONSOLE is not set +# CONFIG_NO_BLOBS is not set +# CONFIG_COMPATIBLE_PRE_V2_1_BOOTLOADERS is not set +CONFIG_SYSTEM_EVENT_QUEUE_SIZE=32 +CONFIG_SYSTEM_EVENT_TASK_STACK_SIZE=2304 +CONFIG_MAIN_TASK_STACK_SIZE=16384 +CONFIG_IPC_TASK_STACK_SIZE=1024 +CONFIG_CONSOLE_UART_DEFAULT=y +# CONFIG_CONSOLE_UART_CUSTOM is not set +# CONFIG_CONSOLE_UART_NONE is not set +CONFIG_CONSOLE_UART_NUM=0 +CONFIG_CONSOLE_UART_TX_GPIO=1 +CONFIG_CONSOLE_UART_RX_GPIO=3 +CONFIG_CONSOLE_UART_BAUDRATE=115200 +CONFIG_INT_WDT=y +CONFIG_INT_WDT_TIMEOUT_MS=300 +CONFIG_INT_WDT_CHECK_CPU1=y +# CONFIG_TASK_WDT is not set +# CONFIG_EVENT_LOOP_PROFILING is not set +CONFIG_POST_EVENTS_FROM_ISR=y +CONFIG_POST_EVENTS_FROM_IRAM_ISR=y +CONFIG_TIMER_TASK_STACK_SIZE=3584 +CONFIG_MB_MASTER_TIMEOUT_MS_RESPOND=150 +CONFIG_MB_MASTER_DELAY_MS_CONVERT=200 +CONFIG_MB_QUEUE_LENGTH=20 +CONFIG_MB_SERIAL_TASK_STACK_SIZE=2048 +CONFIG_MB_SERIAL_BUF_SIZE=256 +CONFIG_MB_SERIAL_TASK_PRIO=10 +# CONFIG_MB_CONTROLLER_SLAVE_ID_SUPPORT is not set +CONFIG_MB_CONTROLLER_NOTIFY_TIMEOUT=20 +CONFIG_MB_CONTROLLER_NOTIFY_QUEUE_SIZE=20 +CONFIG_MB_CONTROLLER_STACK_SIZE=4096 +CONFIG_MB_EVENT_QUEUE_TIMEOUT=20 +CONFIG_MB_TIMER_PORT_ENABLED=y +CONFIG_MB_TIMER_GROUP=0 +CONFIG_MB_TIMER_INDEX=0 +CONFIG_SUPPORT_STATIC_ALLOCATION=y +# CONFIG_ENABLE_STATIC_TASK_CLEAN_UP_HOOK is not set +CONFIG_TIMER_TASK_PRIORITY=1 +CONFIG_TIMER_TASK_STACK_DEPTH=2048 +CONFIG_TIMER_QUEUE_LENGTH=10 +# CONFIG_L2_TO_L3_COPY is not set +# CONFIG_USE_ONLY_LWIP_SELECT is not set +CONFIG_ESP_GRATUITOUS_ARP=y +CONFIG_GARP_TMR_INTERVAL=60 +CONFIG_TCPIP_RECVMBOX_SIZE=32 +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_ESP_TCP_KEEP_CONNECTION_WHEN_IP_CHANGES is not set +CONFIG_TCP_OVERSIZE_MSS=y +# CONFIG_TCP_OVERSIZE_QUARTER_MSS is not set +# CONFIG_TCP_OVERSIZE_DISABLE is not set +CONFIG_UDP_RECVMBOX_SIZE=6 +CONFIG_TCPIP_TASK_STACK_SIZE=3072 +CONFIG_TCPIP_TASK_AFFINITY_NO_AFFINITY=y +# CONFIG_TCPIP_TASK_AFFINITY_CPU0 is not set +# CONFIG_TCPIP_TASK_AFFINITY_CPU1 is not set +CONFIG_TCPIP_TASK_AFFINITY=0x7FFFFFFF +# CONFIG_PPP_SUPPORT is not set +CONFIG_ESP32_PTHREAD_TASK_PRIO_DEFAULT=5 +CONFIG_ESP32_PTHREAD_TASK_STACK_SIZE_DEFAULT=3072 +CONFIG_ESP32_PTHREAD_STACK_MIN=768 +CONFIG_ESP32_DEFAULT_PTHREAD_CORE_NO_AFFINITY=y +# CONFIG_ESP32_DEFAULT_PTHREAD_CORE_0 is not set +# CONFIG_ESP32_DEFAULT_PTHREAD_CORE_1 is not set +CONFIG_ESP32_PTHREAD_TASK_CORE_DEFAULT=-1 +CONFIG_ESP32_PTHREAD_TASK_NAME_DEFAULT="pthread" +CONFIG_SPI_FLASH_WRITING_DANGEROUS_REGIONS_ABORTS=y +# CONFIG_SPI_FLASH_WRITING_DANGEROUS_REGIONS_FAILS is not set +# CONFIG_SPI_FLASH_WRITING_DANGEROUS_REGIONS_ALLOWED is not set +CONFIG_SUPPRESS_SELECT_DEBUG_OUTPUT=y +CONFIG_SUPPORT_TERMIOS=y +# End of deprecated options