diff --git a/components/spi_flash/flash_mmap.c b/components/spi_flash/flash_mmap.c index ebcccc91585..289cc6fcb25 100644 --- a/components/spi_flash/flash_mmap.c +++ b/components/spi_flash/flash_mmap.c @@ -405,7 +405,7 @@ const void * spi_flash_phys2cache(size_t phys_offs, spi_flash_mmap_memory_t memo #endif #if CONFIG_SPIRAM_RODATA - if (phys_page >= rodata_flash_start_page_get() && phys_page <= rodata_flash_start_page_get()) { + if (phys_page >= rodata_flash_start_page_get() && phys_page <= rodata_flash_end_page_get()) { target = MMU_TARGET_PSRAM0; phys_offs -= rodata_flash2spiram_offset() * CONFIG_MMU_PAGE_SIZE; }