OTA via UART getting error and file partially getting transmitted

jahnavialcobrake
Posts: 1
Joined: Tue Oct 15, 2024 10:48 am

OTA via UART getting error and file partially getting transmitted

Postby jahnavialcobrake » Tue Oct 15, 2024 10:59 am

Hi,
I am trying to perform ota using uart. I am using the following code to transfer a bin file of size 178880.

Code: Select all

/*
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 3 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
 * MA 02110-1301, USA.
 *
 *
 * Benjamin Aigner, 2019 <beni@asterics-foundation.org>
 */
#include "string.h"
#include "freertos/FreeRTOS.h"
#include "freertos/task.h"
#include "freertos/event_groups.h"

#include "esp_system.h"
#include "esp_event_loop.h"
#include "esp_log.h"
#include "esp_ota_ops.h"
#include "esp_flash_partitions.h"
#include "esp_partition.h"

#include "nvs.h"
#include "nvs_flash.h"
#include "driver/gpio.h"
#include "driver/uart.h"

/** @brief TX pin for serial IF to LPC chip */
#define HAL_SERIAL_TXPIN (GPIO_NUM_18)
/** @brief RTX pin for serial IF to LPC chip */
#define HAL_SERIAL_RXPIN (GPIO_NUM_19)
/** @brief UART unit number for serial IF to LPC chip */
#define HAL_SERIAL_UART (UART_NUM_2)

#define BUFFSIZE 2048
#define HASH_LEN 32 /* SHA-256 digest length */

static const char *TAG = "FLipMouseOTA";
/*an ota data write buffer ready to write to the flash*/
uint8_t ota_write_data[BUFFSIZE + 1] = {0};

static void __attribute__((noreturn)) task_fatal_error()
{
    ESP_LOGE(TAG, "Exiting task due to fatal error...");
    (void)vTaskDelete(NULL);

    while (1)
    {
        ;
    }
}

static void print_sha256(const uint8_t *image_hash, const char *label)
{
    char hash_print[HASH_LEN * 2 + 1];
    hash_print[HASH_LEN * 2] = 0;
    for (int i = 0; i < HASH_LEN; ++i)
    {
        sprintf(&hash_print[i * 2], "%02x", image_hash[i]);
    }
    ESP_LOGI(TAG, "%s: %s", label, hash_print);
}

static void infinite_loop(void)
{
    int i = 0;
    ESP_LOGI(TAG, "Please send data now.");
    while (1)
    {
        ESP_LOGI(TAG, "Waiting for a new firmware ... %d", ++i);
        vTaskDelay(2000 / portTICK_PERIOD_MS);
    }
}

static esp_err_t uart_setup(void)
{
    esp_err_t ret = ESP_OK;
    const uart_config_t uart_config = {
        .baud_rate = 115200,
        .data_bits = UART_DATA_8_BITS,
        .parity = UART_PARITY_DISABLE,
        .stop_bits = UART_STOP_BITS_1,
        .flow_ctrl = UART_HW_FLOWCTRL_DISABLE};

    // update UART config
    ret = uart_param_config(HAL_SERIAL_UART, &uart_config);
    if (ret != ESP_OK)
    {
        ESP_LOGE(TAG, "UART param config failed");
        return ret;
    }

    // set IO pins
    ret = uart_set_pin(HAL_SERIAL_UART, HAL_SERIAL_TXPIN, HAL_SERIAL_RXPIN, UART_PIN_NO_CHANGE, UART_PIN_NO_CHANGE);
    if (ret != ESP_OK)
    {
        ESP_LOGE(TAG, "UART set pin failed");
        return ret;
    }

    // Install UART driver with RX and TX buffers
    ret = uart_driver_install(HAL_SERIAL_UART, BUFFSIZE, BUFFSIZE, 0, NULL, 0);
    if (ret != ESP_OK)
    {
        ESP_LOGE(TAG, "UART driver install failed");
        return ret;
    }

    return ESP_OK;
}

