mirror of
https://github.com/apache/nuttx.git
synced 2026-10-06 13:55:15 +00:00
boards: riscv: esp32c6: Add partitioning support for OTA
Add support for memory partitioning for OTA updates. This feature is targeted at the integration of ESP32 boards with RISC-V architecture in conjunction with MCUboot Signed-off-by: davidiogos <davi.silva@agrosystem.com.br>
This commit is contained in:
parent
092af63594
commit
ef56aabe19
1 changed files with 13 additions and 11 deletions
|
|
@ -121,22 +121,23 @@ static int init_ota_partitions(void)
|
|||
{
|
||||
struct mtd_dev_s *mtd;
|
||||
int ret = OK;
|
||||
int i;
|
||||
|
||||
#ifdef CONFIG_BCH
|
||||
char blockdev[18];
|
||||
#endif
|
||||
|
||||
for (int i = 0; i < nitems(g_ota_partition_table); ++i)
|
||||
{
|
||||
const struct ota_partition_s *part = &g_ota_partition_table[i];
|
||||
mtd = esp_spiflash_alloc_mtdpart(part->offset, part->size);
|
||||
|
||||
ret = ftl_initialize(i, mtd);
|
||||
if (ret < 0)
|
||||
for (i = 0; i < nitems(g_ota_partition_table); ++i)
|
||||
{
|
||||
ferr("ERROR: Failed to initialize the FTL layer: %d\n", ret);
|
||||
return ret;
|
||||
}
|
||||
const struct ota_partition_s *part = &g_ota_partition_table[i];
|
||||
mtd = esp_spiflash_alloc_mtdpart(part->offset, part->size);
|
||||
|
||||
ret = ftl_initialize(i, mtd);
|
||||
if (ret < 0)
|
||||
{
|
||||
ferr("ERROR: Failed to initialize the FTL layer: %d\n", ret);
|
||||
return ret;
|
||||
}
|
||||
|
||||
#ifdef CONFIG_BCH
|
||||
snprintf(blockdev, sizeof(blockdev), "/dev/mtdblock%d", i);
|
||||
|
|
@ -148,10 +149,11 @@ static int init_ota_partitions(void)
|
|||
return ret;
|
||||
}
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
/****************************************************************************
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue