Page 1 of 1

OTA & Partition table issue

Posted: Mon Oct 29, 2018 2:50 pm
by urbanze
esp_ota_set_boot_partition() are returning 261 error (ESP_ERR_NOT_FOUND) only when I set my partition table. When use pre-defined "two ota partition", works normally.

I put some prints in library and apparently, the error comes from here:

Code: Select all

else {
            // try to find this partition in flash,if not find it ,return error
            find_partition = esp_partition_find_first(ESP_PARTITION_TYPE_DATA, ESP_PARTITION_SUBTYPE_DATA_OTA, NULL);
            if (find_partition != NULL) {
                return esp_rewrite_ota_data(partition->subtype);
            } else {
            
                //HERE******************
                return ESP_ERR_NOT_FOUND;
            }
        }

What is wrong in my partition? OTA still doesn't working.

Code: Select all

# Name,     Type,   SubType,    Offset,     Size,   Flags
factory,    app,    factory,    0x10000,    1M,
ota_0,      app,    ota_0,      ,           1M,
ota_1,      app,    ota_1,      ,           1M,
nvs,        data,   nvs,        ,           40K,
log,	    data,   nvs,	    ,           72K,
phy_init,   data,   phy,        ,           4K,

Re: OTA & Partition table issue

Posted: Mon Oct 29, 2018 4:06 pm
by urbanze
Oh, I forget about this little detail:

Code: Select all

There is also a new “ota data” slot, which holds the data for OTA updates. The bootloader consults this data in order to know which app to execute. If “ota data” is empty, it will execute the factory app.
New partition table with "ota data" partition works.

Code: Select all

# Name,     Type,   SubType,    Offset,     Size,   Flags
factory,    app,    factory,    0x10000,    1M,
ota_0,      app,    ota_0,      ,           1M,
ota_1,      app,    ota_1,      ,           1M,
otadata,    data,   ota,        ,           8K,
nvs,        data,   nvs,        ,           40K,
log,	    data,   nvs,	    ,           72K,
phy_init,   data,   phy,        ,           4K,