static void ota_example_task(void *pvParameter)
{
    esp_err_t err;
    /* update handle : set by esp_ota_begin(), must be freed via esp_ota_end() */
    esp_ota_handle_t update_handle = 0;
    const esp_partition_t *update_partition =  esp_ota_get_next_update_partition(NULL);;
    esp_app_desc_t invalid_app_info;
    ESP_LOGI(TAG, "Starting Update");

    ESP_LOGI(TAG, "Setup UART");
    if (uart_setup() != ESP_OK)
    {
        ESP_LOGE(TAG, "Error initialising UART");
        esp_restart();
    }

    const esp_partition_t *configured = esp_ota_get_boot_partition();
    const esp_partition_t *running = esp_ota_get_running_partition();

    if (configured != running)
    {
        ESP_LOGW(TAG, "Configured OTA boot partition at offset 0x%08x, but running from offset 0x%08x",
                 configured->address, running->address);
        ESP_LOGW(TAG, "(This can happen if either the OTA boot data or preferred boot image become corrupted somehow.)");
    }
    ESP_LOGI(TAG, "Running partition type %d subtype %d (offset 0x%08x)",
             running->type, running->subtype, running->address);

    update_partition = esp_ota_get_next_update_partition(NULL);
    ESP_LOGI(TAG, "Writing to partition subtype %d at offset 0x%x",
             update_partition->subtype, update_partition->address);
    assert(update_partition != NULL);

    uart_flush(HAL_SERIAL_UART);
    uint8_t sync[8]; // include \r\n
    uint8_t sync_test[6] = {0xC0, 0xFF, 0xFE, 0xAA, 0x55, 0x90};
    uart_read_bytes(HAL_SERIAL_UART, sync, 6, 5000);

    if (memcmp(sync, sync_test, 6) != 0)
    {
        ESP_LOGE(TAG, "recv:");
        ESP_LOG_BUFFER_HEXDUMP(TAG, sync, 6, ESP_LOG_ERROR);
        ESP_LOGE(TAG, "expected:");
        ESP_LOG_BUFFER_HEXDUMP(TAG, sync_test, 6, ESP_LOG_ERROR);
        ESP_LOGE(TAG, "Sync bytes not correct");
        task_fatal_error();
    }
    else
    {
        ESP_LOGE(TAG, "recv:");
        ESP_LOG_BUFFER_HEXDUMP(TAG, sync, 6, ESP_LOG_ERROR);
        ESP_LOGE(TAG, "expected:");
        ESP_LOG_BUFFER_HEXDUMP(TAG, sync_test, 6, ESP_LOG_ERROR);
        ESP_LOGE(TAG, "\n\n\nSync bytes correct recieved\n\n");
    }

    int binary_file_length = 0;
    /*deal with all receive packet*/
    bool image_header_was_checked = false;
    while (1)
    {
        // int data_read = esp_http_client_read(client, ota_write_data, BUFFSIZE);
        int data_read = uart_read_bytes(HAL_SERIAL_UART, ota_write_data, BUFFSIZE, 5000 / portTICK_PERIOD_MS);
        if (data_read < 0)
        {
            ESP_LOGE(TAG, "Error: UART data read error");
            task_fatal_error();
        }
        else if (data_read > 0)
        {
            ESP_LOGI(TAG, "Received %d bytes: ", data_read);
            // ESP_LOG_BUFFER_HEXDUMP(TAG, ota_write_data, data_read, ESP_LOG_INFO);
            if (image_header_was_checked == false)
            {
                esp_app_desc_t new_app_info;
                if (data_read > sizeof(esp_image_header_t) + sizeof(esp_image_segment_header_t) + sizeof(esp_app_desc_t))
                {
                    // check current version with downloading
                    memcpy(&new_app_info, &ota_write_data[sizeof(esp_image_header_t) + sizeof(esp_image_segment_header_t)], sizeof(esp_app_desc_t));
                    ESP_LOGI(TAG, "New firmware version: %s", new_app_info.version);

                    esp_app_desc_t running_app_info;
                    if (esp_ota_get_partition_description(running, &running_app_info) == ESP_OK)
                    {
                        ESP_LOGI(TAG, "Running firmware version: %s", running_app_info.version);
                    }
                    const esp_partition_t *last_invalid_app = esp_ota_get_last_invalid_partition();
                    if (last_invalid_app != NULL)
                    {
                        // Handle the invalid partition (e.g., log, revert, etc.)
                        ESP_LOGI("OTA", "Last invalid partition found: %s", last_invalid_app->label);
                    }
                    else
                    {
                        ESP_LOGI("OTA", "No invalid partition found.");
                    }

                    esp_app_desc_t invalid_app_info;
                    if (esp_ota_get_partition_description(last_invalid_app, &invalid_app_info) == ESP_OK)
                    {
                        ESP_LOGI(TAG, "Last invalid firmware version: %s", invalid_app_info.version);
                    }

                    // check current version with last invalid partition
                    if (last_invalid_app != NULL)
                    {
                        if (memcmp(invalid_app_info.version, new_app_info.version, sizeof(new_app_info.version)) == 0)
                        {
                            ESP_LOGW(TAG, "New version is the same as invalid version.");
                            ESP_LOGW(TAG, "Previously, there was an attempt to launch the firmware with %s version, but it failed.", invalid_app_info.version);
                            ESP_LOGW(TAG, "The firmware has been rolled back to the previous version.");
                            infinite_loop();
                        }
                    }

                    if (memcmp(new_app_info.version, running_app_info.version, sizeof(new_app_info.version)) == 0)
                    {
                        ESP_LOGW(TAG, "Current running version is the same as a new. We will not continue the update.");
                        infinite_loop();
                    }

                    image_header_was_checked = true;

                    err = esp_ota_begin(update_partition, OTA_SIZE_UNKNOWN, &update_handle);
                    if (err != ESP_OK)
                    {
                        ESP_LOGE(TAG, "esp_ota_begin failed (%s)", esp_err_to_name(err));
                        task_fatal_error();
                    }
                    ESP_LOGI(TAG, "esp_ota_begin succeeded");
                }
                else
                {
                    ESP_LOGE(TAG, "received package is not fit len");
                    task_fatal_error();
                }
            }

            err = esp_ota_write(update_handle, (const void *)ota_write_data, data_read);
            if (err != ESP_OK)
            {
                ESP_LOGE(TAG, "esp_ota_write failed at byte %d: %s", binary_file_length, esp_err_to_name(err));
                task_fatal_error();
            }

            err = esp_ota_write( update_handle, (const void *)ota_write_data, data_read);
            if (err != ESP_OK) {
                task_fatal_error();
            }
            binary_file_length += data_read;
            ESP_LOGI(TAG, "Written image length %d", binary_file_length);
        }
        else if (data_read == 0)
        {
            /// TODO: signal end of transmission
            ESP_LOGI(TAG, "Connection closed,all data received");
            break;
        }
    }
    ESP_LOGI(TAG, "Total Write binary data length : %d", binary_file_length);

    if (esp_ota_end(update_handle) != ESP_OK) {
        ESP_LOGE(TAG, "esp_ota_end failed!");
        task_fatal_error();
    }

    err = esp_ota_set_boot_partition(update_partition);
    if (err != ESP_OK) {
        ESP_LOGE(TAG, "esp_ota_set_boot_partition failed (%s)!", esp_err_to_name(err));
        task_fatal_error();
    }
    ESP_LOGI(TAG, "Prepare to restart system!");
    esp_restart();
    return;
}

