koendv/micropython-spiram

About cache problems when write data in memory-mapped mode

sudashannon opened this issue · 5 comments

Hi koendv, thank you for your repo. It helps me to deal with the OSPI psram.
To solve the cache problems when write, I take the stm32's AN5050 for an example and it says:
image
image
image
So I change my OSPI configuration to:
image
And rerun the memtest without cache_invalidate and cache_clean operation, it succeed!
image
image

F.Y.I

Besides, I also change this region to MPU_ACCESS_NOT_BUFFERABLE.

Hi koen:
These days I have been tested different ospi configuration and MPU configuration and come the conclusion that:

  1. OSPI configuraion is not the key to solve the cache problems.
  2. Aceess to memory-mapped memory will be valid only if the MPU is set to write-through or undefined, but when MPU is set to undefined, the memory-mapped memory will not support unaligned access:
    image
    BRs
    Leon
koendv commented
koendv commented