update sector size to 512 bytes for ota

This commit is contained in:
Sebastien
2019-09-29 23:28:36 -04:00
parent 0ab1cd438b
commit 44ea1dd4a5
9 changed files with 24 additions and 16 deletions

View File

@@ -6,5 +6,6 @@
# todo: add support for https
COMPONENT_ADD_INCLUDEDIRS := .
COMPONENT_ADD_INCLUDEDIRS += include
COMPONENT_EXTRA_INCLUDES += $(PROJECT_PATH)/main/
CFLAGS += -DLOG_LOCAL_LEVEL=ESP_LOG_INFO -DCONFIG_OTA_ALLOW_HTTP=1
COMPONENT_EMBED_TXTFILES := ${PROJECT_PATH}/server_certs/github.pem

View File

@@ -21,6 +21,7 @@
#include "esp_err.h"
#include "tcpip_adapter.h"
#include "squeezelite-ota.h"
#include "nvs_utilities.h"
#include <time.h>
#include <sys/time.h>
#include <stdarg.h>
@@ -183,7 +184,7 @@ esp_err_t CODE_RAM_LOCATION init_config(esp_http_client_config_t * conf, const c
memset(conf, 0x00, sizeof(esp_http_client_config_t));
conf->cert_pem = (char *)server_cert_pem_start;
conf->event_handler = _http_event_handler;
conf->buffer_size = 1024*2;
conf->buffer_size = 1024;
conf->disable_auto_redirect=true;
conf->skip_cert_common_name_check = false;
conf->url = strdup(url);
@@ -262,7 +263,7 @@ esp_err_t process_recovery_ota(const char * bin_url){
#define OTA_CORE 1
#endif
ESP_LOGI(TAG, "Starting ota on core %u for : %s", OTA_CORE,urlPtr);
ret=xTaskCreatePinnedToCore(&ota_task, "ota_task", 1024*40, (void *)urlPtr, ESP_TASK_MAIN_PRIO+3, NULL, OTA_CORE);
ret=xTaskCreatePinnedToCore(&ota_task, "ota_task", 1024*10, (void *)urlPtr, ESP_TASK_MAIN_PRIO+3, NULL, OTA_CORE);
if (ret != pdPASS) {
ESP_LOGI(TAG, "create thread %s failed", "ota_task");
return ESP_FAIL;
@@ -277,8 +278,9 @@ esp_err_t start_ota(const char * bin_url, bool bFromAppMain)
return process_recovery_ota(bin_url);
#else
ESP_LOGW(TAG, "Called to update the firmware from url: %s",bin_url);
store_nvs_value(NVS_TYPE_STR, "fwurl", bin_url);
ESP_LOGW(TAG, "Rebooting to recovery to complete the installation");
return guided_factory();
return guided_factory();
return ESP_OK;
#endif
}

View File

@@ -8,7 +8,7 @@
#pragma once
#include "esp_attr.h"
#if RECOVERY_APPLICATION
#define CODE_RAM_LOCATION IRAM_ATTR
#define CODE_RAM_LOCATION
#else
#define CODE_RAM_LOCATION
#endif