void app_main()
{
    uint8_t sha_256[HASH_LEN] = {0};
    esp_partition_t partition;

    // set debug output
    esp_log_level_set("*", ESP_LOG_DEBUG);
    esp_log_level_set(TAG, ESP_LOG_DEBUG);

    // get sha256 digest for the partition table
    partition.address = ESP_PARTITION_TABLE_OFFSET;
    partition.size = ESP_PARTITION_TABLE_MAX_LEN;
    partition.type = ESP_PARTITION_TYPE_DATA;
    esp_partition_get_sha256(&partition, sha_256);
    print_sha256(sha_256, "SHA-256 for the partition table: ");

    // get sha256 digest for bootloader
    partition.address = ESP_BOOTLOADER_OFFSET;
    partition.size = ESP_PARTITION_TABLE_OFFSET;
    partition.type = ESP_PARTITION_TYPE_APP;
    esp_partition_get_sha256(&partition, sha_256);
    print_sha256(sha_256, "SHA-256 for bootloader: ");

    // get sha256 digest for running partition
    esp_partition_get_sha256(esp_ota_get_running_partition(), sha_256);
    print_sha256(sha_256, "SHA-256 for current firmware: ");

    const esp_partition_t *running = esp_ota_get_running_partition();
    esp_ota_img_states_t ota_state;
    if (esp_ota_get_state_partition(running, &ota_state) == ESP_OK)
    {
        ESP_LOGI(TAG, "OTA state: %d", ota_state);
        if (ota_state == ESP_OTA_IMG_PENDING_VERIFY)
        {
            ESP_LOGI(TAG, "OTA partition marked valid");
            esp_ota_mark_app_valid_cancel_rollback();
            esp_restart();
        }
    }
    else{
        ESP_LOGI(TAG, "else OTA state: %d", ota_state);
    }

    // Initialize NVS.
    esp_err_t err = nvs_flash_init();
    if (err == ESP_ERR_NVS_NO_FREE_PAGES || err == ESP_ERR_NVS_NEW_VERSION_FOUND)
    {
        // OTA app partition table has a smaller NVS partition size than the non-OTA
        // partition table. This size mismatch may cause NVS initialization to fail.
        // If this happens, we erase NVS partition and initialize NVS again.
        ESP_ERROR_CHECK(nvs_flash_erase());
        err = nvs_flash_init();
    }
    ESP_ERROR_CHECK(err);
    gpio_pad_select_gpio(2); // Select GPIO function for the pin

    gpio_set_direction(2, GPIO_MODE_OUTPUT); // Set as output

    gpio_set_level(2, 1);

    xTaskCreate(&ota_example_task, "OTA", 8192, NULL, 5, NULL);
}

