OTA partitions in ESP32-C3
I am trying to enable OTA partitions in ESP32-C3 by changing the custom partition file in sdkconfig file.
But it's not getting enabled. Can you please help?
OTA: Error setting boot partition for ESP32
I just wanted to use the ESP32 Partition class for OTA.
Everything seems to work fine, except setting a partition as boot partition does not work.
>>> from esp32 import Partition
>>> running = Partition(Partition.RUNNING)
>>> next = running.get_next_update()
>>> next.info()
(0, 18, 1441792, 1376256, 'ota_2', False)
>>> running.info()
(0, 17, 65536, 1376256, 'ota_1', False)
>>> next.set_boot()
I (57130) esp_image: segment 0: paddr=0x00160020 vaddr=0x3fff0018 size=0x00004 ( 4)
I (57140) esp_image: segment 1: paddr=0x0016002c vaddr=0x3fff001c size=0x012d0 ( 4816)
I (57140) esp_image: segment 2: paddr=0x00161304 vaddr=0x40078000 size=0x025b8 ( 9656)
I (57160) esp_image: segment 3: paddr=0x001638c4 vaddr=0x40080400 size=0x01848 ( 6216)
>>> boot = Partition(Partition.BOOT)
>>> boot.info()
(0, 17, 65536, 1376256, 'ota_1', False)
I inserted a few more logs to the set_boot() method:
>>> from esp32 import Partition
>>> running = Partition(Partition.RUNNING)
>>> running.info()
(0, 17, 65536, 1376256, 'ota_1', False)
>>> running.set_boot()
I (43650) Partition Module: Esp Partition type (0)!
I (43650) esp_image: segment 0: paddr=0x00010020 vaddr=0x3f400020 size=0x3da1c (252444) map
I (43800) esp_image: segment 1: paddr=0x0004da44 vaddr=0x3ffb0000 size=0x025cc ( 9676)
I (43800) esp_image: segment 2: paddr=0x00050018 vaddr=0x400d0018 size=0xcc278 (836216) map
I (44270) esp_image: segment 3: paddr=0x0011c298 vaddr=0x3ffb25cc size=0x00b6c ( 2924)
I (44270) esp_image: segment 4: paddr=0x0011ce0c vaddr=0x40080000 size=0x00400 ( 1024)
I (44280) esp_image: segment 5: paddr=0x0011d214 vaddr=0x40080400 size=0x1263c ( 75324)
I (44330) esp_image: segment 6: paddr=0x0012f858 vaddr=0x400c0000 size=0x00064 ( 100)
I (44330) esp_image: segment 7: paddr=0x0012f8c4 vaddr=0x50000000 size=0x00808 ( 2056)
E (44340) Partition Module: esp_ota_set_boot_partition failed (ESP_ERR_INVALID_ARG)!
The boot partition is not set, because of ESP_ERR_INVALID_ARG. According to the IDF reference partition argument was NULL or didn’t point to a valid OTA partition of type “app”.
I did a check immediately before the esp_ota_set_boot_partition() method has been called and it turns out that the partition object is correct and partition type is correct as well.
Has anyone successfully tested set_boot()? Might this be a problem of the IDF version (i am using 6ccb4cf5b7d1fdddb8c2492f9cbc926abaf230df)?