Sometimes moving performance sensitive code into SRAM rather than flash RAM helps. The XIP cache is small and only 2-way set associative so its easy for code or data that will be needed soon to be evicted. To force code into SRAM, there is the __not_in_flash_func macro. For example: https://github.com/raspberrypi/pico-sdk ... _spi/spi.c
You also have some constants that might be loaded from flash RAM and thus cause a cache miss:A simple way to have them backed by SRAM would be to remove the const qualifier:I all of your code and data fits in XIP cache then this might not make a difference but it's relatively easy to try.
You also have some constants that might be loaded from flash RAM and thus cause a cache miss:
Code:
static const double_t a0=0.005943; static const double_t a1=-0.007193; static const double_t a2=0.005943; static const double_t b1=1.9055333; static const double_t b2=-0.9102498;
Code:
static double_t a0=0.005943; static double_t a1=-0.007193; static double_t a2=0.005943; static double_t b1=1.9055333; static double_t b2=-0.9102498;
Statistics: Posted by alastairpatrick — Sat Feb 03, 2024 1:14 am