Skip to content

Commit a0cc893

Browse files
tmediccixiaoxiang781216
authored andcommitted
boards/xtensa/esp32: Fix the SPI Flash MTD block device number
This commit fixes the SPI flash MTD block device number if OTA's partitions are present. In this case, the OTA partitions are registered first and the corresponding MTD block device drivers are assigned with the numbers corresponding to those partitions. Then, the additional SPI flash partition should consider that when registering its own corresponding MTD block device driver. Signed-off-by: Tiago Medicci Serrano <[email protected]>
1 parent d976c66 commit a0cc893

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

Diff for: boards/xtensa/esp32/common/src/esp32_board_spiflash.c

+4
Original file line numberDiff line numberDiff line change
@@ -429,7 +429,11 @@ static int init_storage_partition(void)
429429
return ret;
430430
}
431431

432+
#ifdef CONFIG_ESP32_HAVE_OTA_PARTITION
433+
ret = ftl_initialize(nitems(g_ota_partition_table), mtd);
434+
#else
432435
ret = ftl_initialize(0, mtd);
436+
#endif
433437
if (ret < 0)
434438
{
435439
syslog(LOG_ERR, "ERROR: Failed to initialize the FTL layer: %d\n",

0 commit comments

Comments
 (0)