mirror of
https://github.com/espressif/esp-idf.git
synced 2024-10-05 20:47:46 -04:00
fix CI failed when flash chip size if 2MBytes
This commit is contained in:
parent
fa68774344
commit
49a236dae0
@ -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);
|
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);
|
printf("Mapping %x (+%x)\n", 0, free_pages * SPI_FLASH_MMU_PAGE_SIZE);
|
||||||
const void *ptr2;
|
const void *ptr2;
|
||||||
ESP_ERROR_CHECK( spi_flash_mmap(0, free_pages * SPI_FLASH_MMU_PAGE_SIZE, SPI_FLASH_MMAP_DATA, &ptr2, &handle2) );
|
ESP_ERROR_CHECK( spi_flash_mmap(0, free_pages * SPI_FLASH_MMU_PAGE_SIZE, SPI_FLASH_MMAP_DATA, &ptr2, &handle2) );
|
||||||
|
Loading…
x
Reference in New Issue
Block a user