Code: Select all

nvs,      data, nvs,     ,        0x4000,
otadata,  data, ota,     ,        0x2000,
phy_init, data, phy,     ,        0x1000,
factory,  app,  factory, ,        3M,
ota_0,    app,  ota_0,   ,        2M,
ota_1,    app,  ota_1,   ,        2M,
storage,  data, spiffs,     ,        0xf0000,
I am recieving the following error. Please help me to over come this issue as i got stuck here from past few days.

Code: Select all

I (623) heap_init: At 3FFAE6E0 len 00001920 (6 KiB): DRAM
D (629) heap_init: New heap initialised at 0x3ffb3570
I (634) heap_init: At 3FFB3570 len 0002CA90 (178 KiB): DRAM
I (640) heap_init: At 3FFE0440 len 00003AE0 (14 KiB): D/IRAM
I (646) heap_init: At 3FFE4350 len 0001BCB0 (111 KiB): D/IRAM
D (653) heap_init: New heap initialised at 0x4008cad8
I (658) heap_init: At 4008CAD8 len 00013528 (77 KiB): IRAM
D (665) intr_alloc: Connected src 46 to int 2 (cpu 0)
D (670) FLASH_HAL: extra_dummy: 1
D (673) spi_flash: trying chip: issi
D (676) spi_flash: trying chip: gd
D (680) spi_flash: trying chip: mxic
D (684) spi_flash: trying chip: winbond
D (687) spi_flash: trying chip: generic
I (691) spi_flash: detected chip: generic
I (696) spi_flash: flash io: dio
D (700) cpu_start: calling init function: 0x400eaa60
0x400eaa60: esp_ipc_init at /home/alcobrake/esp/esp-idf/components/esp_ipc/src/esp_ipc.c:105

