ESP performance and cache
Posted: Mon Dec 17, 2018 1:52 pm
I have run out of IRAM and so start to need to understand performance issues relating to the Cache, ROM and FLASH.
The manuals are not entirely clear about what can run and I have not found any performance details/estimates.
I will make a few statements in order to draw comment, please correct me as needed!
1) User application code may be run directly from internal ROM (448 KB)
If so what frequency does this work at & how does that compare to IRAM?
If so, do I use ROMFN_ATTR to locate in internal ROM & how do I check how much is free?
2) User application code may be placed and executed directly within RTC fast memory using RTC_IRAM_ATTR
and may also be called from regular functions.
If so how does RTC_IRAM_ATTR performance compare to IRAM. Is RTC_IRAM_ATTR the same speed as IRAM?
3) External Flash code memory
Is external memory fetched directly by the MMU over QSPI or is software involved?
If software is involved, what latency might I expect?
What throughput may I expect? I am guessing <20MB/S?? This gives me >500uS on a 10 KB code block.
4) External Flash
3.1.3 of the Esp32 datasheet suggests that external flash may be configured as instruction memory or read only memory.
I have a large Webserver which I intended to place within SPIFFS but could use another file system.
How do I ensure that the Webserver memory is ' mapped into read-only data memory space' and so prevent the reduction of cache performance discussed in section 3.1.3?
I found spi_flash_mmap() but usage is not clear.
5) External Memory & Cache
I did not follow the wording in 1.3.4 of the technical reference what does
Is this just a comment that two updates to bits in one register may not go as expected?
Thanks
The manuals are not entirely clear about what can run and I have not found any performance details/estimates.
I will make a few statements in order to draw comment, please correct me as needed!
1) User application code may be run directly from internal ROM (448 KB)
If so what frequency does this work at & how does that compare to IRAM?
If so, do I use ROMFN_ATTR to locate in internal ROM & how do I check how much is free?
2) User application code may be placed and executed directly within RTC fast memory using RTC_IRAM_ATTR
and may also be called from regular functions.
If so how does RTC_IRAM_ATTR performance compare to IRAM. Is RTC_IRAM_ATTR the same speed as IRAM?
3) External Flash code memory
Is external memory fetched directly by the MMU over QSPI or is software involved?
If software is involved, what latency might I expect?
What throughput may I expect? I am guessing <20MB/S?? This gives me >500uS on a 10 KB code block.
4) External Flash
3.1.3 of the Esp32 datasheet suggests that external flash may be configured as instruction memory or read only memory.
I have a large Webserver which I intended to place within SPIFFS but could use another file system.
How do I ensure that the Webserver memory is ' mapped into read-only data memory space' and so prevent the reduction of cache performance discussed in section 3.1.3?
I found spi_flash_mmap() but usage is not clear.
5) External Memory & Cache
I did not follow the wording in 1.3.4 of the technical reference what does
mean?CACHE_MUX_MODE is set to 1 or 2, PRO CPU and APP CPU cannot enable the Cache function at the same time
Is this just a comment that two updates to bits in one register may not go as expected?
Thanks