esp32 factory+双OTA分区

1
2
3
4
5
6
7
8
# 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,
1
2
3
4
5
6
7
8
9
I (47) boot: Partition Table:
I (50) boot: ## Label            Usage          Type ST Offset   Length
I (58) boot:  0 nvs              WiFi data        01 02 00009000 00004000
I (65) boot:  1 otadata          OTA data         01 00 0000d000 00002000
I (73) boot:  2 phy_init         RF data          01 01 0000f000 00001000
I (80) boot:  3 factory          factory app      00 00 00010000 00100000
I (87) boot:  4 ota_0            OTA app          00 10 00110000 00100000
I (95) boot:  5 ota_1            OTA app          00 11 00210000 00100000
I (102) boot: End of partition table

  

无factory分区(partitions.csv)

1
2
3
4
5
6
7
# 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,
1
2
3
4
5
6
7
8
I (47) boot: Partition Table:
I (50) boot: ## Label            Usage          Type ST Offset   Length
I (58) boot:  0 nvs              WiFi data        01 02 00009000 00004000
I (65) boot:  1 otadata          OTA data         01 00 0000d000 00002000
I (73) boot:  2 phy_init         RF data          01 01 0000f000 00001000
I (80) boot:  3 ota_0            OTA app          00 10 00010000 00100000
I (87) boot:  4 ota_1            OTA app          00 11 00110000 00100000
I (95) boot: End of partition table

 

  • idf.py partition-table

 

  设置ota_1为启动区

esp_ota_get_running_partition

1
2
3
4
5
6
7
8
9
10
11
12
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;
    }

  

posted @   ahuo  阅读(171)  评论(0编辑  收藏  举报
相关博文:
阅读排行:
· DeepSeek 开源周回顾「GitHub 热点速览」
· 物流快递公司核心技术能力-地址解析分单基础技术分享
· .NET 10首个预览版发布:重大改进与新特性概览!
· AI与.NET技术实操系列(二):开始使用ML.NET
· 单线程的Redis速度为什么快?
历史上的今天:
2016-10-20 命令行查句柄数
2015-10-20 matlab 使用OPENCV
点击右上角即可分享
微信分享提示