D (705) cpu_start: calling init function: 0x400e4e08
0x400e4e08: _GLOBAL__sub_I___cxa_get_globals_fast at /builds/idf/crosstool-NG/.build/xtensa-esp32-elf/src/gcc/libstdc++-v3/libsupc++/eh_globals.cc:145

D (710) cpu_start: calling init function: 0x400d10dc
0x400d10dc: esp_ota_init_app_elf_sha256 at /home/alcobrake/esp/esp-idf/components/app_update/esp_app_desc.c:68

D (715) intr_alloc: Connected src 17 to int 3 (cpu 0)
D (720) intr_alloc: Connected src 24 to int 9 (cpu 0)
I (725) cpu_start: Starting scheduler on PRO CPU.
D (0) intr_alloc: Connected src 25 to int 2 (cpu 1)
I (0) cpu_start: Starting scheduler on APP CPU.
D (751) heap_init: New heap initialised at 0x3ffe0440
D (751) heap_init: New heap initialised at 0x3ffe4350
D (761) intr_alloc: Connected src 16 to int 12 (cpu 0)
I (761) FLipMouseOTA: SHA-256 for the partition table: : c6b7d7d2c1cdf12fbcaacff52bc9695b592d2977c5b2feb449315de36220c8dd
D (771) esp_image: reading image header @ 0x1000
D (781) esp_image: free data page_count 0x0000003f
D (781) esp_image: skipping checksum for segment
D (791) esp_image: free data page_count 0x0000003f
D (791) esp_image: skipping checksum for segment
D (801) esp_image: free data page_count 0x0000003f
D (801) esp_image: skipping checksum for segment
I (811) FLipMouseOTA: SHA-256 for bootloader: : 12019c6d50e6f99839d181fdea98157334c230ff7c03cd722787d64efa123311
D (821) partition: Loading the partition table
D (821) partition: Partition table MD5 verified
D (831) esp_image: reading image header @ 0x10000
D (831) esp_image: free data page_count 0x0000003f
D (841) esp_image: skipping checksum for segment
D (841) esp_image: free data page_count 0x0000003f
D (841) esp_image: skipping checksum for segment
D (851) esp_image: free data page_count 0x0000003f
D (851) esp_image: skipping checksum for segment
D (861) esp_image: free data page_count 0x0000003f
D (861) esp_image: skipping checksum for segment
D (871) esp_image: free data page_count 0x0000003f
D (871) esp_image: skipping checksum for segment
D (881) esp_image: free data page_count 0x0000003f
D (881) esp_image: skipping checksum for segment
I (951) FLipMouseOTA: SHA-256 for current firmware: : 9e449c1d2141484b09dfcc443af3a4567aed46a7b268081c07b161b49077acb4
I (951) FLipMouseOTA: else OTA state: 0
I (971) FLipMouseOTA: Starting Update
I (971) FLipMouseOTA: Setup UART
D (971) intr_alloc: Connected src 36 to int 3 (cpu 1)
D (971) esp_ota_ops: found ota app max = 2
D (971) esp_ota_ops: finding factory app...
I (981) FLipMouseOTA: Running partition type 0 subtype 0 (offset 0x00010000)
I (991) FLipMouseOTA: Writing to partition subtype 16 at offset 0x310000
E (45451) FLipMouseOTA: recv:
E (45451) FLipMouseOTA: 0x3ffb9404   c0 ff fe aa 55 90                                 |....U.|
E (45451) FLipMouseOTA: expected:
E (45461) FLipMouseOTA: 0x3ffb940c   c0 ff fe aa 55 90                                 |....U.|
E (45471) FLipMouseOTA: 


