diff --git a/components/esp_modem/test/target_iperf/main/cmd_pppclient.c b/components/esp_modem/test/target_iperf/main/cmd_pppclient.c index 0bb6a89699..37babfb570 100644 --- a/components/esp_modem/test/target_iperf/main/cmd_pppclient.c +++ b/components/esp_modem/test/target_iperf/main/cmd_pppclient.c @@ -234,6 +234,17 @@ static int ppp_cmd_iperf(int argc, char **argv) iperf_start(&cfg); return 0; } +static int restart(int argc, char **argv) +{ + ESP_LOGI("main", "Restarting"); + esp_restart(); +} +static int heap_size(int argc, char **argv) +{ + uint32_t heap_size = heap_caps_get_minimum_free_size(MALLOC_CAP_DEFAULT); + printf("min heap size: %"PRIu32"\n", heap_size); + return 0; +} void register_pppd(void) { @@ -286,4 +297,25 @@ void register_pppd(void) .argtable = &iperf_args }; ESP_ERROR_CHECK(esp_console_cmd_register(&iperf_cmd)); + + { + const esp_console_cmd_t cmd = { + .command = "restart", + .help = "Restart the program", + .hint = NULL, + .func = &restart, + }; + ESP_ERROR_CHECK( esp_console_cmd_register(&cmd) ); + + } + { + const esp_console_cmd_t heap_cmd = { + .command = "heap", + .help = "Get minimum size of free heap memory that was available during program execution", + .hint = NULL, + .func = &heap_size, + }; + ESP_ERROR_CHECK( esp_console_cmd_register(&heap_cmd) ); + } + } diff --git a/components/esp_modem/test/target_ota/CMakeLists.txt b/components/esp_modem/test/target_ota/CMakeLists.txt index 78ee6f0b43..37e45170bb 100644 --- a/components/esp_modem/test/target_ota/CMakeLists.txt +++ b/components/esp_modem/test/target_ota/CMakeLists.txt @@ -2,7 +2,5 @@ # in this exact order for cmake to work correctly cmake_minimum_required(VERSION 3.8) -set(EXTRA_COMPONENT_DIRS "../.." "../../../mbedtls_cxx") - include($ENV{IDF_PATH}/tools/cmake/project.cmake) project(ota_test) diff --git a/components/esp_modem/test/target_ota/main/idf_component.yml b/components/esp_modem/test/target_ota/main/idf_component.yml new file mode 100644 index 0000000000..ae03f49c98 --- /dev/null +++ b/components/esp_modem/test/target_ota/main/idf_component.yml @@ -0,0 +1,10 @@ +## IDF Component Manager Manifest File +dependencies: + espressif/esp_modem: + version: "*" + override_path: ../../.. + espressif/mbedtls_cxx: + version: "*" + override_path: ../../../../mbedtls_cxx + idf: + version: ">=4.1.0" diff --git a/components/esp_modem/test/target_ota/sdkconfig.ci.2 b/components/esp_modem/test/target_ota/sdkconfig.ci.2 index da6e474f7c..5baed38759 100644 --- a/components/esp_modem/test/target_ota/sdkconfig.ci.2 +++ b/components/esp_modem/test/target_ota/sdkconfig.ci.2 @@ -1,4 +1,4 @@ CONFIG_TEST_DEVICE_MODEM_GENERIC=y CONFIG_TEST_OTA_URI="https://raw.githubusercontent.com/espressif/esp-protocols/master/components/esp_modem/test/target_ota/bin/blink.bin" -CONFIG_TEST_OTA_CA_CERT="MIIEvjCCA6agAwIBAgIQBtjZBNVYQ0b2ii+nVCJ+xDANBgkqhkiG9w0BAQsFADBhMQswCQYDVQQGEwJVUzEVMBMGA1UEChMMRGlnaUNlcnQgSW5jMRkwFwYDVQQLExB3d3cuZGlnaWNlcnQuY29tMSAwHgYDVQQDExdEaWdpQ2VydCBHbG9iYWwgUm9vdCBDQTAeFw0yMTA0MTQwMDAwMDBaFw0zMTA0MTMyMzU5NTlaME8xCzAJBgNVBAYTAlVTMRUwEwYDVQQKEwxEaWdpQ2VydCBJbmMxKTAnBgNVBAMTIERpZ2lDZXJ0IFRMUyBSU0EgU0hBMjU2IDIwMjAgQ0ExMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAwUuzZUdwvN1PWNvsnO3DZuUfMRNUrUpmRh8sCuxkB+Uu3Ny5CiDt3+PE0J6aqXodgojlEVbbHp9YwlHnLDQNLtKS4VbL8Xlfs7uHyiUDe5pSQWYQYE9XE0nw6Ddng9/n00tnTCJRpt8OmRDtV1F0JuJ9x8piLhMbfyOIJVNvwTRYAIuE//i+p1hJInuWraKImxW8oHzf6VGo1bDtN+I2tIJLYrVJmuzHZ9bjPvXj1hJeRPG/cUJ9WIQDgLGBAfr5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