From a22b9975312b78ef9f6e65768a44f3c7b6ada83b Mon Sep 17 00:00:00 2001 From: ok-home Date: Mon, 25 Sep 2023 18:46:11 +0700 Subject: [PATCH] err check rollback --- sdkconfig | 6 ++++-- sdkconfig.old | 2 +- source/ota_ws_http.c | 4 ++-- 3 files changed, 7 insertions(+), 5 deletions(-) diff --git a/sdkconfig b/sdkconfig index 5ff7911..b5f6710 100644 --- a/sdkconfig +++ b/sdkconfig @@ -379,7 +379,8 @@ CONFIG_BOOTLOADER_REGION_PROTECTION_ENABLE=y CONFIG_BOOTLOADER_WDT_ENABLE=y # CONFIG_BOOTLOADER_WDT_DISABLE_IN_USER_CODE is not set CONFIG_BOOTLOADER_WDT_TIME_MS=9000 -# CONFIG_BOOTLOADER_APP_ROLLBACK_ENABLE is not set +CONFIG_BOOTLOADER_APP_ROLLBACK_ENABLE=y +# CONFIG_BOOTLOADER_APP_ANTI_ROLLBACK is not set # CONFIG_BOOTLOADER_SKIP_VALIDATE_IN_DEEP_SLEEP is not set # CONFIG_BOOTLOADER_SKIP_VALIDATE_ON_POWER_ON is not set # CONFIG_BOOTLOADER_SKIP_VALIDATE_ALWAYS is not set @@ -1849,7 +1850,8 @@ 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_APP_ROLLBACK_ENABLE=y +# CONFIG_APP_ANTI_ROLLBACK is not set # CONFIG_FLASH_ENCRYPTION_ENABLED is not set # CONFIG_FLASHMODE_QIO is not set # CONFIG_FLASHMODE_QOUT is not set diff --git a/sdkconfig.old b/sdkconfig.old index 94cba3e..5ff7911 100644 --- a/sdkconfig.old +++ b/sdkconfig.old @@ -486,7 +486,7 @@ CONFIG_ESPTOOLPY_MONITOR_BAUD=115200 CONFIG_PARTITION_TABLE_CUSTOM=y CONFIG_PARTITION_TABLE_CUSTOM_FILENAME="partitions.csv" CONFIG_PARTITION_TABLE_FILENAME="partitions.csv" -CONFIG_PARTITION_TABLE_OFFSET=0x9000 +CONFIG_PARTITION_TABLE_OFFSET=0x8000 CONFIG_PARTITION_TABLE_MD5=y # end of Partition Table diff --git a/source/ota_ws_http.c b/source/ota_ws_http.c index 3210ce8..0ab6f00 100644 --- a/source/ota_ws_http.c +++ b/source/ota_ws_http.c @@ -155,8 +155,8 @@ static esp_err_t ota_ws_handler(httpd_req_t *req) } if (strncmp(json_key, OTA_PROCESS_ROLLBACK, sizeof(OTA_PROCESS_ROLLBACK)) == 0) // process rollback ? { - ESP_LOGI(TAG,"rollback command %s %s",json_key,json_value) - if(srtncmp(json_value,"true",sizeof("true")) == 0) + ESP_LOGI(TAG,"rollback command %s %s",json_key,json_value); + if(strncmp(json_value,"true",sizeof("true")) == 0) { ret = rollback_ota_ws(true); // rollback }