Sync bytes correct recieved


I (46141) FLipMouseOTA: Received 2048 bytes: 
I (46141) FLipMouseOTA: New firmware version: v4.4.2-dirty
I (46141) FLipMouseOTA: Running firmware version: b3b7323-dirty
D (46151) [color=#FF0000]esp_ota_ops: Invalid otadata[-1][/color]
I (46151) OTA: No invalid partition found.
I (47771) FLipMouseOTA: esp_ota_begin succeeded
I (47791) FLipMouseOTA: Written image length 2048
I (47801) FLipMouseOTA: Received 2048 bytes: 
I (47811) FLipMouseOTA: Written image length 4096
I (48001) FLipMouseOTA: Received 2048 bytes: 
I (48021) FLipMouseOTA: Written image length 6144
I (48201) FLipMouseOTA: Received 2048 bytes: 
I (48211) FLipMouseOTA: Written image length 8192
I (48421) FLipMouseOTA: Received 2048 bytes: 
I (48431) FLipMouseOTA: Written image length 10240
I (48621) FLipMouseOTA: Received 2048 bytes: 
I (48641) FLipMouseOTA: Written image length 12288
I (48831) FLipMouseOTA: Received 2048 bytes: 
I (48841) FLipMouseOTA: Written image length 14336
I (49041) FLipMouseOTA: Received 2048 bytes: 
I (49051) FLipMouseOTA: Written image length 16384
I (49241) FLipMouseOTA: Received 2048 bytes: 
I (49251) FLipMouseOTA: Written image length 18432
I (49451) FLipMouseOTA: Received 2048 bytes: 
I (49461) FLipMouseOTA: Written image length 20480
I (49661) FLipMouseOTA: Received 2048 bytes: 
I (49671) FLipMouseOTA: Written image length 22528
I (49861) FLipMouseOTA: Received 2048 bytes: 
I (49871) FLipMouseOTA: Written image length 24576
I (50071) FLipMouseOTA: Received 2048 bytes: 
I (50081) FLipMouseOTA: Written image length 26624
I (50281) FLipMouseOTA: Received 2048 bytes: 
I (50291) FLipMouseOTA: Written image length 28672
I (50471) FLipMouseOTA: Received 2048 bytes: 
I (50481) FLipMouseOTA: Written image length 30720
I (50681) FLipMouseOTA: Received 2048 bytes: 
I (50691) FLipMouseOTA: Written image length 32768
I (50891) FLipMouseOTA: Received 2048 bytes: 
I (50901) FLipMouseOTA: Written image length 34816
I (51091) FLipMouseOTA: Received 2048 bytes: 
I (51101) FLipMouseOTA: Written image length 36864
I (51291) FLipMouseOTA: Received 2048 bytes: 
I (51301) FLipMouseOTA: Written image length 38912
I (51501) FLipMouseOTA: Received 2048 bytes: 
I (51511) FLipMouseOTA: Written image length 40960
I (51711) FLipMouseOTA: Received 2048 bytes: 
I (51721) FLipMouseOTA: Written image length 43008
I (51921) FLipMouseOTA: Received 2048 bytes: 
I (51931) FLipMouseOTA: Written image length 45056
I (52131) FLipMouseOTA: Received 2048 bytes: 
I (52141) FLipMouseOTA: Written image length 47104
I (52331) FLipMouseOTA: Received 2048 bytes: 
I (52341) FLipMouseOTA: Written image length 49152
I (52541) FLipMouseOTA: Received 2048 bytes: 
I (52551) FLipMouseOTA: Written image length 51200
I (52751) FLipMouseOTA: Received 2048 bytes: 
I (52761) FLipMouseOTA: Written image length 53248
I (52951) FLipMouseOTA: Received 2048 bytes: 
I (52961) FLipMouseOTA: Written image length 55296
I (53161) FLipMouseOTA: Received 2048 bytes: 
I (53171) FLipMouseOTA: Written image length 57344
I (53371) FLipMouseOTA: Received 2048 bytes: 
I (53381) FLipMouseOTA: Written image length 59392
I (53571) FLipMouseOTA: Received 2048 bytes: 
I (53591) FLipMouseOTA: Written image length 61440
I (53781) FLipMouseOTA: Received 2048 bytes: 
I (53791) FLipMouseOTA: Written image length 63488
I (53991) FLipMouseOTA: Received 2048 bytes: 
I (54001) FLipMouseOTA: Written image length 65536
I (54191) FLipMouseOTA: Received 2048 bytes: 
I (54201) FLipMouseOTA: Written image length 67584
I (54391) FLipMouseOTA: Received 2048 bytes: 
I (54401) FLipMouseOTA: Written image length 69632
I (54611) FLipMouseOTA: Received 2048 bytes: 
I (54621) FLipMouseOTA: Written image length 71680
I (54811) FLipMouseOTA: Received 2048 bytes: 
I (54821) FLipMouseOTA: Written image length 73728
I (55021) FLipMouseOTA: Received 2048 bytes: 
I (55031) FLipMouseOTA: Written image length 75776
I (55231) FLipMouseOTA: Received 2048 bytes: 
I (55241) FLipMouseOTA: Written image length 77824
I (55431) FLipMouseOTA: Received 2048 bytes: 
I (55441) FLipMouseOTA: Written image length 79872
I (55631) FLipMouseOTA: Received 2048 bytes: 
I (55641) FLipMouseOTA: Written image length 81920
I (55841) FLipMouseOTA: Received 2048 bytes: 
I (55851) FLipMouseOTA: Written image length 83968
I (56051) FLipMouseOTA: Received 2048 bytes: 
I (56061) FLipMouseOTA: Written image length 86016
I (56261) FLipMouseOTA: Received 2048 bytes: 
I (56271) FLipMouseOTA: Written image length 88064
I (56461) FLipMouseOTA: Received 2048 bytes: 
I (56471) FLipMouseOTA: Written image length 90112
I (56661) FLipMouseOTA: Received 2048 bytes: 
I (56671) FLipMouseOTA: Written image length 92160
I (56891) FLipMouseOTA: Received 2048 bytes: 
I (56901) FLipMouseOTA: Written image length 94208
I (57091) FLipMouseOTA: Received 2048 bytes: 
I (57101) FLipMouseOTA: Written image length 96256
I (57301) FLipMouseOTA: Received 2048 bytes: 
I (57311) FLipMouseOTA: Written image length 98304
I (57501) FLipMouseOTA: Received 2048 bytes: 
I (57521) FLipMouseOTA: Written image length 100352
I (57701) FLipMouseOTA: Received 2048 bytes: 
I (57711) FLipMouseOTA: Written image length 102400
I (57921) FLipMouseOTA: Received 2048 bytes: 
I (57931) FLipMouseOTA: Written image length 104448
I (58121) FLipMouseOTA: Received 2048 bytes: 
I (58131) FLipMouseOTA: Written image length 106496
I (58331) FLipMouseOTA: Received 2048 bytes: 
I (58341) FLipMouseOTA: Written image length 108544
I (58541) FLipMouseOTA: Received 2048 bytes: 
I (58551) FLipMouseOTA: Written image length 110592
I (58741) FLipMouseOTA: Received 2048 bytes: 
I (58751) FLipMouseOTA: Written image length 112640
I (58941) FLipMouseOTA: Received 2048 bytes: 
I (58951) FLipMouseOTA: Written image length 114688
I (59161) FLipMouseOTA: Received 2048 bytes: 
I (59171) FLipMouseOTA: Written image length 116736
I (59361) FLipMouseOTA: Received 2048 bytes: 
I (59371) FLipMouseOTA: Written image length 118784
I (59571) FLipMouseOTA: Received 2048 bytes: 
I (59581) FLipMouseOTA: Written image length 120832
I (59771) FLipMouseOTA: Received 2048 bytes: 
I (59781) FLipMouseOTA: Written image length 122880
I (59981) FLipMouseOTA: Received 2048 bytes: 
I (59991) FLipMouseOTA: Written image length 124928
I (60191) FLipMouseOTA: Received 2048 bytes: 
I (60201) FLipMouseOTA: Written image length 126976
I (60401) FLipMouseOTA: Received 2048 bytes: 
I (60411) FLipMouseOTA: Written image length 129024
I (60601) FLipMouseOTA: Received 2048 bytes: 
I (60611) FLipMouseOTA: Written image length 131072
I (60801) FLipMouseOTA: Received 2048 bytes: 
I (60811) FLipMouseOTA: Written image length 133120
I (61011) FLipMouseOTA: Received 2048 bytes: 
I (61021) FLipMouseOTA: Written image length 135168
I (61221) FLipMouseOTA: Received 2048 bytes: 
I (61231) FLipMouseOTA: Written image length 137216
I (61431) FLipMouseOTA: Received 2048 bytes: 
I (61441) FLipMouseOTA: Written image length 139264
I (61631) FLipMouseOTA: Received 2048 bytes: 
I (61641) FLipMouseOTA: Written image length 141312
I (61841) FLipMouseOTA: Received 2048 bytes: 
I (61851) FLipMouseOTA: Written image length 143360
I (62051) FLipMouseOTA: Received 2048 bytes: 
I (62061) FLipMouseOTA: Written image length 145408
I (62251) FLipMouseOTA: Received 2048 bytes: 
I (62271) FLipMouseOTA: Written image length 147456
I (62461) FLipMouseOTA: Received 2048 bytes: 
I (62471) FLipMouseOTA: Written image length 149504
I (62671) FLipMouseOTA: Received 2048 bytes: 
I (62681) FLipMouseOTA: Written image length 151552
I (62881) FLipMouseOTA: Received 2048 bytes: 
I (62891) FLipMouseOTA: Written image length 153600
I (63081) FLipMouseOTA: Received 2048 bytes: 
I (63091) FLipMouseOTA: Written image length 155648
I (63291) FLipMouseOTA: Received 2048 bytes: 
I (63301) FLipMouseOTA: Written image length 157696
I (63491) FLipMouseOTA: Received 2048 bytes: 
I (63501) FLipMouseOTA: Written image length 159744
I (63701) FLipMouseOTA: Received 2048 bytes: 
I (63711) FLipMouseOTA: Written image length 161792
I (63911) FLipMouseOTA: Received 2048 bytes: 
I (63921) FLipMouseOTA: Written image length 163840
I (68991) FLipMouseOTA: Received 949 bytes: 
I (68991) FLipMouseOTA: Written image length 164789
I (73991) FLipMouseOTA: Connection closed,all data received
I (73991) FLipMouseOTA: Total Write binary data length : 164789
[color=#FF0000]D (73991) esp_image: reading image header @ 0x310000
D (73991) esp_image: image header: 0xe9 0x06 0x02 0x01 400810e4
I (74001) esp_image: segment 0: paddr=00310020 vaddr=3f400020 size=0888ch ( 34956) map
D (74011) esp_image: free data page_count 0x0000003f
E (74021) esp_image: invalid segment length 0x5252455f
E (74021) FLipMouseOTA: esp_ota_end failed![/color]
E (74021) FLipMouseOTA: Exiting task due to fatal error...
Thankyou

Who is online

Users browsing this forum: No registered users and 127 guests