fix CI failed when flash chip size if 2MBytes
@@ -300,6 +300,10 @@ TEST_CASE("flash_mmap can mmap after get enough free MMU pages", "[spi_flash]")
}
}
uint32_t free_pages = spi_flash_mmap_get_free_pages(SPI_FLASH_MMAP_DATA);
+ if (spi_flash_get_chip_size() <= 0x200000) {
+ free_pages -= 0x200000/0x10000;
+ }
+
printf("Mapping %x (+%x)\n", 0, free_pages * SPI_FLASH_MMU_PAGE_SIZE);
const void *ptr2;
ESP_ERROR_CHECK( spi_flash_mmap(0, free_pages * SPI_FLASH_MMU_PAGE_SIZE, SPI_FLASH_MMAP_DATA, &ptr2, &handle2) );
