Skip to content

Commit 49a236d

Browse files
committed
fix CI failed when flash chip size if 2MBytes
1 parent fa68774 commit 49a236d

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

components/spi_flash/test/test_mmap.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -300,6 +300,10 @@ TEST_CASE("flash_mmap can mmap after get enough free MMU pages", "[spi_flash]")
300300
}
301301
}
302302
uint32_t free_pages = spi_flash_mmap_get_free_pages(SPI_FLASH_MMAP_DATA);
303+
if (spi_flash_get_chip_size() <= 0x200000) {
304+
free_pages -= 0x200000/0x10000;
305+
}
306+
303307
printf("Mapping %x (+%x)\n", 0, free_pages * SPI_FLASH_MMU_PAGE_SIZE);
304308
const void *ptr2;
305309
ESP_ERROR_CHECK( spi_flash_mmap(0, free_pages * SPI_FLASH_MMU_PAGE_SIZE, SPI_FLASH_MMAP_DATA, &ptr2, &handle2) );

0 commit comments

Comments
 (0)