PaulStoffregen / cores

Teensy Core Libraries for Arduino
519 stars 374 forks source link

enable prefetching when accessing PSRAM over AHB #708

Open A-Dunstan opened 1 year ago

A-Dunstan commented 1 year ago

The prefetch feature of FlexSPI2 is not being activated in FLEXSPI2_AHBCR, reducing performance when PSRAM is accessed sequentially. This commit turns it on and allocates all prefetch buffer space to RXBUF3 which will be used for all AHB masters (CPU/DMA/DCP/others).

As an example of possible performance improvement, this reduces the time for the psram test sketch from 36.54 seconds to 29.99 seconds (1x 8MB PSRAM, default 88MHz clock speed).

Defragster commented 1 year ago

Did some testing with this - variation of above psram test sketch and also went to LittleFS in PSRAM and ran Integrity test.

Saw same faster 8MB perf and also faster on 16MB T_4.1 to verified tests passed - the LittleFS Integrity seemed 5% faster and no errors.

Results noted here - that post #114 and #115