esp32 factory+双OTA分区
  7gZJoSEULaLm 2023年11月24日 10 0
# Name,   Type, SubType, Offset,  Size, Flags
# Note: if you have increased the bootloader size, make sure to update the offsets to avoid overlap,,,,
nvs,data, nvs,       0x4000,
otadata,data,ota,       0x4000,
phy_init, data, phy,       0x1000,
factory,  app,  factory,  1M,
ota_0,  app,ota_0,  1M,
ota_1,  app,ota_1,  1M,
[0;32mI (47) boot: Partition Table:[0m
[0;32mI (50) boot: ## Label            Usage          Type ST Offset   Length[0m
[0;32mI (58) boot:  0 nvs              WiFi data        01 02 00009000 00004000[0m
[0;32mI (65) boot:  1 otadata          OTA data         01 00 0000d000 00002000[0m
[0;32mI (73) boot:  2 phy_init         RF data          01 01 0000f000 00001000[0m
[0;32mI (80) boot:  3 factory          factory app      00 00 00010000 00100000[0m
[0;32mI (87) boot:  4 ota_0            OTA app          00 10 00110000 00100000[0m
[0;32mI (95) boot:  5 ota_1            OTA app          00 11 00210000 00100000[0m
[0;32mI (102) boot: End of partition table[0m

  

无factory分区(partitions.csv)

# Name,   Type, SubType, Offset,  Size, Flags
# Note: if you have increased the bootloader size, make sure to update the offsets to avoid overlap,,,,
nvs,data, nvs,,  0x4000,
otadata,data,ota,,  0x2000,
phy_init, data, phy,,  0x1000,
ota_0,  app,ota_0,, 1M,
ota_1,  app,ota_1,, 1M,
[0;32mI (47) boot: Partition Table:[0m
[0;32mI (50) boot: ## Label            Usage          Type ST Offset   Length[0m
[0;32mI (58) boot:  0 nvs              WiFi data        01 02 00009000 00004000[0m
[0;32mI (65) boot:  1 otadata          OTA data         01 00 0000d000 00002000[0m
[0;32mI (73) boot:  2 phy_init         RF data          01 01 0000f000 00001000[0m
[0;32mI (80) boot:  3 ota_0            OTA app          00 10 00010000 00100000[0m
[0;32mI (87) boot:  4 ota_1            OTA app          00 11 00110000 00100000[0m
[0;32mI (95) boot: End of partition table[0m

 

  • idf.py partition-table

 

  设置ota_1为启动区

esp_ota_get_running_partition

esp_partition_t *partition = esp_partition_find_first(ESP_PARTITION_TYPE_APP, ESP_PARTITION_SUBTYPE_ANY, "ota_1");
    if (partition == NULL)
    {
        ESP_LOGE(TAG, "OTA partition not found.");
        return;
    }
    esp_err_t err = esp_ota_set_boot_partition(partition);
    if (err != ESP_OK)
    {
        ESP_LOGE(TAG, "Failed to set boot partition.");
        return;
    }

  



【版权声明】本文内容来自摩杜云社区用户原创、第三方投稿、转载,内容版权归原作者所有。本网站的目的在于传递更多信息,不拥有版权,亦不承担相应法律责任。如果您发现本社区中有涉嫌抄袭的内容,欢迎发送邮件进行举报,并提供相关证据,一经查实,本社区将立刻删除涉嫌侵权内容,举报邮箱: cloudbbs@moduyun.com

  1. 分享:
最后一次编辑于 2023年11月24日 0

暂无评论

推荐阅读
  tqf4faUYHHCA   2023年12月23日   70   0   0 sedpythonPythonsed
  P4Buhht98JbZ   2023年12月22日   55   0   0 sedideciciidesed
7gZJoSEULaLm